RIP的32位路由问题
两个router通过fr相连
BB1:
interface Loopback0
--More--
07:55:35: %SYS-5-CONFIG_I: Configured from console by console
ip address 1.1.1.1 255.255.255.0
!
interface Serial0
ip address 172.31.1.3 255.255.255.0
encapsulation frame-relay
no arp frame-relay
frame-relay map ip 172.31.1.1 111 broadcast
no frame-relay inverse-arp
!
interface Serial1
no ip address
shutdown
!
router rip
network 1.0.0.0
network 172.31.0.0
!
BBR1# sh ip rou
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
172.31.0.0/24 is subnetted, 2 subnets
C 172.31.1.0 is directly connected, Serial0
R 172.31.0.0 [120/1] via 172.31.1.1, 00:00:12, Serial0
10.0.0.0/24 is subnetted, 1 subnets
C 10.254.0.0 is directly connected, Ethernet0
R 11.0.0.0/8 [120/1] via 172.31.1.1, 00:00:13, Serial0
BBR1#sh ip rip data
1.0.0.0/8 auto-summary
1.1.1.0/24 directly connected, Loopback0
11.0.0.0/8 auto-summary
11.0.0.0/8
[1] via 172.31.1.1, 00:00:24, Serial0
172.31.0.0/16 auto-summary
172.31.0.0/24
[1] via 172.31.1.1, 00:00:24, Serial0
172.31.1.0/24 directly connected, Serial0
P1R1:
interface Serial0
ip address 172.31.1.1 255.255.0.0(和对方接口的掩码不一样)
P1R1# sh ip rou
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 172.31.1.3, 00:00:22, Serial0
172.31.0.0/16 is variably subnetted, 2 subnets, 2 masks
R 172.31.1.0/32 [120/1] via 172.31.1.3, 00:00:22, Serial0
C 172.31.0.0/16 is directly connected, Serial0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.1.0 is directly connected, Ethernet0
C 10.1.0.0 is directly connected, Serial1
11.0.0.0/24 is subnetted, 1 subnets
C 11.11.11.0 is directly connected, Loopback0
P1R1#sh ip rip data
1.0.0.0/8 auto-summary
1.0.0.0/8
[1] via 172.31.1.3, 00:00:27, Serial0
11.0.0.0/8 auto-summary
11.11.11.0/24 directly connected, Loopback0
172.31.0.0/16 auto-summary
172.31.0.0/16 directly connected, Serial0
172.31.1.0/32
[1] via 172.31.1.3, 00:00:27, Serial0
debug信息:
P1R1#clear ip route
% Incomplete command.
P1R1#
07:57:39: RIP: sending v1 update to 255.255.255.255 via Loopback0 (11.11.11.11)
07:57:39: RIP: build update entries
07:57:39: network 1.0.0.0 metric 2
07:57:39: network 172.31.0.0 metric 1
07:57:39: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.31.1.1)
07:57:39: RIP: build update entries
07:57:39: network 1.0.0.0 metric 2
07:57:39: network 11.0.0.0 metric 1
07:57:39: subnet 172.31.0.0 metric 1
07:57:39: subnet 172.31.1.0 metric 2
P1R1#clear ip route *
P1R1#
07:57:44: RIP: sending request on Loopback0 to 255.255.255.255
07:57:44: RIP: sending request on Serial0 to 255.255.255.255
07:57:44: RIP: received v1 update from 172.31.1.3 on Serial0
07:57:44: 1.0.0.0 in 1 hops
07:57:44: 11.0.0.0 in 2 hops
07:57:44: 172.31.0.0 in 2 hops
07:57:44: 172.31.1.0 in 1 hops
P1R1#
07:57:46: RIP: sending v1 flash update to 255.255.255.255 via Loopback0 (11.11.11.11)
07:57:46: RIP: build flash update entries
07:57:46: network 1.0.0.0 metric 2
07:57:46: network 172.31.0.0 metric 1
07:57:46: RIP: sending v1 flash update to 255.255.255.255 via Serial0 (172.31.1.1)
07:57:46: RIP: build flash update entries
07:57:46: network 1.0.0.0 metric 2
07:57:46: network 11.0.0.0 metric 1
07:57:46: subnet 172.31.0.0 metric 1
07:57:46: subnet 172.31.1.0 metric 2
有一个结论是:rip会将这个接口上学习到的路由用自己的接口掩码来解释,所以产生了32位的路由,有一种解决方法是用secondly地址来解决?大家来讨论一下这个问题!!!谢谢
实际实验结果如下,是R1和R2的路由表和debug信息
帧中继接口默认情况下,Split horizon is disabled
路由器 R1---------R2
实验分两种情况
1.Split horizon is disabled
R2#sh ip ro
R 1.0.0.0/8 [120/1] via 172.31.1.3, 00:00:10, Serial0
172.31.0.0/16 is variably subnetted, 2 subnets, 2 masks
R 172.31.1.0/32 [120/1] via 172.31.1.3, 00:00:10, Serial0
C 172.31.0.0/16 is directly connected, Serial0
R2#
R2#
01:45:21: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.31.1.1)
01:45:21: RIP: build update entries
01:45:21: network 1.0.0.0 metric 2
01:45:21: subnet 172.31.0.0 metric 1
01:45:21: subnet 172.31.1.0 metric 2
R2#
01:45:28: RIP: received v1 update from 172.31.1.3 on Serial0
01:45:28: 1.0.0.0 in 1 hops
01:45:28: 172.31.0.0 in 2 hops
01:45:28: 172.31.1.0 in 1 hops
R1#sh ip ro
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
172.31.0.0/24 is subnetted, 2 subnets
C 172.31.1.0 is directly connected, Serial0
R 172.31.0.0 [120/1] via 172.31.1.1, 00:00:09, Serial0
R1#
R1#
01:49:32: RIP: received v1 update from 172.31.1.1 on Serial0
01:49:32: 1.0.0.0 in 2 hops
01:49:32: 172.31.0.0 in 1 hops
01:49:32: 172.31.1.0 in 2 hops
R1#
01:49:38: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.31.1.3)
01:49:38: RIP: build update entries
01:49:38: network 1.0.0.0 metric 1
01:49:38: subnet 172.31.0.0 metric 2
01:49:38: subnet 172.31.1.0 metric 1
2.Split horizon is enabled
R1#sh ip ro
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
172.31.0.0/24 is subnetted, 1 subnets
C 172.31.1.0 is directly connected, Serial0
02:01:23: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.31.1.3)
02:01:23: RIP: build update entries
02:01:23: network 1.0.0.0 metric 1
R2#sh ip ro
R 1.0.0.0/8 [120/1] via 172.31.1.3, 00:00:02, Serial0
C 172.31.0.0/16 is directly connected, Serial0
R2#
02:01:55: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.31.1.1)
02:01:55: RIP: build update entries - suppressing null update
R2#
02:02:16: RIP: received v1 update from 172.31.1.3 on Serial0
02:02:16: 1.0.0.0 in 1 hops
所以本题的32为路由可以用水平分割来解决
Monday, March 21, 2005 1:23 PM
浙公网安备 33010602011771号