虚链路与重分发实验

虚链路

虚链路使用场合:一个非骨干区域跨越另一个非骨干区域时使用

作用:帮助这个非骨干区域获取完整的LSDB(链路状态数据库)

拓扑原理图
虚链路与重分发实验_第1张图片

命令:非骨干区域的中转区域:

【R10】ospf
area1
vlink-peer 对端router-id
[R18]ospf
area1
vlink-peer 对端router-id
display ospf vlink 查看虚链路状态
注意:虚链路只能帮助一个非骨干跨越非骨干区域,虚链路属于area0

实验:

实验拓扑图:

虚链路与重分发实验_第2张图片
实验目的:建立虚链路,实现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


重分发

再加一个路由器使用RIPV2协议。OSPF与RIPV2之间的路由器为区域边界路由器,需要使用双向重分发技术,使两个协议区域相互通信。

拓扑图

虚链路与重分发实验_第3张图片
接上虚链路配置
R5配置

[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

你可能感兴趣的:(虚链路与重分发实验)