案列:
说明:左边的192.168.5.193和右边的192.168.5.126 都用loopback口模拟
同时运行RIPv1 之后
路由表信息:
- RT1#sh ip route
- Codes: C - connected, S - static, 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
- i - IS-IS, su - IS-IS summary, 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
- C 192.168.4.0/24 is directly connected, Serial1/0
- 192.168.5.0/27 is subnetted, 2 subnets
- C 192.168.5.192 is directly connected, Loopback0
- RT2#sh ip route
- Codes: C - connected, S - static, 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
- i - IS-IS, su - IS-IS summary, 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
- C 192.168.4.0/24 is directly connected, Serial1/0
- 192.168.5.0/27 is subnetted, 2 subnets
- C 192.168.5.96 is directly connected, Loopback0
可以看到 路由表里没有对方的路由信息,左边的网段 和 右边的网段 不能通讯。
左边和右边的属于一个子网,中间被192.168.4.0/24 隔开 成了不连续的子网,由于RIPv1 不携带掩码信息,到主类接口便自动汇总为192.168.5.0/24,
这样两边便不能通讯。
解决方案:
在RT1和RT2的 s1/0(两者直连的接口)添加辅助地址,这个辅助地址也要是和两边loopback的路由是同一个子网的。
配置:
- RT2(config)#in serial 1/0
- RT2(config-if)#ip address 192.168.5.2 255.255.255.224 secondary
- RT1(config)#in serial 1/0
- RT1(config-if)#ip address 192.168.5.1 255.255.255.224 secondary
配置完成之后再看两台路由器的路由表
- RT2#sh ip route
- Codes: C - connected, S - static, 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
- i - IS-IS, su - IS-IS summary, 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
- C 192.168.4.0/24 is directly connected, Serial1/0
- 192.168.5.0/27 is subnetted, 3 subnets
- C 192.168.5.96 is directly connected, Loopback0
- C 192.168.5.0 is directly connected, Serial1/0
- R 192.168.5.192 [120/1] via 192.168.5.1, 00:00:11, Serial1/0
- RT1#sh ip route
- Codes: C - connected, S - static, 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
- i - IS-IS, su - IS-IS summary, 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
- C 192.168.4.0/24 is directly connected, Serial1/0
- 192.168.5.0/27 is subnetted, 3 subnets
- R 192.168.5.96/27 is possibly down,
- routing via 192.168.5.1, Serial1/0
- C 192.168.5.0 is directly connected, Serial1/0
- C 192.168.5.192 is directly connected, Loopback0
此时两边的路由都有了。
测试:
- RT1#ping 192.168.5.126 source 192.168.5.193
- Type escape sequence to abort.
- Sending 5, 100-byte ICMP Echos to 192.168.5.126, timeout is 2 seconds:
- Packet sent with a source address of 192.168.5.193
- !!!!!
本文原创,如需转载请注明出处。
联系方式:[email protected]