设为首页收藏本站language→→ 语言切换

鸿鹄论坛

 找回密码
 论坛注册

QQ登录

先注册再绑定QQ

查看: 1981|回复: 0
收起左侧

清默网络——CCNA实验-RIP路由更新源

[复制链接]
发表于 2016-5-17 11:17:58 | 显示全部楼层 |阅读模式
本帖最后由 霸王龙小分队 于 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均适用。

说明:以上图为例,测试RIP 路由更新源

1.配置基础网络环境

(1)配置R1:

r1(config)#int loopback 11

r1(config-if)#ip add 11.1.1.1 255.255.255.0

r1(config)#int f0/0

r1(config-if)#ip add 10.1.1.1 255.255.255.0

r1(config-if)#no sh

r1(config)#router rip

r1(config-router)#network 11.0.0.0

r1(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/0

r2(config-if)#ip add 10.1.1.2 255.255.255.0

r2(config-if)#no sh

r2(config)#router rip

r2(config-router)#network 10.0.0.0

说明:在R2上配置10.1.1.0/24,并发布到RIP中。

(3)配置R3:

r3(config)#int f0/0

r3(config-if)#ip add 30.1.1.3 255.255.255.0

r3(config-if)#no sh

r3(config)#router rip

r3(config-router)#network 30.0.0.0

说明:在R3上配置10.1.1.0/24,并发布到RIP中。

2.测试路由

(1)查看R2的路由情况:

r2#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

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, FastEthernet0/0

R 11.0.0.0/8 [120/1] via 10.1.1.1, 00:00:29, FastEthernet0/0

r2#

说明:因为R1与R2接口地址都在10.1.1.0/24网段,所以满足条件,R2正常收到路由。

(2)查看R3的路由情况:

r3#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

30.0.0.0/24 is subnetted, 1 subnets

C 30.1.1.0 is directly connected, FastEthernet0/0

r3#

说明:因为R1发出的路由更新的源地址在10.1.1.0,而R3的接收接口地址在30.1.1.0,双方处于不同子网,所以R3并没有认可R1发来的路由。

以下是R3上的debug 信息:

r3#debug ip rip

RIP protocol debugging is on

r3#

*Mar 1 00:08:32.219: RIP: sending v1 update to 255.255.255.255 via

FastEthernet0/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 on

FastEthernet0/0

r3#

说明:R3因为R1不合法的源地址,所以忽略了从10.1.1.0发来的路由更新。

3.解决路由接收

(1)在R3上使用Secondary地址解决:

r3(config)#int f0/0

r3(config-if)#ip address 10.1.1.3 255.255.255.0 secondary

r3#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

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, FastEthernet0/0

R 11.0.0.0/8 [120/1] via 10.1.1.1, 00:00:10, FastEthernet0/0

30.0.0.0/24 is subnetted, 1 subnets

C 30.1.1.0 is directly connected, FastEthernet0/0

r3#

说明:因为R3在接收接口上配置与R1更新源地址同子网的10.1.1.0的地址,所以源地址和接收接口的Secondary地址处于相同子网,最后将接收到的路由更新放入路由表中。

(2)关闭更新源有效性检测:

r3(config)#int f0/0

r3(config-if)#no ip address 10.1.1.3 255.255.255.0 secondary

r3(config)#router rip

r3(config-router)#no va

r3(config-router)#no validate-update-source

说明:R3关闭了更新源有效性检测,并去除了Secondary地址,再次查看路由表:

r3#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

R 11.0.0.0/8 [120/1] via 10.1.1.1, 00:00:02

30.0.0.0/24 is subnetted, 1 subnets

C 30.1.1.0 is directly connected, FastEthernet0/0

r3#

说明:当关闭了更新源有效性检测后,所有接收到的路由更新即使地址不合法,也都被放入路由表

(3)在R3上配置Secondary地址解决:

r3(config)#router rip

r3(config-router)#validate-update-source

r1(config)#int f0/0

r1(config-if)#ip address 30.1.1.1 255.255.255.0 secondary

1(config)#router rip

r1(config-router)#network 30.0.0.0

说明:在R1上配置Secondary地址,并放入RIP进程,同时在R3上恢复更新源有效性检测。

(4)再次查看R3的路由接收情况:

r3#debug ip rip

RIP protocol debugging is on

*Mar 1 00:17:20.971: RIP: ignored v1 update from bad source 10.1.1.1 on

FastEthernet0/0

*Mar 1 00:17:20.971: RIP: received v1 update from 30.1.1.1 on

FastEthernet0/0

*Mar 1 00:17:20.971: 11.0.0.0 in 1 hops

r3#

r3#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

R 11.0.0.0/8 [120/1] via 30.1.1.1, 00:00:27, FastEthernet0/0

30.0.0.0/24 is subnetted, 1 subnets

C 30.1.1.0 is directly connected, FastEthernet0/0

r3#

说明:因为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 rip

r2(config-router)#no validate-update-source

r2#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

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, FastEthernet0/0

R 11.0.0.0/8 [120/1] via 30.1.1.1, 00:00:06

[120/1] via 10.1.1.1, 00:00:06, FastEthernet0/0

r2#

说明: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/0

r1(config-if)#encapsulation frame-relay

r1(config-if)#no frame-relay inverse-arp

r1(config-if)#no arp frame-relay

r1(config-if)#no ip address

r1(config-if)#no shutdown

r1(config)#int serial 1/0.12 point-to-point

r1(config-subif)#ip address 12.1.1.1 255.255.255.0

r1(config-subif)#frame-relay interface-dlci 102

r1(config)#int loopback 10

r1(config-if)#ip add 10.1.1.1 255.255.255.0

r1(config)#router rip

r1(config-router)#network 12.0.0.0

r1(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/0

r2(config-if)#en frame-relay

r2(config-if)#no frame-relay inverse-arp

r2(config-if)#no arp frame-relay

r2(config-if)#no ip address

r2(config-if)#no shutdown

r2(config)#int serial 1/0.12 point-to-point

r2(config-subif)#ip address 12.1.1.2 255.255.255.0

r2(config-subif)#frame-relay interface-dlci 201

r2(config)#int loopback 20

r2(config-if)#ip address 20.1.1.1 255.255.255.0

r2(config)#router rip

r2(config-router)#network 12.0.0.0

r2(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 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

R 20.0.0.0/8 [120/1] via 12.1.1.2, 00:00:15, Serial1/0.12

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, Loopback10

12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, Serial1/0.12

r1#

r2#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

20.0.0.0/24 is subnetted, 1 subnets

C 20.1.1.0 is directly connected, Loopback20

R 10.0.0.0/8 [120/1] via 12.1.1.1, 00:00:11, Serial1/0.12

12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, Serial1/0.12

r2#

说明:R1与R2当前路由表正常,都能成功收到对方发来的路由。

(2)在R1接口上开启RIP触发更新:

r1(config)#int serial 1/0.12

r1(config-subif)#ip rip triggered

说明:在接口上成功输入RIP触发更新的命令,并不代表RIP触发更新就已经生效。

(3)在R1上查看RIP触发更新是否生效:

r1#sh ip protocols

Routing Protocol is “rip”

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Sending updates every 30 seconds, next due in 12 seconds

Invalid after 180 seconds, hold down 0, flushed after 240

Redistributing: rip

Default version control: send version 1, receive any version

Interface Send Recv Triggered RIP Key-chain

Serial1/0.12 1 1 2

Loopback10 1 1 2

Automatic network summarization is in effect

Maximum path: 4

Routing for Networks:

10.0.0.0

12.0.0.0

Routing Information Sources:

Gateway Distance Last Update

12.1.1.2 120 00:00:14

Distance: (default is 120)

r1#

说明:并没有任何信息显示RIP触发更新已生效。

(4)在R2上也开启RIP触发更新:

r2(config)#int serial 1/0.12

r2(config-subif)#ip rip tri

r2(config-subif)#ip rip triggered

说明:在R2上也开启了RIP触发更新,保持双方一致。

(5)再次查看RIP触发更新是否生效:

r1#sh ip protocols

Routing Protocol is “rip”

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Sending updates every 30 seconds, next due in 3 seconds

Invalid after 180 seconds, hold down 0, flushed after 240

Redistributing: rip

Default version control: send version 1, receive any version

Interface Send Recv Triggered RIP Key-chain

Serial1/0.12 1 1 2 Yes

Loopback10 1 1 2

Automatic network summarization is in effect

Maximum path: 4

Routing for Networks:

10.0.0.0

12.0.0.0

Routing Information Sources:

Gateway Distance Last Update

12.1.1.2 120 00:00:26

Distance: (default is 120)

r1#

说明:在双方路由器都开启RIP触发更新后,输出结果显示RIP触发更新已生效。

(6)再次查看R1的路由表情况:

r1#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

R 20.0.0.0/8 [120/1] via 12.1.1.2, 00:05:18, Serial1/0.12

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, Loopback10

12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, Serial1/0.12

r1#

说明:从路由表中可以看出,RIP收到的路由20.0.0.0/8在5分18秒还没再次收到更新的情况下,也没有从路由表中删除,因为开了RIP触发更新,不会再收到路由更新。

(7)查看R1的RIP数据库状态:

r1#sh ip rip da

r1#sh ip rip database

10.0.0.0/8 auto-summary

10.1.1.0/24 directly connected, Loopback10

12.0.0.0/8 auto-summary

12.1.1.0/24 directly connected, Serial1/0.12

20.0.0.0/8 auto-summary

20.0.0.0/8

[1] via 12.1.1.2, 00:05:24 (permanent), Serial1/0.12

* Triggered Routes:

– [1] via 12.1.1.2, Serial1/0.12

r1#

说明:结果显示R1收到的路由20.0.0.0/8当前为触发更新状态,所以注明该路由不需要更新,而是永久有效(permanent)。

(8)查看R2的路由表与RIP数据库状态:

r2#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

20.0.0.0/24 is subnetted, 1 subnets

C 20.1.1.0 is directly connected, Loopback20

R 10.0.0.0/8 [120/1] via 12.1.1.1, 00:05:38, Serial1/0.12

12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, Serial1/0.12

r2#

r2#sh ip rip da

r2#sh ip rip database

10.0.0.0/8 auto-summary

10.0.0.0/8

[1] via 12.1.1.1, 00:05:42 (permanent), Serial1/0.12

* Triggered Routes:

– [1] via 12.1.1.1, Serial1/0.12

12.0.0.0/8 auto-summary

12.1.1.0/24 directly connected, Serial1/0.12

20.0.0.0/8 auto-summary

20.1.1.0/24 directly connected, Loopback20

r2#

说明:同样,R2从R1收到的路由10.0.0.0/8在5分38秒没有再次收到更新,也没有从路由表中删除,数据库中也显示该路由为触发更新路由,并且为永久有效。


您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2024-12-26 14:36 , Processed in 0.059081 second(s), 9 queries , Redis On.  

  Powered by Discuz!

  © 2001-2024 HH010.COM

快速回复 返回顶部 返回列表