ospf虚链路原理和配置
了解ospf虚链路的作用:将设计不合理的非骨干区域连接到骨干区域, 2.用于修复(连接)断裂的ospf骨干区域 了解ospf虚链路的特点:1.只能配置在两个ABR之间 2.虚链路的稳定性取决于(穿越区域)的稳定性, 永远区域ospf骨干区域,不能穿越特殊区域,不能穿越区域0 了解ospf区域设计不合理的常用解决方案:1.一条通过一个非骨干区域连接到骨干区域的虚链路, 2.同时运行多个ospf进程然后进行进程导入
[R1]ospf 1 [R1-ospf-1]area 1 [R1-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2
[R2]ospf 1 [R2-ospf-1]area 1 [R2-ospf-1-area-0.0.0.1]vlink-peer 1.1.1.1 R1R2的ospf区域1里同时运行虚拟链路邻接命令route id
[R3]dis ospf brief /查看ospf表 <R2>dis ospf lsdb asbr
第二种解决方式 多ospf进程互相重分发/路由导入 R2: [R2]ospf 2 router-id 2.2.2.2 [R2-ospf-2]area 1 [R2-ospf-2-area-0.0.0.1]network 192.168.12.0 0.0.0.255 [R2]ospf 2 router-id 2.2.2.2 [R2-ospf-2]area 2 [R2-ospf-2-area-0.0.0.2]network 192.168.23.0 0.0.0.255 [R2-ospf-2-area-0.0.0.2]q [R2-ospf-2]q [R2]ospf 1 [R2-ospf-1]import-route ospf 2 [R2-ospf-1]q [R2]ospf 2 [R2-ospf-2]import-route ospf 1 [R2-ospf-2]q [R2]dis ospf peer brief
3 案例3:OSPF虚链路配置
3.1 问题
如图配置IP地址和OSPF网络 公司网络扩容,新区域与骨干区域无法相连,通过配置虚链路解决问题 3.2 方案 搭建实验环境,如图-3所示。
图-3
3.3 步骤 实现此案例需要按照如下步骤进行。
1)配置IP地址和OSPF网络
interface GigabitEthernet0/0/0
ip address 192.168.14.1 255.255.255.0
quit
interface GigabitEthernet0/0/1
ip address 192.168.12.1 255.255.255.0
quit
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.14.0 0.0.0.255
quit
area 0.0.0.1
network 192.168.12.0 0.0.0.255
quit
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.14.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.12.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.14.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 192.168.12.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]quit
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]sysname R4
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.14.4 24
[R4-GigabitEthernet0/0/0]quit
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 192.168.14.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]quit
<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]sysname R2
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.12.2 24
[R2-GigabitEthernet0/0/1]quit
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.23.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 192.168.12.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]quit
[R2-ospf-1]area 2
[R2-ospf-1-area-0.0.0.2]network 192.168.23.0 0.0.0.255
[R2-ospf-1-area-0.0.0.2]quit
2)在R1和R2之前配置虚链路
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]vlink-peer 1.1.1.1
[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2
3)验证 R3 和 R4 可以互相 Ping 通
[R3]ping 192.168.14.4 PING 192.168.14.4: 56 data bytes, press CTRL_C to break Reply from 192.168.14.4: bytes=56 Sequence=1 ttl=255 time=30 ms Reply from 192.168.14.4: bytes=56 Sequence=2 ttl=255 time=20 ms Reply from 192.168.14.4: bytes=56 Sequence=3 ttl=255 time=10 ms Reply from 192.168.14.4: bytes=56 Sequence=4 ttl=255 time=30 ms Reply from 192.168.14.4: bytes=56 Sequence=5 ttl=255 time=10 ms --- 192.168.14.4 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 10/20/30 ms [R4]ping 192.168.23.3 PING 192.168.23.3: 56 data bytes, press CTRL_C to break Reply from 192.168.23.3: bytes=56 Sequence=1 ttl=255 time=30 ms Reply from 192.168.23.3: bytes=56 Sequence=2 ttl=255 time=20 ms Reply from 192.168.23.3: bytes=56 Sequence=3 ttl=255 time=10 ms Reply from 192.168.23.3: bytes=56 Sequence=4 ttl=255 time=30 ms Reply from 192.168.23.3: bytes=56 Sequence=5 ttl=255 time=10 ms --- 192.168.23.3 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 10/20/30 ms