OSPF多区域虚链路
1.对所有路由器进行基本配置,使得area2和area1 互通,area 0内部通信
#R1
sys
Enter system view, return user view withCtrl+Z.
[Huawei]int eth 0/0/0
[Huawei-Ethernet0/0/0]ip address 12.1.1.1 255.255.255.252
[Huawei-Ethernet0/0/0]undo shutdown
[Huawei-Ethernet0/0/0]q
[Huawei]int loopback 0
[Huawei-LoopBack0]ip add 1.1.1.1 32
[Huawei-LoopBack0]q
[Huawei]ospf 1 router-id 1.1.1.1
[Huawei-ospf-1]area 2
[Huawei-ospf-1-area-0.0.0.2]network 12.1.1.0 0.0.0.3
[Huawei-ospf-1-area-0.0.0.2]network 1.1.1.1 0.0.0.0
#R2
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int eth0/0/0
[Huawei-Ethernet0/0/0]ip add 12.1.1.2 255.255.255.252
[Huawei-Ethernet0/0/0]q
[Huawei]int eth0/0/1
[Huawei-Ethernet0/0/1]ip add 23.1.1.1 255.255.255.252
[Huawei]int loopback 0
[Huawei-LoopBack0]ip add 2.2.2.2 32
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]network 23.1.1.0 0.0.0.3
[Huawei-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[Huawei-ospf-1-area-0.0.0.1]q
[Huawei-ospf-1]q
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 2
[Huawei-ospf-1-area-0.0.0.2]network 12.1.1.0 0.0.0.3
#R3
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int eth0/0/0
[Huawei-Ethernet0/0/0]ip add 23.1.1.2 255.255.255.252
[Huawei-Ethernet0/0/0]q
[Huawei]int loopback 0
[Huawei-LoopBack0]ip add 3.3.3.3 32
[Huawei]int eth0/0/1
[Huawei-Ethernet0/0/1]ip add 34.1.1.1 255.255.255.252
[Huawei-Ethernet0/0/1]q
[Huawei]ospf 1 router-id 3.3.3.3
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]network 23.1.1.0 0.0.0.3
[Huawei-ospf-1-area-0.0.0.1]q
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 34.1.1.0 255.255.255.252
[Huawei-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
#R4
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int eth0/0/0
[Huawei-Ethernet0/0/0]ip add 34.1.1.2 255.255.255.252
[Huawei-Ethernet0/0/0]q
[Huawei]int loopback 0
[Huawei-LoopBack0]ip add 4.4.4.4 32
[Huawei-LoopBack0]q
[Huawei]ospf 1 router-id 4.4.4.4
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.3
[Huawei-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
现在我们在R2和R3做虚链路:
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]vlink-peer 3.3.3.3
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2
验证:
R1 ping R4
验证:
R4 ping R1