网络工程师交换试验手册之八:RIPv1与RIPv2的兼容性实验

实验目的:
测试RIPv2是否兼容RIPv1,两者之间能否相互学习到对方的路由。并利用DEBUG观察路由更新的信息。需要大家主意的是,这个实验的链路是帧中继链路,这个链路的DLCI号码已经在拓扑中标识了,希望大家参考,但是还是要根据我们华思世纪学习认证中心现在给大家提供的实验拓扑来对照。
实验拓扑:



实验内容:
1.路由器的基本配置
R1上的基本配置
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 192.168.10.3 255.255.255.0
encapsulation frame-relay
frame-relay map ip 192.168.10.3 102 broadcast
frame-relay map ip 192.168.10.4 102 broadcast
frame-relay map ip 192.168.10.5 103 broadcast
no frame-relay inverse-arp
R2上的基本配置
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Loopback1
ip address 2.2.3.2 255.255.255.0
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
ip address 192.168.10.4 255.255.255.0
encapsulation frame-relay
frame-relay map ip 192.168.10.3 201 broadcast
frame-relay map ip 192.168.10.4 201 broadcast
frame-relay map ip 192.168.10.5 201 broadcast
no frame-relay inverse-arp
R3上的基本配置
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
ip address 192.168.10.5 255.255.255.0
encapsulation frame-relay
frame-relay map ip 192.168.10.3 301 broadcast
frame-relay map ip 192.168.10.4 301 broadcast
frame-relay map ip 192.168.10.5 301 broadcast
no frame-relay inverse-arp
2.在所有的路由器上启动RIPv1
R1上启动RIPv1
router rip
network 1.0.0.0
network 192.168.10.0
R2上启动RIPv1
router rip
network 2.0.0.0
network 192.168.10.0
R3上启动RIPv1
router rip
network 3.0.0.0
network 192.168.10.0
3.查看此时各个路由器的路由表
R1的路由表
R3#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.10.4, 00:00:22, Serial1
R    3.0.0.0/8 [120/1] via 192.168.10.5, 00:00:19, Serial1
C    192.168.10.0/24 is directly connected, Serial1
R2的路由表
R4#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
R    1.0.0.0/8 [120/1] via 192.168.10.3, 00:00:05, Serial0
     2.0.0.0/24 is subnetted, 2 subnets
C       2.2.2.0 is directly connected, Loopback0
C       2.2.3.0 is directly connected, Loopback1
R    3.0.0.0/8 [120/2] via 192.168.10.3, 00:00:05, Serial0
C    192.168.10.0/24 is directly connected, Serial0
R3的路由表
R5#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
R    1.0.0.0/8 [120/1] via 192.168.10.3, 00:00:27, Serial0
R    2.0.0.0/8 [120/2] via 192.168.10.3, 00:00:27, Serial0
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
C    192.168.10.0/24 is directly connected, Serial0
从各个路由器上的路由表可知RIPv1不支持VLSM,并且RIPv2不能接受RIPv1的路由,但是RIPv1能够接受RIPv2的路由。此处验证了RIPv1能够兼容RIPv12,而RIPv2不能兼容RIPv1。
将R4上的RIPv1更改成RIPv2
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#no auto-summary(去掉自动汇总)
R4(config-router)#net 2.2.3.0
R4(config-router)#net 2.2.2.0
查看此时的R3的路由表
R3上的路由表:
R3#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/8 is variably subnetted, 3 subnets, 2 masks
R       2.2.2.0/24 [120/1] via 192.168.10.4, 00:00:09, Serial1
R       2.0.0.0/8 [120/3] via 192.168.10.5, 00:00:04, Serial1
R       2.2.3.0/24 [120/1] via 192.168.10.4, 00:00:09, Serial1
R    3.0.0.0/8 [120/1] via 192.168.10.5, 00:00:04, Serial1
C    192.168.10.0/24 is directly connected, Serial1
有路由表2.2.2.0/24 和2.2.3.0/24可知,RIPv2支持VLSM所以R4没有将这两条路由汇总,而是直接传送给R3.
将所有的路由器均改为RIPv2
   R5(config)#router rip
R5(config-router)#ver 2
R3(config)#router rip
R3(config-router)#ver 2
查看此时的各个路由器 上的路由表
    R3#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/8 is variably subnetted, 2 subnets, 2 masks
R       1.0.0.0/8 [120/2] via 192.168.10.5, 00:00:16, Serial1
C       1.1.1.0/24 is directly connected, Loopback0
     2.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
R       2.0.0.0/8 [120/3] via 192.168.10.5, 00:00:16, Serial1
R       2.2.2.0/24 [120/1] via 192.168.10.4, 00:00:00, Serial1
R       2.2.3.0/24 [120/1] via 192.168.10.4, 00:00:00, Serial1
R    3.0.0.0/8 [120/1] via 192.168.10.5, 00:00:16, Serial1
C    192.168.10.0/24 is directly connected, Serial1
    R4#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
R    1.0.0.0/8 [120/1] via 192.168.10.3, 00:00:21, Serial0
     2.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
R       2.0.0.0/8 [120/2] via 192.168.10.3, 00:00:21, Serial0
C       2.2.2.0/24 is directly connected, Loopback0
C       2.2.3.0/24 is directly connected, Loopback1
R    3.0.0.0/8 [120/2] via 192.168.10.3, 00:00:21, Serial0
C    192.168.10.0/24 is directly connected, Serial0
    R5#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
R    1.0.0.0/8 [120/1] via 192.168.10.3, 00:00:25, Serial0
R    2.0.0.0/8 [120/2] via 192.168.10.3, 00:00:25, Serial0
     3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       3.0.0.0/8 [120/2] via 192.168.10.3, 00:00:25, Serial0
C       3.3.3.0/24 is directly connected, Loopback0
C    192.168.10.0/24 is directly connected, Serial0
仔细观察R3上的路由,这里多个1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       1.0.0.0/8 [120/2] via 192.168.10.5, 00:00:16, Serial1而1.0.0.0/8是R3上的LOOP0口,所以这里发生了路由环路。工作中我们一定要小心避免路由环路问题。
总结RIPv1与RIPv2之间的兼容性,以及RIPv2和RIPv1是否对VLSM的支持
RIPv2支持VLSM
RIPv1兼容RIPv2
4.debug  ip  rip观察RIPv2的链路信息:
R5#debug ip rip
RIP protocol debugging is on
R5#
05:51:45: RIP: ignored v1 packet from 192.168.10.3 (illegal version)
05:51:56: RIP: sending v2 update to 224.0.0.9 via Loopback0 (3.3.3.3)
05:51:56: RIP: build update entries
05:51:56:       1.0.0.0/8 via 0.0.0.0, metric 2, tag 0
05:51:56:       2.0.0.0/8 via 0.0.0.0, metric 3, tag 0
05:51:56:       192.168.10.0/24 via 0.0.0.0, metric 1, tag 0
05:51:56: RIP: sending v2 update to 224.0.0.9 via Serial0 (192.168.10.5)
05:51:56: RIP: build update entries
05:51:56:       1.0.0.0/8 via 0.0.0.0, metric 2, tag 0
05:51:56:       2.0.0.0/8 via 0.0.0.0, metric 3, tag 0
05:51:56:       3.0.0.0/8 via 0.0.0.0, metric 1, tag 0
05:51:56:       192.168.10.0/24 via 0.0.0.0, metric 1, tag 0
05:51:56: RIP: ignored v2 packet from 3.3.3.3 (sourced from one of our addresse
05:52:27: RIP: build flash update entries
05:52:27:       1.0.0.0/8 via 0.0.0.0, metric 16, tag 0
05:52:27:       2.0.0.0/8 via 0.0.0.0, metric 16, tag 0
05:52:27: RIP: sending v2 flash update to 224.0.0.9 via Serial0 (192.168.10.5)
05:52:27: RIP: build flash update entries
05:52:27:       1.0.0.0/8 via 0.0.0.0, metric 16, tag 0
05:52:27:       2.0.0.0/8 via 0.0.0.0, metric 16, tag 0
05:52:27: RIP: ignored v2 packet from 3.3.3.3 (sourced from one of our addresses
)
05:52:41: RIP: ignored v1 packet from 192.168.10.3 (illegal version)
05:52:51: RIP: sending v2 update to 224.0.0.9 via Loopback0 (3.3.3.3)
05:52:51: RIP: build update entries
05:52:51:       1.0.0.0/8 via 0.0.0.0, metric 16, tag 0
05:52:51:       2.0.0.0/8 via 0.0.0.0, metric 16, tag 0
05:52:51:       192.168.10.0/24 via 0.0.0.0, metric 1, tag 0
05:52:51: RIP: sending v2 update to 224.0.0.9 via Serial0 (192.168.10.5)
05:52:51: RIP: build update entries
05:52:51:       1.0.0.0/8 via 0.0.0.0, metric 16, tag 0
05:52:51:       2.0.0.0/8 via 0.0.0.0, metric 16, tag 0
05:52:51:       3.0.0.0/8 via 0.0.0.0, metric 1, tag 0
05:52:51:       192.168.10.0/24 via 0.0.0.0, metric 1, tag 0
05:52:51: RIP: ignored v2 packet from 3.3.3.3 (sourced from one of our addresses
)
05:53:10: RIP: ignored v1 packet from 192.168.10.3 (illegal version)
R3#debug ip rip
RIP protocol debugging is on
R3#
05:32:32: RIP: sending v1 update to 255.255.255.255 via Loopback0 (1.1.1.1)
05:32:32: RIP: build update entries
05:32:32:       network 2.0.0.0 metric 2
05:32:32:       network 3.0.0.0 metric 2
05:32:32:       network 192.168.10.0 metric 1
05:32:32: RIP: sending v1 update to 255.255.255.255 via Serial1 (192.168.10.3)
05:32:32: RIP: build update entries
05:32:32:       network 1.0.0.0 metric 1
05:32:32:       network 2.0.0.0 metric 2
05:32:32:       network 3.0.0.0 metric 2
05:32:32:       subnet 192.168.10.0 metric 1
观察DEBUG信息可以知道RIPv2的路由更新支持组波,组波地址:224.0.0.9.而RIPv1的路由更新是广播,广播地址:255.255.255.255
实验总结:
通过对RIPv1与RIPv2的实验我们可以得出,两者本质的区别,通过实验增加对RIPv2的了解,希望大家重点掌握,汇总后的变化,这是重点。

你可能感兴趣的:(职场,休闲,交换,网络工程师,试验手册)