rip第2版较第一版的配置大都相同,注意几个不同的地方
一、ripV2路由发布:
1.实验目的
通过本实验可以掌握:
(1)在路由器上启动 RIPv2 路由进程
(2)启用参与路由协议的接口,并且通告网络
(3)auto-summary 的开启和关闭
(4)查看和调试 RIPv2路由协议相关信息
2.拓扑结构
Highslide
3.实验步骤
(1)步骤 1:配置路由器 R1
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary  
R1(config-router)#network 1.0.0.0
R1(config-router)#network 192.168.12.0
(2)步骤 2:配置路由器 R2
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary  
R2(config-router)#network 192.168.12.0
R2(config-router)#network 192.168.23.0
(3)步骤 3:配置路由器 R3
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.23.0
R3(config-router)#network 192.168.34.0
(4)步骤 4:配置路由器 R4
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#no auto-summary
R4(config-router)#network 192.168.34.0  
R4(config-router)#network 4.0.0.0
4.实验调试
R1#sh ip rou
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

C    192.168.12.0/24 is directly connected, Serial1/1
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback1
     4.0.0.0/24 is subnetted, 1 subnets
R       4.4.0.0 [120/3] via 192.168.12.2, 00:00:04, Serial1/1
R    192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:04, Serial1/1
R    192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:04, Serial1/1
这里4.4.0.0应该是子网的,因为我们选择的是4.4.0.4,它是子网的
(2)show ip protocols
R1#sh ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 18 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial1/1             2     2
    Loopback1             2     2

  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    1.0.0.0
    192.168.12.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.12.2         120      00:00:16
  Distance: (default is 120)
// RIPv2默认情况下只接收和发送版本2 的路由更新
  
【提示】  
可以通过命令“ip rip send version”和“ip rip receive version”来控制在路由
器接口上接收和发送的版本,例如在 s0/0/0 接口上接收版本 1 和 2 的路由更新,但是只发
送版本 2 的路由更新,配置如下:
R1(config-if)#ip rip send version 2
R1(config-if)#ip rip receive version 1 2

【注意】 接口特性是优于进程特性的,对于本实验,虽然在 RIP 进程中配置了“version 2” ,
但是如果在接口上配置了“ip rip receive version 1 2” ,则该接口可以接收版本 1 和
2 的路由更新。
                              
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    1.0.0.0
    192.168.12.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.12.2         120      00:00:26
  Distance: (default is 120)

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

3.实验步骤
路由器 R1、R2 和R3 的配置与上面 相同,R4 的配置如下:
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#no auto-summary
R4(config-router)#network 192.168.34.0  
R4(config-router)#network 4.0.0.0
R4(config)#interface s1/2
R4(config-if)#ip summary-address rip 4.4.0.0 255.255.252.0      //RIP 手工路由汇总
4.实验调试
(1)在没有执行汇总之前路由器 R1的路由表如下:
R1#sh ip rou
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

C    192.168.12.0/24 is directly connected, Serial1/1
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback1
     4.0.0.0/24 is subnetted, 4 subnets
R       4.4.0.0 [120/3] via 192.168.12.2, 00:00:22, Serial1/1
R       4.4.1.0 [120/3] via 192.168.12.2, 00:00:22, Serial1/1
R       4.4.2.0 [120/3] via 192.168.12.2, 00:00:22, Serial1/1
R       4.4.3.0 [120/3] via 192.168.12.2, 00:00:22, Serial1/1
R    192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:22, Serial1/1
R    192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:22, Serial1/1
从上面的输出看到路由器 R1 的路由表中有 R4 的4 条环回接口的明细路由。
(2)在执行汇总以后路由器 R1 的路由表如下:
R1#sh ip rou
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

C    192.168.12.0/24 is directly connected, Serial1/1
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback1
     4.0.0.0/22 is subnetted, 1 subnets
R       4.4.0.0 [120/3] via 192.168.12.2, 00:00:00, Serial1/1
R    192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:00, Serial1/1
R    192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:00, Serial1/1

上面的输出表明在路由器 R1 的路由表中接收到汇总路由,当然 R2,R3 上也能收到汇总
路由。 在实验过程中由于使用的是模拟器,加上rip路由收敛慢的原因,导致实验不能出来,这时候你就要使用clear ip rout *来清除所有路由器的路由表!

【思考】
现在将路由器 R4 上四个环回接口 lo0-lo4 的地址分别修改为 192.168.96.4/24, 192.168.97.4/24, 192.168.98.4/24, 192.168.99.4/24,在 s1/2 接口下还能够实现路由
汇总吗?R4上做如下的配置:
R4(config-if)#router rip
R4(config-router)#network 192.168.96.0
R4(config-router)#network 192.168.97.0
R4(config-router)#network 192.168.98.0
R4(config-router)#network 192.168.99.0
R4(config)#int s1/2
R4(config-if)#ip summary-address rip 192.168.96.0 255.255.252.0
路由器会提示如下信息:
“Summary mask must be greater or equal to major net”
显示的提示信息表明汇总后的掩码长度必须要大于或等于主类网络的掩码程度,因为
“22<24”,所以不能汇总。
所以 RIPv2 不支持CIDR 汇总,但是可以传递 CIDR 汇总。
解决方案如下:
(1)用静态路由发布被汇总的路由
R4(config)#ip route 192.168.96.0 255.255.252.0 null0
(2)将静态路由重分布到 RIP 网络中
R4(config)#router rip
R4(config-router)#redistribute static    //将静态路由重分布到 RIP 路由协议中
R4(config-router)#no network 192.168.96.0
R4(config-router)#no network 192.168.97.0
R4(config-router)#no network 192.168.98.0  
R4(config-router)#no network 192.168.99.0
(3)在路由器 R1 上查看路由表
R1#sh ip rou
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

C    192.168.12.0/24 is directly connected, Serial1/1
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback1
R    192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:09, Serial1/1
R    192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:09, Serial1/1
R    192.168.96.0/22 [120/3] via 192.168.12.2, 00:00:04, Serial1/1
通过输出不难看出 RIPv2 是可以传递 CIDR 汇总信息的。

  实验过程中,主要出现的情况是路由更新信息过慢,等了好久才出现。清路由表很重要!