解决RIPv1不连续子网的两种方法
- 使用RIPv2手动关闭自动汇总.
- 地址接口配置备份地址.
这里主要讲第二种方法
下面是拓扑图
注意事项:
配置备份地址时要加上"secondary"关键字,如果没加会导致改变主地址.
基础配置:
Barney:
conf t
ho Barney
interface Loopback0
ip address 10.33.55.1 255.255.240.0
interface Ethernet0/0
no shut
ip address 192.168.83.24 255.255.255.0
router rip
network 10.0.0.0
network 192.168.83.0
Andy:
conf t
ho Andy
interface Ethernet0/0
no shut
ip address 192.168.83.1 255.255.240.0
interface Ethernet0/2
no shut
ip address 192.168.12.65 255.255.255.224
interface Ethernet0/1
no shut
ip address 192.168.12.195 255.255.255.224
router rip
network 192.168.12.0
network 192.168.83.0
Ernest:
conf t
ho Ernest
interface Ethernet0/0
no shut
ip address 192.168.12.196 255.255.255.224
interface Loopback0
ip address 10.33.35.1 255.255.240.0
router rip
network 10.0.0.0
network 192.168.12.0
配置完后在Andy上ping 10.33.35.1和10.33.55.1是没法ping通的
解决方法:
Barney:
interface Ethernet0/0
ip address 10.33.5.1 255.255.240.0 secondary
Andy:
interface Ethernet0/0
ip address 10.33.5.2 255.255.240.0 secondary
interface Ethernet0/1
ip address 10.33.75.1 255.255.240.0 secondary
router rip
network 10.0.0.0
Ernest:
interface Ethernet0/0
ip address 10.33.75.2 255.255.240.0 secondary
到Andy上去show ip route时路由表中出现了10.33.32.0/20和10.33.48.0/20的网段
分别是去往10.33.35.1/20和10.33.55.1/20的网段