清默网络——CCNA实验-RIP路由更新源
本帖最后由 霸王龙小分队 于 2017-7-3 17:56 编辑清默网络CCNA实验-RIP路由更新源RIP 路由更新源 RIP会每隔30秒定期使用广播或者组播向开启了RIP的接口上发出路由更新,RIP没有邻居的概念,所以自己并不知道发出去的路由更新被什么样的路由器收到,从之前的实验我们可以看出,当RIP路由器相互之间IP地址或子网掩码长度不匹配时,都会造成路由不精确或者路由表错误,因此,RIP收到的路由更新源地址必须和接收接口处于相同子网,即使是源地址和接收接口的Secondary地址处于相同子网也可以,否则忽略收到的路由更新,该功能称为RIP的更新源有效性,可以手动关闭或打开,默认为开启状态。 当接口上配置Secondary地址并发布到RIP进程后,所有路由信息从该接口发出去时,会同时使用主IP地址与Secondary地址分别发送一次。 注:接口上Secondary地址可以作为路由更新的源地址,但Secondary地址的网段不会被RIP更新出去。测试RIP 路由更新源 说明:该功能默认为开启状态,RIP ver 1与ver 2均适用。http://www.qingm.net/uploads/allimg/151009/15513R622-0.png说明:以上图为例,测试RIP 路由更新源1.配置基础网络环境(1)配置R1:r1(config)#int loopback 11r1(config-if)#ip add 11.1.1.1 255.255.255.0r1(config)#int f0/0r1(config-if)#ip add 10.1.1.1 255.255.255.0r1(config-if)#no shr1(config)#router ripr1(config-router)#network 11.0.0.0r1(config-router)#network 10.0.0.0说明:在R1上配置10.1.1.0/24和11.0.0.0/24,并发布到RIP中。(2)配置R2:r2(config)#int f0/0r2(config-if)#ip add 10.1.1.2 255.255.255.0r2(config-if)#no shr2(config)#router ripr2(config-router)#network 10.0.0.0说明:在R2上配置10.1.1.0/24,并发布到RIP中。(3)配置R3:r3(config)#int f0/0r3(config-if)#ip add 30.1.1.3 255.255.255.0r3(config-if)#no shr3(config)#router ripr3(config-router)#network 30.0.0.0说明:在R3上配置10.1.1.0/24,并发布到RIP中。2.测试路由(1)查看R2的路由情况:r2#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user staticrouteo – ODR, P – periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 1 subnetsC 10.1.1.0 is directly connected, FastEthernet0/0R 11.0.0.0/8 via 10.1.1.1, 00:00:29, FastEthernet0/0r2#说明:因为R1与R2接口地址都在10.1.1.0/24网段,所以满足条件,R2正常收到路由。(2)查看R3的路由情况:r3#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user staticrouteo – ODR, P – periodic downloaded static routeGateway of last resort is not set30.0.0.0/24 is subnetted, 1 subnetsC 30.1.1.0 is directly connected, FastEthernet0/0r3#说明:因为R1发出的路由更新的源地址在10.1.1.0,而R3的接收接口地址在30.1.1.0,双方处于不同子网,所以R3并没有认可R1发来的路由。以下是R3上的debug 信息:r3#debug ip ripRIP protocol debugging is onr3#*Mar 1 00:08:32.219: RIP: sending v1 update to 255.255.255.255 viaFastEthernet0/0 (30.1.1.3)*Mar 1 00:08:32.219: RIP: build update entries – suppressing null update*Mar 1 00:08:35.003: RIP: ignored v1 update from bad source 10.1.1.1 onFastEthernet0/0r3#说明:R3因为R1不合法的源地址,所以忽略了从10.1.1.0发来的路由更新。3.解决路由接收(1)在R3上使用Secondary地址解决:r3(config)#int f0/0r3(config-if)#ip address 10.1.1.3 255.255.255.0 secondaryr3#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user staticrouteo – ODR, P – periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 1 subnetsC 10.1.1.0 is directly connected, FastEthernet0/0R 11.0.0.0/8 via 10.1.1.1, 00:00:10, FastEthernet0/030.0.0.0/24 is subnetted, 1 subnetsC 30.1.1.0 is directly connected, FastEthernet0/0r3#说明:因为R3在接收接口上配置与R1更新源地址同子网的10.1.1.0的地址,所以源地址和接收接口的Secondary地址处于相同子网,最后将接收到的路由更新放入路由表中。(2)关闭更新源有效性检测:r3(config)#int f0/0r3(config-if)#no ip address 10.1.1.3 255.255.255.0 secondaryr3(config)#router ripr3(config-router)#no var3(config-router)#no validate-update-source说明:R3关闭了更新源有效性检测,并去除了Secondary地址,再次查看路由表:r3#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user staticrouteo – ODR, P – periodic downloaded static routeGateway of last resort is not setR 11.0.0.0/8 via 10.1.1.1, 00:00:0230.0.0.0/24 is subnetted, 1 subnetsC 30.1.1.0 is directly connected, FastEthernet0/0r3#说明:当关闭了更新源有效性检测后,所有接收到的路由更新即使地址不合法,也都被放入路由表(3)在R3上配置Secondary地址解决:r3(config)#router ripr3(config-router)#validate-update-sourcer1(config)#int f0/0r1(config-if)#ip address 30.1.1.1 255.255.255.0 secondary1(config)#router ripr1(config-router)#network 30.0.0.0说明:在R1上配置Secondary地址,并放入RIP进程,同时在R3上恢复更新源有效性检测。(4)再次查看R3的路由接收情况:r3#debug ip ripRIP protocol debugging is on*Mar 1 00:17:20.971: RIP: ignored v1 update from bad source 10.1.1.1 onFastEthernet0/0*Mar 1 00:17:20.971: RIP: received v1 update from 30.1.1.1 onFastEthernet0/0*Mar 1 00:17:20.971: 11.0.0.0 in 1 hopsr3#r3#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user staticrouteo – ODR, P – periodic downloaded static routeGateway of last resort is not setR 11.0.0.0/8 via 30.1.1.1, 00:00:27, FastEthernet0/030.0.0.0/24 is subnetted, 1 subnetsC 30.1.1.0 is directly connected, FastEthernet0/0r3#说明:因为R1同时使用了接口主地址10.1.1.1与Secondary地址30.1.1.1各发了一份路由更新,R3虽然忽略了10.1.1.1发来的更新,但接收了30.1.1.1的更新,所以从30.1.1.1收到的路由被放入了路由表中。(5)使R2接收所有路由:r2(config)#router ripr2(config-router)#no validate-update-sourcer2#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user staticrouteo – ODR, P – periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 1 subnetsC 10.1.1.0 is directly connected, FastEthernet0/0R 11.0.0.0/8 via 30.1.1.1, 00:00:06 via 10.1.1.1, 00:00:06, FastEthernet0/0r2#说明:R2关闭了更新源有效性检测后,同时接收了10.1.1.1和30.1.1.1发来的路由更新, 并且可以得知,R1接口上Secondary地址作为了路由更新的源地址,但Secondary地址的网段并没有被RIP更新出去。返回目录RIP 触发更新 由于无论是RIP ver 1还是ver 2,都会将路由表每隔30秒定期向网络中发送,但通常情况下,广域网链路带宽相对比较低速,而且带宽宝贵,为了能够更好的利用和节省广域网上的带宽,RIP可以调整为在广域网链路上抑制路由更新的发送,而只仅仅在路由有变化时,将有变化的路由发出去,这就是RIP的触发更新机制,并且是基于接口开启或关闭的。 因为RIP是网络早期开发的,在早期时候,广域网都是串行链路,或者说是点到点链路,所以RIP 触发更新只支持在点到点链路上开启或关闭,对于Frame-Relay和以太网这样的多路访问接口中,不支持RIP 触发更新,但是Frame-Relay点到点子接口被RIP认为是点到点链路,可以开启触发更新。 因为RIP的路由会每隔30秒更新一次,如果路由表中的路由超过180秒都没有再次收到更新,则被标记为不可用,如果连续240秒没收到更新,将会从路由表中删除,所以当某台RIP路由器开启触发更新后,在路由没有变动的情况下,便不再向对端发送路由更新,这样势必会造成对端路由器在240秒之后将收到的路由从路由表中删除,为了杜绝此类问题, RIP 触发的更新机制需要在两端路由器都开启,否则不生效。在双方都开启后,相互收到的路由都会被注明永久有效(permanent)而不需要再次收到更新。注:RIP 触发更新支持ver 1和ver 2。测试RIP 触发更新说明:以上图为例,测试测试RIP 触发更新1.配置基础网络环境(1)配置R1:r1(config)#int serial 1/0r1(config-if)#encapsulation frame-relayr1(config-if)#no frame-relay inverse-arpr1(config-if)#no arp frame-relayr1(config-if)#no ip addressr1(config-if)#no shutdownr1(config)#int serial 1/0.12 point-to-pointr1(config-subif)#ip address 12.1.1.1 255.255.255.0r1(config-subif)#frame-relay interface-dlci 102r1(config)#int loopback 10r1(config-if)#ip add 10.1.1.1 255.255.255.0r1(config)#router ripr1(config-router)#network 12.0.0.0r1(config-router)#network 10.0.0.0说明:在R1上配置网段12.1.1.0和10.1.1.0,因为R1和R2通过Frame-Felay连接,而Frame-Felay只有点到点子接口才被认为是点到点链路。(2)配置R2:r2(config)#int serial 1/0r2(config-if)#en frame-relayr2(config-if)#no frame-relay inverse-arpr2(config-if)#no arp frame-relayr2(config-if)#no ip addressr2(config-if)#no shutdownr2(config)#int serial 1/0.12 point-to-pointr2(config-subif)#ip address 12.1.1.2 255.255.255.0r2(config-subif)#frame-relay interface-dlci 201r2(config)#int loopback 20r2(config-if)#ip address 20.1.1.1 255.255.255.0r2(config)#router ripr2(config-router)#network 12.0.0.0r2(config-router)#network 20.0.0.0说明:在R2上配置网段12.1.1.0和20.1.1.0,并放入RIP进程。2 .测试RIP触发更新(1)查看R1与R2当前的路由表情况:r1#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user static routeo – ODR, P – periodic downloaded static routeGateway of last resort is not setR 20.0.0.0/8 via 12.1.1.2, 00:00:15, Serial1/0.1210.0.0.0/24 is subnetted, 1 subnetsC 10.1.1.0 is directly connected, Loopback1012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0.12r1#r2#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user static routeo – ODR, P – periodic downloaded static routeGateway of last resort is not set20.0.0.0/24 is subnetted, 1 subnetsC 20.1.1.0 is directly connected, Loopback20R 10.0.0.0/8 via 12.1.1.1, 00:00:11, Serial1/0.1212.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0.12r2#说明:R1与R2当前路由表正常,都能成功收到对方发来的路由。(2)在R1接口上开启RIP触发更新:r1(config)#int serial 1/0.12r1(config-subif)#ip rip triggered说明:在接口上成功输入RIP触发更新的命令,并不代表RIP触发更新就已经生效。(3)在R1上查看RIP触发更新是否生效:r1#sh ip protocolsRouting Protocol is “rip”Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setSending updates every 30 seconds, next due in 12 secondsInvalid after 180 seconds, hold down 0, flushed after 240Redistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainSerial1/0.12 1 1 2Loopback10 1 1 2Automatic network summarization is in effectMaximum path: 4Routing for Networks:10.0.0.012.0.0.0Routing Information Sources:Gateway Distance Last Update12.1.1.2 120 00:00:14Distance: (default is 120)r1#说明:并没有任何信息显示RIP触发更新已生效。(4)在R2上也开启RIP触发更新:r2(config)#int serial 1/0.12r2(config-subif)#ip rip trir2(config-subif)#ip rip triggered说明:在R2上也开启了RIP触发更新,保持双方一致。(5)再次查看RIP触发更新是否生效:r1#sh ip protocolsRouting Protocol is “rip”Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setSending updates every 30 seconds, next due in 3 secondsInvalid after 180 seconds, hold down 0, flushed after 240Redistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chainSerial1/0.12 1 1 2 YesLoopback10 1 1 2Automatic network summarization is in effectMaximum path: 4Routing for Networks:10.0.0.012.0.0.0Routing Information Sources:Gateway Distance Last Update12.1.1.2 120 00:00:26Distance: (default is 120)r1#说明:在双方路由器都开启RIP触发更新后,输出结果显示RIP触发更新已生效。(6)再次查看R1的路由表情况:r1#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user static routeo – ODR, P – periodic downloaded static routeGateway of last resort is not setR 20.0.0.0/8 via 12.1.1.2, 00:05:18, Serial1/0.1210.0.0.0/24 is subnetted, 1 subnetsC 10.1.1.0 is directly connected, Loopback1012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0.12r1#说明:从路由表中可以看出,RIP收到的路由20.0.0.0/8在5分18秒还没再次收到更新的情况下,也没有从路由表中删除,因为开了RIP触发更新,不会再收到路由更新。(7)查看R1的RIP数据库状态:r1#sh ip rip dar1#sh ip rip database10.0.0.0/8 auto-summary10.1.1.0/24 directly connected, Loopback1012.0.0.0/8 auto-summary12.1.1.0/24 directly connected, Serial1/0.1220.0.0.0/8 auto-summary20.0.0.0/8 via 12.1.1.2, 00:05:24 (permanent), Serial1/0.12* Triggered Routes:– via 12.1.1.2, Serial1/0.12r1#说明:结果显示R1收到的路由20.0.0.0/8当前为触发更新状态,所以注明该路由不需要更新,而是永久有效(permanent)。(8)查看R2的路由表与RIP数据库状态:r2#sh ip routeCodes: C – connected, S – static, R – RIP, M – mobile, B – BGPD – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter areaN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2E1 – OSPF external type 1, E2 – OSPF external type 2i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2ia – IS-IS inter area, * – candidate default, U – per-user static routeo – ODR, P – periodic downloaded static routeGateway of last resort is not set20.0.0.0/24 is subnetted, 1 subnetsC 20.1.1.0 is directly connected, Loopback20R 10.0.0.0/8 via 12.1.1.1, 00:05:38, Serial1/0.1212.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0.12r2#r2#sh ip rip dar2#sh ip rip database10.0.0.0/8 auto-summary10.0.0.0/8 via 12.1.1.1, 00:05:42 (permanent), Serial1/0.12* Triggered Routes:– via 12.1.1.1, Serial1/0.1212.0.0.0/8 auto-summary12.1.1.0/24 directly connected, Serial1/0.1220.0.0.0/8 auto-summary20.1.1.0/24 directly connected, Loopback20r2#说明:同样,R2从R1收到的路由10.0.0.0/8在5分38秒没有再次收到更新,也没有从路由表中删除,数据库中也显示该路由为触发更新路由,并且为永久有效。
页:
[1]