关于RIP协议更新时间导致转发异常问题
一、 组网图:
二、 测试步骤:
1、 上图中四台SW均为我司三层交换机,按照拓扑连接,配置对应Vlan和IP地址。在设备上使能RIP协议,确保路由学习正常。
2、 SW1和SW4作为网络出口设备,分别向SW2和SW3发送缺省路由。
SW1:
#
interface Vlan-interface12
ip address 12.1.1.1 255.255.255.0
rip default-route only
#
SW4:
#
interface Vlan-interface34
ip address 34.1.1.4 255.255.255.0
rip default-route only
#
3、 以SW3为例,正常情况下路由表如下:
dis ip routing-table Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 RIP 100 1 34.1.1.4 Vlan34
12.0.0.0/8 RIP 100 1 23.1.1.2 Vlan23
23.1.1.0/24 Direct 0 0 23.1.1.3 Vlan23
23.1.1.3/32 Direct 0 0 127.0.0.1 InLoop0
34.1.1.0/24 Direct 0 0 34.1.1.3 Vlan34
34.1.1.3/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
SW3正常情况下,将会收到两条缺省路由,分别从SW4和SW2传递过来。由于从SW4收到的缺省路由cost小于从SW2收到的,因此设备rip表和路由表中仅记录从SW4收到cost为1的缺省路由。忽略从SW2收到cost为2的缺省路由。
dis rip 1 route Peer 23.1.1.2 on Vlan-interface23
Destination/Mask Nexthop Cost Tag Flags Sec
12.0.0.0/8 23.1.1.2 1 0 RA 2
Peer 34.1.1.4 on Vlan-interface34
Destination/Mask Nexthop Cost Tag Flags Sec
0.0.0.0/0 34.1.1.4 1 0 RA 9
dis rip 1 database 0.0.0.0/0, cost 1, nexthop 34.1.1.4
12.0.0.0/8, cost 1, ClassfulSumm
12.0.0.0/8, cost 1, nexthop 23.1.1.2
23.0.0.0/8, cost 0, ClassfulSumm
23.1.1.0/24, cost 0, nexthop 23.1.1.3, Rip-interface
34.0.0.0/8, cost 0, ClassfulSumm
34.1.1.0/24, cost 0, nexthop 34.1.1.3, Rip-interface
4、 当SW3与SW4互联链路断开后,SW3将发送cost为16的更新报文。
此时SW2收到SW3 cost为16的更新报文后,SW2将本地路由表更新
dis ip routing-table Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 RIP 100 1 12.1.1.1 Vlan12
12.1.1.0/24 Direct 0 0 12.1.1.2 Vlan12
12.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
23.1.1.0/24 Direct 0 0 23.1.1.2 Vlan23
23.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
5、 此时,可能存在SW2的RIP更新计时器还没有到达下次更新时间。因此可能在链路断开后,最长需等待30秒(RIP默认更新周期),SW3才能学到从SW2传递的cost为2的缺省路由。
当链路断开当时,SW3无法立即学习到新的缺省路由:
[sw3]dis ip routing-table
Routing Tables: Public
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost NextHop Interface
12.0.0.0/8 RIP 100 1 23.1.1.2 Vlan23
23.1.1.0/24 Direct 0 0 23.1.1.3 Vlan23
23.1.1.3/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
最长需等待30秒后,SW3路由完成收敛:
dis ip routing-table Routing Tables: Public
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 RIP 100 2 23.1.1.2 Vlan23
12.0.0.0/8 RIP 100 1 23.1.1.2 Vlan23
23.1.1.0/24 Direct 0 0 23.1.1.3 Vlan23
23.1.1.3/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
三、 测试总结:
受RIP协议路由更新机制影响,在以上组网环境下,存在路由无法及时收敛,造成网络存在最大30秒的故障时间。建议在对路由收敛较高的网络中部署如ospf、isis等IGP协议或采用浮动静态路由方式规避该问题。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作