路由器基础配置之浮动静态路由
我们将以上面的拓扑图进行实验,配置两条rip路由,以实现负载均衡和冗余的效果,配置一条静态路由,让rip覆盖静态路由(当rip和静态同时存在,默认情况下静态会覆盖rip,也就是路由表中只有静态路由,但覆盖并不是消失,其中一个协议挂掉时,另一个会自动生效进行工作)
首先配置router0
enable 进入特权模式
config t 进入全局配置模式
interface L0
ip address 192.168.1.1 255.255.255.0
exit
interface s0/3/0
ip address 192.168.3.1 255.255.255.0
clock rate 6400 设置同步时间
no shu 激活接口
exit
interface s0/3/1
ip address 192.168.5.1 255.255.255.0
clock rate 6400
no shu
exit
interface g0/0
ip address 192.168.4.1 255.255.255.0
no shu
在特权模式下
router rip
version 2
network 192.168.1.0
network 192.168.3.0
network 192.168.5.0
router2
enable 进入特权模式
config t 进入全局配置模式
interface L0
ip address 192.168.2.1 255.255.255.0
exit
interface s0/3/0
ip address 192.168.3.2 255.255.255.0
no shu 激活接口
exit
interface s0/3/1
ip address 192.168.5.2 255.255.255.0
no shu
exit
interface g0/0
ip address 192.168.4.2 255.255.255.0
在特权模式下
router rip
version 2
network 192.168.2.0
network 192.168.3.0
network 192.168.5.0
rip就配置完成了,可以在特权模式下使用show ip router来查看路由表,表中前缀是R,即为rip路由
配置静态路由,并被rip覆盖,默认静态会覆盖掉rip
router0
在全局配置模式下
ip router 192.168.2.0 255.255.255.0 192.168.4.2 125 默认情况下rip是120,我们这里把静态设置为125,这样rip就会覆盖静态
router1
在全局配置模式下
ip router 192.168.1.0 255.255.255.0 192.168.4.1 125
这样浮动静态路由就完成了,用shou ip router查看,会发现路由表里依然只有rip,但当rip挂掉的时候,静态就会自动出现工作