注:R2为DCE
因RIPv1为有类路由,(默认为RIPV1)故他会自动汇总,并且只认有类IP网络, 1.1.1 .0/24,他依然只把他做为A类地址来看待,所以你发布网络:
net 1.1.1.0
与net 1.0.0.0 效果是一样的。也就是说这个实验的结果是R1ping 不通R3的回环口,R2只可以ping 通R1或F3其中的一个回环口。
Router>
Router>en
Router#con t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#int loopback 1
R1(config-if)#ip add 1.1.1 .1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int s0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#net 1.0.0 .0
R1(config-router)#net 192.168.1.0
R1(config-router)#exit
R1(config)#exit
R1#
router>en
router#con t
router(config)#host R2
R2(config)#int s0/0
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#int s0/1
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#net 192.168.1.0
R2(config-router)#net 192.168.2.0
R2(config-router)#exit
R2(config)#exit
Router>
Router>en
Router#con t
Router(config)#host R3
R3(config)#int s0/0
R3(config-if)#ip add 192.168.2.2 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#int loopback 1
R3(config-if)#ip add 1.1.2 .1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#router rip
R3(config-router)#net 192.168.2.0
R3(config-router)#net 1.0.0 .0
R3(config-router)#end
R3#
现在路由都配过了,看下各自的路由表:
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
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, * - candidate default
U - per-user 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, Loopback1
C 192.168.1.0 is directly connected, Serial0/0
R 192.168.2.0 [120/1] via 192.168.1.2, 00:02:33, Serial0/0
R2#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
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, * - candidate default
U - per-user static route
Gateway of last resort is not set
C 192.168.1.0 is directly connected, Serial0/0
C 192.168.2.0 is directly connected, Serial0/1
R 1.0.0 .0 [120/1] via 192.168.2.2, 00:09:28, Serial0/1
R2#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
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, * - candidate default
U - per-user static route
Gateway of last resort is not set
C 192.168.1.0 is directly connected, Serial0/0
C 192.168.2.0 is directly connected, Serial0/1
R 1.0.0 .0 [120/1] via 192.168.2.2, 00:05:35, Serial0/1
同样是R2不同时间竟然不一样。
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
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, * - candidate default
U - per-user static route
Gateway of last resort is not set
C 192.168.2.0 is directly connected, Serial0/0
1.0.0 .0/24 is subnetted, 1 subnets
C 1.1.2 .0 is directly connected, Loopback1
R 192.168.1.0 [120/1] via 192.168.2.1, 00:05:41, Serial0/0
R3#ping 1.1.1 .1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1 .1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5), round-trip min/avg/max = 1/2/4 ms
结果就是这个样子。