案例:
说明:192.168.3.0/24,
192.168.5.0/24,
192.168.6.0/24
都使用loopback 口模拟。
通过使用偏移列表限制RT1学习到 192.168.6.0/24 这条路由信息。
使用列表前的路由信息:
- RT1#sh 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.4.0/24 is directly connected, Serial1/0
- R 192.168.5.0/24 [120/1] via 192.168.4.2, 00:00:16, Serial1/0
- R 192.168.6.0/24 [120/1] via 192.168.4.2, 00:00:13, Serial1/0
- C 192.168.3.0/24 is directly connected, Loopback0
- RT1#sh ip route rip
- R 192.168.5.0/24 [120/1] via 192.168.4.2, 00:00:20, Serial1/0
- R 192.168.6.0/24 [120/1] via 192.168.4.2, 00:00:18, Serial1/0
可以看到RT1学习到192.168.6.0的路由。
解决方案:
- RT1(config)#access-list 1 permit 192.168.6.0
- RT1(config)#router rip
- RT1(config-router)#offset-list 1 in 16 serial 1/0
配置完成后的路由信息
- RT1#sh 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.4.0/24 is directly connected, Serial1/0
- R 192.168.5.0/24 [120/1] via 192.168.4.2, 00:00:10, Serial1/0
- C 192.168.3.0/24 is directly connected, Loopback0
- RT1#sh ip route ri
- RT1#sh ip route rip
- R 192.168.5.0/24 [120/1] via 192.168.4.2, 00:00:12, Serial1/0
可以看到RT1的路由表中,已经没有192.168.6.0/24这条路由了。
扩展:
这是Debug的信息 debug ip rip
- RT1#
- *Mar 1 00:14:09.119: RIP: received v1 update from 192.168.4.2 on Serial1/0
- *Mar 1 00:14:09.123: 192.168.5.0 in 1 hops
- *Mar 1 00:14:09.127: 192.168.6.0 in 17 hops (inaccessible)
- *Mar 1 00:14:15.199: RIP: sending v1 update to 255.255.255.255 via Loopback0 (192.168.3.1)
- *Mar 1 00:14:15.203: RIP: build update entries
- *Mar 1 00:14:15.203: network 192.168.4.0 metric 1
- *Mar 1 00:14:15.203: network 192.168.5.0 metric 2
- *Mar 1 00:14:20.835: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (192.168.4.1)
- *Mar 1 00:14:20.839: RIP: build update entries
- *Mar 1 00:14:20.839: network 192.168.3.0 metric 1
- *Mar 1 00:14:38.703: RIP: received v1 update from 192.168.4.2 on Serial1/0
- *Mar 1 00:14:38.707: 192.168.5.0 in 1 hops
- *Mar 1 00:14:38.711: 192.168.6.0 in 17 hops (inaccessible)
上面序号2 ,3, 4 可以看出 从邻居RT2收到 192.168.5.0 1跳 , 192.168.6.0 17跳(因为偏移列表指定了跳数进来为16.所以加上原来的1跳是17跳)
序号2 ,12 看出 此时我们使用的还是默认的30s 更新。
本文原创,如需转载请注明出处。
联系方式:[email protected]
本文出自 “[email protected]” 博客,转载请与作者联系!