【R10】ospf
area1
vlink-peer 对端router-id
[R18]ospf
area1
vlink-peer 对端router-id
display ospf vlink 查看虚链路状态
注意:虚链路只能帮助一个非骨干跨越非骨干区域,虚链路属于area0
实验目的:建立虚链路,实现R1,R2,R3,R4,R5之间通信
实验步骤:
1.分别设置好R1,R2,R3,R4,R5的回环地址和各端口IP地址
R1配置:
undo terminal monitor
sys
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]quit
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 1.1.1.1 32
[Huawei-LoopBack0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 12.1.1.1 24
R2配置
undo terminal monitor
sys
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]quit
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 2.2.2.2 32
[Huawei-LoopBack0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 23.1.1.1 24
R3配置
undo terminal monitor
sys
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]quit
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 3.3.3.3 32
[Huawei-LoopBack0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 34.1.1.1 24
R4配置
undo terminal monitor
sys
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]quit
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 4.4.4.4 32
[Huawei-LoopBack0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 34.1.1.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 45.1.1.1 24
R5配置
undo ter monitor
sys
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]quit
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 5.5.5.5 32
[Huawei-LoopBack0]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 45.1.1.1 24
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]undo ip add 45.1.1.1 24
[Huawei-GigabitEthernet0/0/0]ip add 45.1.1.2 24
2.宣告直连网络至相应区域
R1
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]ospf 1 router-id 1.1.1.1
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[Huawei-ospf-1-area-0.0.0.1]network 12.1.1.0 0.0.0.255
R2
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]area 1
[Huawei-ospf-1-area-0.0.0.1]network 12.1.1.0 0.0.0.255
R3
[Huawei]ospf 1 router-id 3.3.3.3
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]area 2
[Huawei-ospf-1-area-0.0.0.2]network 34.1.1.0 0.0.0.255
R4
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]ospf 1 router-id 4.4.4.4
[Huawei-ospf-1]area 2
[Huawei-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
[Huawei-ospf-1-area-0.0.0.2]network 34.1.1.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.2]area 3
[Huawei-ospf-1-area-0.0.0.3]network 45.1.1.0 0.0.0.255
R5
[Huawei]ospf 1 router-id 5.5.5.5
[Huawei-ospf-1]area 3
[Huawei-ospf-1-area-0.0.0.3]network 5.5.5.5 0.0.0.0
[Huawei-ospf-1-area-0.0.0.3]network 45.1.1.0 0.0.0.255
3.建立虚链路(R3-R4)
R3配置
[Huawei]ospf
[Huawei-ospf-1]area 2
[Huawei-ospf-1-area-0.0.0.2]vlink-peer 4.4.4.4
R4配置
[Huawei]ospf
[Huawei-ospf-1]area 2
[Huawei-ospf-1-area-0.0.0.2]vlink-peer 3.3.3.3
4.测试连通性
以R5和R1测试
[Huawei]ping -a 5.5.5.5 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=252 time=60 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=252 time=30 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=252 time=40 ms
Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=252 time=40 ms
Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=252 time
[Huawei]ping 12.1.1.1
PING 12.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 12.1.1.1: bytes=56 Sequence=1 ttl=252 time=40 ms
Reply from 12.1.1.1: bytes=56 Sequence=2 ttl=252 time=30 ms
Reply from 12.1.1.1: bytes=56 Sequence=3 ttl=252 time=50 ms
Reply from 12.1.1.1: bytes=56 Sequence=4 ttl=252 time=40 ms
Reply from 12.1.1.1: bytes=56 Sequence=5 ttl=252 time=40 ms
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 56.1.1.1 24
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]rip
[Huawei-rip-1]version 2
[Huawei-rip-1]undo summary
[Huawei-rip-1]network 56.0.0.0
[Huawei-rip-1]quit
[Huawei]ospf 1
[Huawei-ospf-1]import-route rip 1 cost 100
[Huawei-ospf-1]rip 1
[Huawei-rip-1]import-route ospf 1 cost 0
R6配置
undo terminal monitor
sys
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0 0
[Huawei-ui-console0]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 56.1.1.2 24
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 6.6.6.6 32
[Huawei-LoopBack0]quit
[Huawei]rip
[Huawei-rip-1]version 2
[Huawei-rip-1]undo summary
[Huawei-rip-1]network 56.0.0.0
[Huawei-rip-1]network 6.0.0.0
测试连通性
Huawei]ping -a 6.6.6.6 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=251 time=40 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=251 time=40 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=251 time=30 ms
Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=251 time=30 ms
Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=251 time=30 ms