华为路由器虚电路、完全末节和非完全末节的配置
姓名:于东华
实验一
要求:在不同区域area0、area1、area3启用ospf,在另一区域启用rip,并在area1实现虚电路
路由器R1的配置
[R1]interface Ethernet 0/1
[R1-Ethernet0/1]ip add 192.168.2.1 255.255.255.0
[R1]interface Ethernet 0/2
[R1-Ethernet0/2]ip add 192.168.1.1 255.255.255.0
[R1-Ethernet0/2]loop
[R1]ospf
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]net 192.168.1.0 0.0.0.0
[R1-ospf-1-area-0.0.0.0]net 192.168.2.0 0.0.0.0
如果R1为交换机,则需要先创建vlan ,进入vlan端口在设ip地址,先进ospf,然后area 1 ,stub,指定末节。
路由器R2的配置
[R2]interface Ethernet 1
[R2-Ethernet0/1]ip add 192.168.2.2 255.255.255.0
[R2]interface Ethernet 2
[R2-Ethernet0/2]ip add 192.168.3.1 255.255.255.0
[R2]ospf enable
[R2]inter e0
[R2-Ethernet0]ospf enable area 0
[R2]quit
[R2]inter e1
[R2-Ethernet1]ospf enable area 1
[R2]interface s0
[R2-Ethernet0/1]ip add 192.168.6.1 255.255.255.0
路由器R3的配置
[R3]interface e2
[R3-Ethernet2]ip add 192.168.3.1 255.255.255.0
[R3]interface e1
[R3-Ethernet1]ip add 192.168.4.1 255.255.255.0
[R3]ospf enable
[R3]inter e2
[R3-Ethernet0]ospf enable area 1
[R3]quit
[R3]inter e1
[R3-Ethernet1]ospf enable area 2
路由器R4的配置
[R4]interface e2
[R4-Ethernet2]ip add 192.168.5.1 255.255.255.0
[R4]interface e1
[R4-Ethernet1]ip add 192.168.4.2 255.255.255.0
[R4]ospf enable
[R4]inter e2
[R4-Ethernet0]ospf enable area 2
[R4]quit
[R4]inter e1
[R4-Ethernet1]ospf enable area 2
路由器R5的配置
[R5]interface s0
[R-Ethernet2]ip add 192.168.6.2 255.255.255.0
[R5]interface e1
[R5-Ethernet1]ip add 192.168.7.1 255.255.255.0
[R5]rip
[R5-rip]network 192.168.6.0
[R5-rip]network 192.168.6.0
1.实现虚电路
[R2-ospf]dis ospf peer
Neighbor ID Priority State Mode Address Interface
192.168.1.1 1 Full Master 192.168.2.1 Ethernet0
192.168.101.2 1 Full Slave 192.168.3.2 Ethernet1
[R2-ospf]vlink peer-id 192.168.101.2 transit 1
[R3]dis ospf peer
Area 0.0.0.1 interface 192.168.3.2(Vlan-interface10)'s neighbor(s)
RouterID: 192.168.6.1 Address: 192.168.3.1
State: Full Mode: Nbr is Slave Priority: 1
DR: 192.168.3.1 BDR: 192.168.3.2
Dead timer expires in 39s
Neighbor comes up for 00:14:39
[R3]ospf
[R3-ospf]vlink peer-id 192.168.6.1 transit 1
测试效果在R4上ping R1
实验二
要求; 在不同区域area0、area1、area3启用ospf,在另一区域启用rip,在area2实验完全末节和非完全末节。(是需要在区域边界路由器上内部路由器上做配置就行了)
在上一实验设备上做稍微修改,修改好拓扑如上图,实现完全末节
[R3]ospf
[R3-ospf]stub cost 100 area 2 no-summary
[R4]ospf
[R4-ospf]stub cost 100 area 2
测试如下图
实现非完全末节(可以接受类型三和类型四的路由)
[R3-ospf-area-0.0.0.2]undo stub //除去完全末节
[R3-ospf-area-0.0.0.2]stub
测试如下图
在R3上查看路由
转载于:https://blog.51cto.com/yudonghua/1076617