TCP/IP 4.2.4控制RIP的度量

4.2.5 控制 RIP 的度量
通过命令 offest-list 改变路由的度量值,该命令指定一个数值来加大路由的度量值,并且用 access-list 决定哪些路由条目需要修改。
Offset-list   {access-list-number | name}   {in|out}  offset  {type number}
其实这样理解:知道要改的人,和要改的人的方向。
 
实验
注意: TOP net 文件都在附件里面
这个地方你可以联系上原来的
如果目的之是一个和路由器直接相连的主网络的成员,那么该网络的路由器接口上配置的子网掩码将被用来确定目的地址的子网。因此,在该主网络中必须自始至终地统一使用这个相同的子网掩码
有类别路由选择
你这边可以看到所有的掩码都是/20
原始配置查看的路由表
 
 
 
 
 
需求:
Barney Ernest-T 的数据只走以太网,而不是串行链路
于是要改变串行 metric
Ernest T
router rip
 offset-list 1 in 3 Serial1/1
 network 10.0.0.0
!
access-list 1 permit 10.33.0.0 0.0.0.0
 
Barney
router rip
 offset-list 1 in 3 Serial1/1
 network 10.0.0.0
!    
access-list 1 permit 10.33.32.0
 
语言是:先检查从 S1/1 进来的 RIP 信息(信息匹配 access-list 1 ), metric 3
 
在一开始配置的时候,查看 sh ip route 路由表,因为还没有刷新,所以还是原来的度量值
 
 
 
 
修改以后的路由表
 
这边还可以给大家看下路由表的刷新
2 、如果收到的条目不是新的,只有拥有更小的跳数才替换原来的路由条目。
响应消息是这个情况
Barney(config-router)#do 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/20 is subnetted, 5 subnets
R       10.33.32.0 [120/1] via 10.33.25.2, 00:00:28, Serial1/1
C       10.33.48.0 is directly connected, FastEthernet0/0
C       10.33.0.0 is directly connected, Loopback0
C       10.33.16.0 is directly connected, Serial1/1
R       10.33.64.0 [120/1] via 10.33.25.2, 00:00:28, Serial1/1
                   [120/1] via 10.33.55.2, 00:00:17, FastEthernet0/0
Barney(config-router)#do 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/20 is subnetted, 5 subnets
R       10.33.32.0 [120/4] via 10.33.25.2, 00:00:00, Serial1/1
C       10.33.48.0 is directly connected, FastEthernet0/0
C       10.33.0.0 is directly connected, Loopback0
C       10.33.16.0 is directly connected, Serial1/1
R       10.33.64.0 [120/1] via 10.33.25.2, 00:00:00, Serial1/1
                   [120/1] via 10.33.55.2, 00:00:18, FastEthernet0/0
Barney(config-router)#do 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/20 is subnetted, 5 subnets
R       10.33.32.0 [120/4] via 10.33.25.2, 00:00:00, Serial1/1
C       10.33.48.0 is directly connected, FastEthernet0/0
C       10.33.0.0 is directly connected, Loopback0
C       10.33.16.0 is directly connected, Serial1/1
R       10.33.64.0 [120/1] via 10.33.25.2, 00:00:00, Serial1/1
                   [120/1] via 10.33.55.2, 00:00:18, FastEthernet0/0
Barney(config-router)#do 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/20 is subnetted, 5 subnets
R       10.33.32.0 [120/2] via 10.33.55.2, 00:00:00, FastEthernet0/0
C       10.33.48.0 is directly connected, FastEthernet0/0
C       10.33.0.0 is directly connected, Loopback0
C       10.33.16.0 is directly connected, Serial1/1
R       10.33.64.0 [120/1] via 10.33.25.2, 00:00:11, Serial1/1
                  [120/1] via 10.33.55.2, 00:00:00, FastEthernet0/0
 
 
查看 debug 信息
Barney(config-router)#do debug ip rip
RIP protocol debugging is on
*Apr 16 11:04:46.699: RIP: sending v1 update to 255.255.255.255 via FastEthernet0/0 (10.33.55.1)
*Apr 16 11:04:46.699: RIP: build update entries
*Apr 16 11:04:46.703:   subnet 10.33.0.0 metric 1
*Apr 16 11:04:46.703:   subnet 10.33.16.0 metric 1
*Apr 16 11:04:46.703:   subnet 10.33.32.0 metric 5
*Apr 16 11:04:53.255: RIP: sending v1 update to 255.255.255.255 via Serial1/1 (10.33.25.1)
*Apr 16 11:04:53.255: RIP: build update entries
*Apr 16 11:04:53.259:   subnet 10.33.0.0 metric 1
*Apr 16 11:04:53.259:   subnet 10.33.48.0 metric 1
*Apr 16 11:04:53.463: RIP: sending v1 update to 255.255.255.255 via Loopback0 (10.33.5.1)
*Apr 16 11:04:53.463: RIP: build update entries
*Apr 16 11:04:53.467:   subnet 10.33.16.0 metric 1
*Apr 16 11:04:53.467:   subnet 10.33.32.0 metric 5
*Apr 16 11:04:53.467:   subnet 10.33.48.0 metric 1
*Apr 16 11:04:53.471:   subnet 10.33.64.0 metric 2
*Apr 16 11:05:02.147: RIP: received v1 update from 10.33.55.2 on FastEthernet0/0
*Apr 16 11:05:02.151:      10.33.32.0 in 2 hops
*Apr 16 11:05:02.151:      10.33.64.0 in 1 hops
*Apr 16 11:05:04.151: RIP: sending v1 flash update to 255.255.255.255 via FastEthernet0/0 (10.33.55.1)
*Apr 16 11:05:04.151: RIP: build flash update entries - suppressing null update
*Apr 16 11:05:04.155: RIP: sending v1 flash update to 255.255.255.255 via Serial1/1 (10.33.25.1)
*Apr 16 11:05:04.155: RIP: build flash update entries
*Apr 16 11:05:04.155:   subnet 10.33.32.0 metric 3
*Apr 16 11:05:04.155: RIP: sending v1 flash update to 255.255.255.255 via Loopback0 (10.33.5.1)
*Apr 16 11:05:04.155: RIP: build flash update entries
*Apr 16 11:05:04.155:   subnet 10.33.32.0 metric 3
*Apr 16 11:05:05.267: RIP: received v1 update from 10.33.25.2 on Serial1/1
*Apr 16 11:05:05.271:      10.33.0.0 in 3 hops
*Apr 16 11:05:05.271:      10.33.32.0 in 4 hops
*Apr 16 11:05:05.271:      10.33.64.0 in 1 hops
*Apr 16 11:05:12.715: RIP: sending v1 update to 255.255.255.255 via FastEthernet0/0 (10.33.55.1)
*Apr 16 11:05:12.715: RIP: build update entries
*Apr 16 11:05:12.719:   subnet 10.33.0.0 metric 1
*Apr 16 11:05:12.719:   subnet 10.33.16.0 metric 1
Barney(config-router)#do un all
All possible debugging has been turned off
 
如果不指定使用偏移列表的接口,那么偏移列表将在所有与访问列表匹配的接口上修改所有的入站更新或出站更新。(知道要改的人,不知道方向时,就 2 个方向都改掉)
如果不调用访问列表(使用 0 作为访问列表的序列号)来进行匹配,偏移列表将修改所有的入站更新或出站更新。(不知道人的时候,就所有人都改掉)
 
当一个偏移列表引起下一跳路由器通告的度量值比它正在通过的路由更新的度量值更高时,直到抑制计时器超时前,这条路由都会被标记为不可到达。 (依旧满足原来的抑制计时器的规则)
这边重温一下抑制计时器:如果一个网络的度量发生变化,他不会立即发送触发更新,而是会等抑制计时器超时。直到计时器超时,路由器才可以发送这个路由的更新。
收到响应消息时,路由器这样做
1 、路由更新中的路由条目是新的,路由器则将新的路由连同通告路由器的地址一起加入到自己的路由表中。(通告路由器的地址可以从更新数据包的源地址段读取)
2 、如果收到的条目不是新的,只有拥有更小的跳数才替换原来的路由条目。
3 、如果收到的条目不是新的,拥有比原有大的跳数(更新了下一跳路由器),在抑制时间之内是不可达,抑制时间超时之后,同一台邻居依然这样通告给这台路由器,路由器接受该路由新的度量值。

对号入座就可以咯
 
 
 

你可能感兴趣的:(度量,控制RIP)