本文主要是介绍ospf区域与骨干区域不相连的通信方法-虚链路,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在区域2要穿过的区域上配置虚链路;该实验中区域2要穿过区域1与骨干区域通信;
配置过程:
R1:
interface GigabitEthernet0/0/1
ip address 10.1.14.1 255.255.255.0
ospf 1
area 0.0.0.0
network 10.1.14.0 0.0.0.255
R2:
interface GigabitEthernet0/0/0
ip address 10.1.24.2 255.255.255.0
ospf 1
area 0.0.0.0
network 10.1.24.0 0.0.0.255
R4:
interface GigabitEthernet0/0/0
ip address 10.1.24.4 255.255.255.0
interface GigabitEthernet0/0/1
ip address 10.1.14.4 255.255.255.0
interface GigabitEthernet0/0/2
ip address 10.1.45.4 255.255.255.0
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 10.1.14.0 0.0.0.255
network 10.1.24.0 0.0.0.255
area 0.0.0.1
network 10.1.45.0 0.0.0.255
vlink-peer 5.5.5.5 // 配置虚链路5.5.5.5为区域1中R4的邻居的router-id
R5:
interface GigabitEthernet0/0/0
ip address 10.1.56.5 255.255.255.0
interface GigabitEthernet0/0/2
ip address 10.1.45.5 255.255.255.0
ospf 1 router-id 5.5.5.5
area 0.0.0.1
network 10.1.45.0 0.0.0.255
vlink-peer 4.4.4.4 // 配置虚链路4.4.4.4为区域1的邻居的router-id
area 0.0.0.2
network 10.1.56.0 0.0.0.255
R6:
interface GigabitEthernet0/0/0
ip address 10.1.56.6 255.255.255.0
interface GigabitEthernet4/0/0
ip address 1.1.1.254 255.255.255.0
interface GigabitEthernet4/0/1
ip address 2.2.2.254 255.255.255.0
interface GigabitEthernet4/0/2
ip address 3.3.3.254 255.255.255.0
ospf 1
import-route direct //发布直连路由
area 0.0.0.2
network 10.1.56.0 0.0.0.255
检验:
没有配置虚链路的情况下R4、R6的路由表:
R1与PC1的通信情况:
配置虚链路后:
R4上的路由表:
R6上的路由表:
R1与PC1 的通信情况:
要是忘记设置router-id也不要紧,可以后面再重新设置,但是要重启ospf进程,重启进程命令:
reset ospf process
这篇关于ospf区域与骨干区域不相连的通信方法-虚链路的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!