RIPv1有类路由的问题

简介:
  RIP实验,验证RIPv1有类别更新是否是采用接口的子网掩码为更新的子网掩码,验证方法:用3台路由器,起RIPv1,然后使用
接口IP:
r2:f0/0192.168.1.1/29

r1:s1/0192.168.1.9/29
r2:s1/0192.168.1.10/29

r1:s1/1192.168.1.17/29
r3:s1/0192.168.1.18/29

r4:f0/0192.168.1.24/29

按照上面的连接和IP地址配置每台路由器,然后启用RIPv1协议。然后在每台路由器上show ip route查看路由表。
R2#show 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

      192.168.1.0/29 is subnetted, 4 subnets
C       192.168.1.8 is directly connected, Serial1/0
C       192.168.1.0 is directly connected, Ethernet0/0
R       192.168.1.24 [120/2] via 192.168.1.9, 00:00:02, Serial1/0
R       192.168.1.16 [120/1] via 192.168.1.9, 00:00:02, Serial1/0

R1#show 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

     192.168.1.0/29 is subnetted, 4 subnets
C       192.168.1.8 is directly connected, Serial1/0
R       192.168.1.0 [120/1] via 192.168.1.10, 00:00:22, Serial1/0
R       192.168.1.24 [120/1] via 192.168.1.18, 00:00:21, Serial1/1
C       192.168.1.16 is directly connected, Serial1/1

R3#show 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

     192.168.1.0/29 is subnetted, 4 subnets
R       192.168.1.8 [120/1] via 192.168.1.17, 00:00:12, Serial1/0
R       192.168.1.0 [120/2] via 192.168.1.17, 00:00:12, Serial1/0
C       192.168.1.24 is directly connected, Ethernet0/0
C       192.168.1.16 is directly connected, Serial1/0

可以看到,每台路由器从rip学到的路由的掩码都是29位,再看一下r2的debug信息。
R2#debug ip rip
RIP protocol debugging is on
R2#
*Mar  1 00:02:32.655: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (192.168.1.10)
*Mar  1 00:02:32.655: RIP: build update entries
*Mar  1 00:02:32.655:   subnet 192.168.1.0 metric 1
*Mar  1 00:02:35.003: RIP: received v1 update from 192.168.1.9 on Serial1/0
*Mar  1 00:02:35.003:      192.168.1.16 in 1 hops
*Mar  1 00:02:35.007:      192.168.1.24 in 2 hops
*Mar  1 00:02:36.499: RIP: sending v1 update to 255.255.255.255 via Ethernet0/0 (192.168.1.1)
*Mar  1 00:02:36.499: RIP: build update entries
*Mar  1 00:02:36.499:   subnet 192.168.1.8 metric 1
*Mar  1 00:02:36.499:   subnet 192.168.1.16 metric 2
*Mar  1 00:02:36.503:   subnet 192.168.1.24 metric 3
同样也是以/29位掩码的路由信息学习和向外更新。。。。

还有R1的show ip rip database信息:
R1#show ip rip database 
192.168.1.0/24    auto-summary
192.168.1.0/29
    [1] via 192.168.1.10, 00:00:04, Serial1/0
192.168.1.8/29    directly connected, Serial1/0
192.168.1.16/29    directly connected, Serial1/1
192.168.1.24/29
    [1] via 192.168.1.18, 00:00:02, Serial1/1

通过这个实验,可以让我们从原来RIPv1更新的路由只会采用默认的掩码的误区中走出来,有类路由是先根据默认掩码生成rip database,然后向外更新的时候会与接口的掩码进行最长匹配原则,然后用计算出来的那个掩码为更新时候所用的掩码。。。。

















本文转自loveme2351CTO博客,原文链接:http://blog.51cto.com/loveme23/42961 ,如需转载请自行联系原作者


相关文章
|
7月前
|
网络虚拟化 网络架构
单臂路由和三层交换
单臂路由和三层交换
52 0
|
网络协议 网络虚拟化 网络架构
单臂路由
臂路由技术实现了不同vlan之间进行通信用户与服务器处于不同vlan,如何才能让用户能够访问服务器呢?方案一:使用一根网线,两端分别插在两个vlan下的接口方案二:借助路由器的路由功能实现vlan通信单臂路由:单臂路由技术能让路由器的一根物理接口对应不同vlan数据的实质是把物理接口分成若干个子接口,这些子接口通过封装802.1q标识,以识别不同vlan的TAG标识配置:1) 对交换机运行vlan和trunk配置2) 创建路由子接口: int g0/0/0.103) 给子接口配置IP地址4) 把子接口封装对应vlan的dot 1q标记:dot 1q termination 为了方便管理网络,根
|
网络协议 网络架构
H3C_RIP_路由器_动态路由
H3C_RIP_路由器_动态路由
H3C_RIP_路由器_动态路由
|
网络协议 网络虚拟化 网络架构
单臂路由与VLAN
单臂路由与VLAN
4715 0
|
网络协议 网络虚拟化 网络架构
|
网络协议 网络架构
|
网络虚拟化 网络架构