OSPF之virtual-link

OSPF之virtual-link

实验用的拓扑如下:

1 Virtual-link简介:

OSPF采用由两层组成的分层结构,因此如果有多个区域,则其中一个必须为区域0,既骨干区域;其他所有区域都与区域0相连,且区域0必须是连续的。OSPF要求所有非骨干区域都将路由通告给骨干区域,以便这些路由通告到其他区域。
使用虚链路,可以将不连续的区域0连接起来,还可以将区域中转区域连接到区域0。
虚链路依赖于底层区域内路由选择的稳定性。虚链路不能穿越多个区域,也不能穿越末节区域,而只能穿越标准的非骨干区域。
如果需要使用虚链路穿越两个非骨干区域连接到骨干区域,将需要两条虚链路------每个区域一条。
在虚链路上,Hello协议的工作方式和在标准链路上相同,每隔10秒发送一个hello分组。

2配置OSPF虚链路:

要配置OSPF虚链路,可以使用路由器配置命令:
area area-id virtual-link router-id [authentication [message-digest | null] [hello-interval seconds] [restransmit-interval seconds][transmit-delay seconds][dead-interval seconds][[authentication-key key]|[message-digest-key key-id md5 key]];
要删除虚链路,可以使用该命令的no格式。

参数说明:
area-id:指定虚链路经过的中转区域的区域ID,可以是十进制,也可以是类似于IP地址的点分十进制格式。没有默认值,中转区域不能是末节区域
router-id:指定虚链路另一端的路由器的路由ID。可以使用命令show ip ospf 来获取路由器的ID,没有默认值。
authentication:(可选)指定身份验证类型
message-digest:(可选)指定使用MD5身份验证
authentication-key key:(可选)指定邻接路由进行简单密码身份验证时使用的密码,最长为8个字符,没有默认值
message-digest-key key-id md5key;(可选)指定邻接路由器进行MD5身份验证时使用过的密钥ID和密钥。

3查看OSPF虚链路运行的状况:

命令show ip ospf virtual-link用于查看OSPF虚链路的运行状况。

4每个路由器的配置

R1的配置:
interface Loopback0
 ip address 1.1.1.1 255.255.255.0
 no shut

interface Serial1/0
 ip address 192.168.12.1 255.255.255.0
 no shut
 
router ospf 100
 network 1.1.1.0 0.0.0.255 area 1
 network 192.168.12.0 0.0.0.255 area 1

R2的配置:
interface Loopback0
 ip address 2.2.2.2 255.255.255.0
 no shut
interface Serial1/0
 ip address 192.168.12.2 255.255.255.0
 no shut
!
interface Serial1/1
 ip address 192.168.23.1 255.255.255.0
 no shut
router ospf 100
  area 2 virtual-link 3.3.3.3
 network 2.2.2.0 0.0.0.255 area 1
 network 192.168.12.0 0.0.0.255 area 1
 network 192.168.23.0 0.0.0.255 area 2
 
R3的配置:
interface Loopback0
 ip address 3.3.3.3 255.255.255.0
 no shut
interface Serial1/0
 ip address 192.168.23.2 255.255.255.0
 no shut
!
interface Serial1/1
 ip address 192.168.34.1 255.255.255.0
 no shut
!
router ospf 100
 log-adjacency-changes
 area 2 virtual-link 2.2.2.2
 network 3.3.3.0 0.0.0.255 area 0
 network 192.168.23.0 0.0.0.255 area 2
 network 192.168.34.0 0.0.0.255 area 0
!         
R4的配置:
interface Loopback0
 ip address 4.4.4.4 255.255.255.0
!
interface Serial1/0
 ip address 192.168.34.2 255.255.255.0
 no shut
router ospf 100
 network 4.4.4.0 0.0.0.255 area 0
 network 192.168.34.0 0.0.0.255 area 0
!

R1上的路由:
R1#show ip route 
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route


Gateway of last resort is not set


C    192.168.12.0/24 is directly connected, Serial1/0
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/65] via 192.168.12.2, 03:35:55, Serial1/0
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/129] via 192.168.12.2, 00:12:50, Serial1/0
     4.0.0.0/32 is subnetted, 1 subnets
O IA    4.4.4.4 [110/193] via 192.168.12.2, 00:12:50, Serial1/0
O IA 192.168.23.0/24 [110/128] via 192.168.12.2, 00:13:00, Serial1/0
O IA 192.168.34.0/24 [110/192] via 192.168.12.2, 00:12:52, Serial1/0





  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值