RIP实验
实验拓扑:继续沿用前一个静态路由的实验拓扑
本实验分为两个小实验,第一个是采用RIP的V1版本;第二个是采用RIP的V2版本。
注意两个版本对最后结果的影响。
(一)RIP V1
步骤:
在原有实验结果的基础上,删除原有的静态路由信息。
R1(config)#no ip route 2.2.2.0 255.255.255.0 192.168.12.2
R2(config)#no ip route 1.1.1.0 255.255.255.0 192.168.12.1
 
当然也可以自己把链路层再重新配一遍。
R1(config-router)#net 1.1.1.0
R1(config-router)#net 192.168.12.0
 
R2(config)#router rip
R2(config-router)#net 2.2.2.0
R2(config-router)#net 192.168.12.0
 
测试:
 
R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms
R1#show 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
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
R    2.0.0.0/8 [120/1] via 192.168.12.2, 00:00:15, Serial0/3/0
C    192.168.12.0/24 is directly connected, Serial0/3/0
 
R表示RIP路由协议,注意此时的网络号为2.0.0.0/8,即标准A类地址。
 
 
R1#debug ip rip         //打开RIP的调试
RIP protocol debugging is on
R1#RIP: sending  v1 update to 255.255.255.255 via Loopback0 (1.1.1.1)
RIP: build update entries
      network 2.0.0.0 metric 2
      network 192.168.12.0 metric 1
RIP: sending  v1 update to 255.255.255.255 via Serial0/3/0 (192.168.12.1)
RIP: build update entries
      network 1.0.0.0 metric 1
RIP: received v1 update from 192.168.12.2 on Serial0/3/0
      2.0.0.0 in 1 hops
 
R1#undebug all
All possible debugging has been turned off
 
(二)在以上实验的基础上启用RIP V2版本
 
R1#clear ip route *                         //清空路由表,重新生成
R2#clear ip route *
 
R1(config-router)#version 2
R1(config-router)#no auto-summary
 
R2(config-router)#version 2
R2(config-router)#no auto-summary
 
V2版本支持VLSM,因此可通过关闭自动汇总功能。
 
 
R1#show 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
     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 192.168.12.2, 00:00:02, Serial0/3/0
C    192.168.12.0/24 is directly connected, Serial0/3/0
 
 
 
R1#debug ip rip
RIP protocol debugging is on
R1#RIP: received v2 update from 192.168.12.2 on Serial0/3/0
      2.2.2.0/24 via 0.0.0.0 in 1 hops
RIP: sending  v2 update to 224.0.0.9 via Loopback0 (1.1.1.1)
RIP: build update entries
      2.2.2.0/24 via 0.0.0.0, metric 2, tag 0
      192.168.12.0/24 via 0.0.0.0, metric 1, tag 0
RIP: sending  v2 update to 224.0.0.9 via Serial0/3/0 (192.168.12.1)
RIP: build update entries
      1.1.1.0/24 via 0.0.0.0, metric 1, tag 0