RIPv2手工汇总
1.实验目的
通过本实验可以掌握:
1)RIPv2路由的手工汇总
2)RIPv2不支持CIDR汇总
3)RIPv2可以传递CIDR汇总
2.拓扑结构
 

IGP-LAB-RIP-4_第1张图片

 
 
 
 
 
R0:
 
R0(config)#int lo0
R0(config-if)#ip add 1.1.1.1 255.255.255.0
R0(config-if)#no sh
R0(config-if)#int s0/0
R0(config-if)#ip add 12.1.1.1 255.255.255.0
R0(config-if)#clo r 64000
R0(config-if)#no sh
R0(config-if)#exit
R0(config)#router rip
R0(config-router)#v 2
R0(config-router)#network 1.0.0.0
R0(config-router)#network 12.0.0.0
R0(config-router)#no auto-summary
 
R1:
 
R1(config)#int lo0
R1(config-if)#ip add 2.2.2.2 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int s0/1
R1(config-if)#ip add 12.1.1.2 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int s0/0
R1(config-if)#ip add 13.1.1.1 255.255.255.0
R1(config-if)#clo r 64000
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#v 2
R1(config-router)#no auto-summary
R1(config-router)#network 12.0.0.0
R1(config-router)#network 13.0.0.0
R1(config-router)#network 2.0.0.0
 
R2:
 
R2(config)#int lo0
R2(config-if)#ip add 3.3.0.3 255.255.255.0
R2(config-if)#no sh
R2(config)#int lo1
R2(config-if)#ip add 3.3.1.3 255.255.255.0
R2(config-if)#no sh
R2(config)#int lo2
R2(config-if)#ip add 3.3.2.3 255.255.255.0
R2(config-if)#no sh
R2(config)#int lo3
R2(config-if)#ip add 3.3.3.3 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int s0/1
R2(config-if)#ip add 13.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#v 2
R2(config-router)#no auto-summary
R2(config-router)#network 13.0.0.0
R2(config-router)#network 3.0.0.0
R2(config)#int s0/1
R2(config-if)#ip summary-address rip 3.3.0.0 255.255.252.0
 
4.实验调试
(1) show ip route
R0#sh ip ro
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
 
     1.0.0.0/24 is subnetted, 1 subnets
C        1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
R        2.2.2.0 [120/1] via 12.1.1.2, 00:00:12, Serial0/0
     3.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
R        3.3.0.0/24 [120/2] via 12.1.1.2, 00:00:12, Serial0/0
R        3.3.0.0/22 [120/2] via 12.1.1.2, 00:00:12, Serial0/0
R        3.3.1.0/24 [120/2] via 12.1.1.2, 00:00:12, Serial0/0
R        3.3.2.0/24 [120/2] via 12.1.1.2, 00:00:12, Serial0/0
R        3.3.3.0/24 [120/2] via 12.1.1.2, 00:00:12, Serial0/0
     12.0.0.0/24 is subnetted, 1 subnets
C        12.1.1.0 is directly connected, Serial0/0
     13.0.0.0/24 is subnetted, 1 subnets
R        13.1.1.0 [120/1] via 12.1.1.2, 00:00:14, Serial0/0
上面的输出看到路由器R0的路由表中有R2的4条环回接口的明细路由。
 
 
2)在执行汇总以后路由器R1的路由表如下:
R0#sh ip ro
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
 
     1.0.0.0/24 is subnetted, 1 subnets
C        1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
R        2.2.2.0 [120/1] via 12.1.1.2, 00:00:16, Serial0/0
     3.0.0.0/22 is subnetted, 1 subnets
R        3.3.0.0 [120/2] via 12.1.1.2, 00:00:16, Serial0/0
     12.0.0.0/24 is subnetted, 1 subnets
C        12.1.1.0 is directly connected, Serial0/0
     13.0.0.0/24 is subnetted, 1 subnets
R        13.1.1.0 [120/1] via 12.1.1.2, 00:00:16, Serial0/0
上面的输出表明在路由器R0的路由表中接收到汇总路由,当然R1也能收到汇总路由。
 
 
注意:如果把路由器 R2上四个环回接口lo0-lo4的地址分别修改为
192.168.96.4/24,
192.168.97.4/24,
192.168.98.4/24,
192.168.99.4/24,
s0/1接口下还能够实现路由 汇总吗?
 
R2(config)#router rip
R2(config-router)#v 2
R2(config-router)#no network 3.0.0.0
R2(config-router)#network 192.168.96.0
R2(config-router)#network 192.168.97.0
R2(config-router)#network 192.168.98.0
R2(config-router)#network 192.168.99.0
R2(config-if)#ip summary-address rip 192.168.96.0 255.255.252.0
 Summary mask must be greater or equal to major net
R2(config-if)#
 
路由器会提示如下信息:
“Summary mask must be greater or equal to major net”
显示的提示信息表明汇总后的掩码长度必须要大于或等于主类网络的掩码程度,因为 “22<24”,所以不能汇总。
所以RIPv2不支持CIDR汇总,但是可以传递CIDR汇总。
怎么解决呢?
   针对本实验,可以引出一个重分布概念:
1.    先写出个汇总的静态路由,指向空接口 Null 0
R2(config)#ip route 192.168.96.0 255.255.252.0 null 0
 
 
2.    把汇总的静态路由重分布RIP 进程中。
 
R2(config)#router rip
R2(config-router)#redistribute static
 
 
如下配置:
R2(config)#ip route 192.168.96.0 255.255.252.0 null 0
R2(config)#router rip
R2(config-router)#redistribute static
R2(config-router)#v 2
R2(config-router)#no network 192.168.96.0
R2(config-router)#no network 192.168.97.0
R2(config-router)#no network 192.168.98.0
R2(config-router)#no network 192.168.99.0
 
R0#sh ip ro
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
 
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
R       2.2.2.0 [120/1] via 12.1.1.2, 00:00:10, Serial0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial0/0
     13.0.0.0/24 is subnetted, 1 subnets
R       13.1.1.0 [120/1] via 12.1.1.2, 00:00:10, Serial0/0
R    192.168.96.0/22 [120/2] via 12.1.1.2, 00:00:10, Serial0/0
通过输出不难看出RIPv2是可以传递CIDR汇总信息的。