打印

RIP-4:RIP中的主机路由问题!

RIP-4:RIP中的主机路由问题!

[实验目的]验证在RIP中的主机路由现象

[实验1]正常配置的RIP案例


配置内容:接口互通后,在各台路由协议中启用RIP查看路由表
实验结果:
R1上查看路由表
R1#sh ip rou
Gateway of last resort is not set

192.168.1.0/28 is subnetted, 2 subnets

C
192.168.1.32 is directly connected, Serial1/0

R
192.168.1.16 [120/1] via 192.168.1.34, 00:00:15, Serial1/0

此时正常显示192.168.1.16/28网段的路由信息,没有问题。

[实验2]出现主机路由的RIP案例


配置内容:同案例一,只是R1s1/0接口的地址改为/27的掩码
实验结果:
R1上查看路由表
Gateway of last resort is not set

192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks

C
192.168.1.32/27 is directly connected, Serial1/0

R
192.168.1.16/32 [120/1] via 192.168.1.34, 00:00:01, Serial1/0

可以发现正常的192.168.1.16/28网段的路由信息变为了一条主机路由,首先总结一下:
为什么R1会学到主机路由?
R1 收到R2发送过来的路由更新时,是192.168.1.16;由于RIP的更新报文中没有子网掩码,所以只能依靠自己接口的掩码和接受到的路由条目进行运算,由于这个地址由于不是/27位掩码的子网,所以会被认为是主机路由。


IGRP中依然可以看到这个现象不在骜述,以下现象无关紧要,仅供参考.
再来看一个案例:
[实验3]





配置内容:如图配置IP地址,注意各接口的IP地址,掩码不是相同的
实验结果:
路由器的路由表
R1#sh ip rou
Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C
10.0.0.0/9 is directly connected, Serial1/0

R
10.224.0.0/32 [120/2] via 10.0.0.2, 00:00:02, Serial1/0


R2#sh ip rou
Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks

C
10.0.0.0/9 is directly connected, Serial2/0

C
10.128.0.0/10 is directly connected, Serial1/0

R
10.224.0.0/32 [120/1] via 10.128.0.2, 00:00:16, Serial1/0


R3#sh ip rou
Gateway of last resort is not set

10.0.0.0/11 is subnetted, 2 subnets

C
10.128.0.0 is directly connected, Serial2/0

C
10.224.0.0 is directly connected, Loopback0

这个案例可以看到R2的路由表中依然有主机路由,但是可以发现一个新的现象:因为R2的掩码不一致,导致了R2不能正确的发布路由,R2debug命令的输出:
*Sep 17 16:20:39.719: RIP: sending v1 update to 255.255.255.255 via Serial2/0 (10.0.0.2)
*Sep 17 16:20:39.719: RIP: build update entries
*Sep 17 16:20:39.719:
subnet 10.224.0.0 metric 2

*Sep 17 16:20:43.519: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (10.128.0.1)
*Sep 17 16:20:43.519: RIP: build update entries - suppressing null update
*Sep 17 16:20:50.631: RIP: received v1 update from 10.128.0.2 on Serial1/0
*Sep 17 16:20:50.631:
10.224.0.0 in 1 hops

可以看到R2没有向R1通告10.128.0.0网段,也没有向R3通告10.0.0.0网段,因为R2接口都处于一个主类网络,就没有网络边界的概念,而且掩码不一致,如果将R2S1/0改为9.128.0.1/10,并且发布9.0.0.0网段,可以看到如下结果:
*Sep 17 17:13:46.759: RIP: sending v1 update to 255.255.255.255 via Serial2/0 (10.0.0.2)
*Sep 17 17:13:46.759: RIP: build update entries
*Sep 17 17:13:46.759:
network 9.0.0.0 metric 1

*Sep 17 17:13:49.951: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (9.128.0.1)
*Sep 17 17:13:49.951: RIP: build update entries
*Sep 17 17:13:49.951:
network 10.0.0.0 metric 1

可以看到R2正常发送了路由更新,所以总结以下:
RIP
(1)
如果接口的IP地址是在相同的主类网络子网中,子网掩码不一致,会导致路由信息发布失败。

(2)
如果接口的IP地址是在不同的主类网络子网中,子网掩码不一致,路由通告正常,且正常汇总




本帖转自汤姆一通,yangrubing-ITAA QQ:383506128

TOP

什么是主机路由
说了多少遍了,俺真滴不是马甲!

TOP

本功能由奇虎搜索实现

相关主题

标题 作者 最后发表
[站外] 关于路由的基础知识   [转帖] 馨香一瓣 2008-11-21
[站外] 双网卡双IP实现双线路共用的实际应用   [转帖] NoNe 2008-11-21
[站外] 双网卡双IP实现双线路共用的实际应用   [转帖] NoNe 2008-11-21
点击阅读更多关于的相关帖子  更多相关主题