RIP v2 不连续子网的基本配置

配置如下配置看看有什么结果
R1:
R1(config)#intf0/0
R1(config-if)#ip add 172.16.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#int s0/0
R1(config-if)#ip add 192.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.1.1.0
R1(config-router)#network 172.16.1.0
R2:
R2(config)#int s0/0
R2(config-if)#ip add 192.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#int s0/1
R2(config-if)#ip add 193.1.1.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#cl ra 64000
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.1.1.0
R2(config-router)#network 193.1.1.0
R3:
R3(config)#int s0/1
R3(config-if)#ip add 193.1.1.2 255.255.255.0
R3(config-if)#no shutdown
R3(config)#int f0/0
R3(config-if)#ip add 172.16.2.254 255.255.255.0
R3(config-if)#no shutdown
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#network 193.1.1.0
R3(config-router)#network 172.16.2.0
查看一下各个路由器的路由条目:
R1:

R1#sh ip route 
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.1.0 is directly connected, FastEthernet0/0
C    192.1.1.0/24 is directly connected, Serial0/0
R    193.1.1.0/24 [120/1] via 192.1.1.2, 00:00:11, Serial0/0
R2:
R2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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    172.16.0.0/16 [120/1] via 193.1.1.2, 00:00:18, Serial0/1
                   [120/1] via 192.1.1.1, 00:00:26, Serial0/0
C    192.1.1.0/24 is directly connected, Serial0/0
C    193.1.1.0/24 is directly connected, Serial0/1
R3:
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.2.0 is directly connected, FastEthernet0/0
R    192.1.1.0/24 [120/1] via 193.1.1.1, 00:00:06, Serial0/1
C    193.1.1.0/24 is directly connected, Serial0/1
如上路由表可以看出在R1和R2的路由表中没有R3路由器F0/0接口的直连网段信息,

*Rip v2路由协议默认是自动汇总的(主类边界路由默认是自动汇总的对于Rip v2)
R1和R3都处于主类边界路由器都会做路由汇总,R1路由器的路由条目都学到了
R    172.16.0.0/16 [120/1] via 192.1.1.1, 00:00:22, Serial0/0
                   [120/1] via 193.1.1.2, 00:00:24, Serial0/1
如此可以看出到达172.16.0.0/16这个主类网络的有两个下一条端口可以到达,如此就可以造成路由环路是网络不能连通,(R1和R3都没有学到各自网段的路由条目)。
*R1和R3主类边界路由器进行了边界汇总172.16.0.0/16各自路由无法正确匹配所以影响网络。
解决方法:
在rip宣告中使用no auto-summary 是取消主类边界路由器的主动汇总,是之能精确匹配。配置如下:
R1:
R1(config)#router r
R1(config)#router rip 
R1(config-router)#no a
R1(config-router)#no auto-summary 
R1(config-router)#net 192.1.1.0
R1(config-router)#net 172.16.1.0
R2:
R2(config)#router r
R2(config-router)#no 
R2(config-router)#no a
R2(config-router)#no auto-summary 
R2(config-router)#net 192.1.1.0
R2(config-router)#net 193.1.1.0
R3:
R3(config)#router rip 
R3(config-router)#no a
R3(config-router)#no auto-summary 
R3(config-router)#net 193.1.1.0
R3(config-router)#net 172.16.2.0
查看各自的路由条目
R1:
R1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     172.16.0.0/24 is subnetted, 2 subnets
C       172.16.1.0 is directly connected, FastEthernet0/0
R       172.16.2.0 [120/2] via 192.1.1.2, 00:00:02, Serial0/0
C    192.1.1.0/24 is directly connected, Serial0/0
R    193.1.1.0/24 [120/1] via 192.1.1.2, 00:00:02, Serial0/0
R2:
R2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
R       172.16.0.0/16 is possibly down, routing via 192.1.1.1, Serial0/0
                      [120/1] via 193.1.1.2, 00:02:30, Serial0/1
R       172.16.1.0/24 [120/1] via 192.1.1.1, 00:00:04, Serial0/0
R       172.16.2.0/24 [120/1] via 193.1.1.2, 00:00:14, Serial0/1
C    192.1.1.0/24 is directly connected, Serial0/0
C    193.1.1.0/24 is directly connected, Serial0/1
R3:
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
R       172.16.0.0/16 is possibly down, routing via 193.1.1.1, Serial0/1
R       172.16.1.0/24 [120/2] via 193.1.1.1, 00:00:24, Serial0/1
C       172.16.2.0/24 is directly connected, FastEthernet0/0
R    192.1.1.0/24 [120/1] via 193.1.1.1, 00:00:24, Serial0/1
C    193.1.1.0/24 is directly connected, Serial0/1


用两台PC测试一下PC>ping 172.16.2.1

Pinging 172.16.2.1 with 32 bytes of data:

Reply from 172.16.2.1: bytes=32 time=109ms TTL=125
Reply from 172.16.2.1: bytes=32 time=125ms TTL=125
Reply from 172.16.2.1: bytes=32 time=113ms TTL=125
Reply from 172.16.2.1: bytes=32 time=110ms TTL=125


你可能感兴趣的:(配置,职场,休闲,rip,子网)