通过修改静态路由的管理距离为130,使得路由器在选择时优先选择RIP,而静态路由作为备份。
R1(config)#ip route 2.2.2.0 255.255.255.0 192.168.12.2 130 将静态路由的管理距离设置为130
R1(config)#router rip
R1(config-router)#network X.X.X.X 不要将走静态路由的IP宣告出去
在配置R2
R2(config)#ip route 1.1.1.0 255.255.255.0 192.168.12.1 130
R2(config)#router rip
R2(config-router)#network X.X.X.X 不要将走静态路由的IP宣告出去
因为RIP的管理距离为120,小与静态路由中设定的130,而静态路由处在备份状态。把R1宣告RIP的接口DOWN掉,在查看路由表,备份的静态路由被放入路由表中。
转载于:https://blog.51cto.com/2614223/481376