本帖最后由 旺旺的窝窝 于 2013-5-18 15:21 编辑
实验配置: 现在路由器间启动RIPv1R1#sh run interface Ethernet0 ip address 192.168.1.33 255.255.255.224 ! interface Serial0 ip address 192.168.1.1 255.255.255.252 ! router rip network 192.168.1.0 ! **************************************************** R2#sh run ! interface Loopback0 ip address 192.168.1.65 255.255.255.224 ! interface Serial0 ip address 192.168.1.2 255.255.255.252 clockrate 64000 ! interface Serial1 ip address 192.168.1.5 255.255.255.252 clockrate 64000 ! router rip network 192.168.1.0 ! **************************************************** R3#sh run ! interface Ethernet0 ip address 192.168.1.34 255.255.255.224 ! interface Serial1 ip address 192.168.1.6 255.255.255.252 ! router rip network 192.168.1.0 ! **************************************************** 实验检验: R2#sh ip route Gateway of last resort is not set 192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks
C 192.168.1.64/27 is directly connected, Loopback0
C 192.168.1.0/30 is directly connected, Serial0
C 192.168.1.4/30 is directly connected, Serial1 通过R2的路由表我们看到R2并没有收到192.168.1.32/27网络的路由 R1#sh ip route Gateway of last resort is not set 192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks
C 192.168.1.32/27 is directly connected, Ethernet0
C 192.168.1.0/30 is directly connected, Serial0
R 192.168.1.4/30 [120/1] via 192.168.1.1, 00:00:05, Serial0 我们看到R1并没有收到192.168.1.64/27网络的路由 R3#sh ip route Gateway of last resort is not set 192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks
C 192.168.1.32/27 is directly connected, Ethernet0
R 192.168.1.0/30 [120/1] via 192.168.1.5, 00:00:15, Serial1
C 192.168.1.4/30 is directly connected, Serial1 我们看到R3也没有收到192.168.1.64/27网络的路由;由此我们看到,在3台路由器之间启用RIPV1后,3台路由器都是不完整的。这时因为RIPv1在发送路由更新时并不会携带网络的子网掩码 ,因此RIPV1并不能支持VLSM网络环境,因此为了网络能正常运行,我们必须配置RIPv2。 **************************************************** R1(config)#router rip R1(config-router)#version 2 R1(config-router)#no auto-summary //此命令是关闭路由汇总,目的是为了发送无类网络的路由,使子网能穿越有类网络的边界 R1(config-router)#network 192.168.1.0 **************************************************** R2(config)#router rip R2(config-router)#version 2 R2(config-router)#no auto-summary R2(config-router)#network 192.168.1.0 **************************************************** R3(config)#router rip R3(config-router)#version 2 R3(config-router)#no auto-summary R3(config-router)#network 192.168.1.0 **************************************************** 现在再来查看一下路由表,看看有什么变化 R1#sh ip route Gateway of last resort is not set 192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks
R 192.168.1.64/27 [120/1] via 192.168.1.1, 00:00:27, Serial0
C 192.168.1.32/27 is directly connected, Ethernet0
C 192.168.1.0/30 is directly connected, Serial0
R 192.168.1.4/30 [120/1] via 192.168.1.2, 00:00:27, Serial0
[120/1] via 192.168.1.34, 00:00:01, Ethernet0 R2#sh ip route Gateway of last resort is not set 192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks
C 192.168.1.64/27 is directly connected, Loopback0
R 192.168.1.32/27 [120/1] via 192.168.1.1, 00:00:19, Serial0
[120/1] via 192.168.1.6, 00:00:25, Serial1
C 192.168.1.0/30 is directly connected, Serial0
C 192.168.1.4/30 is directly connected, Serial1 R3#sh ip route
Gateway of last resort is not set 192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks
R 192.168.1.64/27 [120/1] via 192.168.1.5, 00:00:12, Serial1
C 192.168.1.32/27 is directly connected, Ethernet0
R 192.168.1.0/30 [120/1] via 192.168.1.5, 00:00:12, Serial1
[120/1] via 192.168.1.33, 00:00:11, Ethernet0
C 192.168.1.4/30 is directly connected, Serial1 可以看到在配置RIPV2 之后,3台路由器都有了完整的路由表。
|