拓扑见QQ收藏;

[S2]int vlan 10

[S2-Vlan-interface10]vrrp vrid 10 virtual-ip 172.16.10.254  配置VIP地址

[S2-Vlan-interface10]vrrp vrid 10 priority 110          修改优先级,默认为100

[S2-Vlan-interface10]vrrp vrid 10 preempt-mode delay 3     延迟10s后抢占

[S2-Vlan-interface10]vrrp vrid 10 timer advertise 10      10s通告一次

[S2-Vlan-interface10]vrrp vrid 10 track 4 priority reduced 20

[S2]track 4 interface g1/0/1 监视上行的端口 (注意输入命令的模式)

解释:当监视的链路down之后,优先级降低20


真机上一般使用下面命令:

[S2-Vlan-interface13]vrrp vrid 1 track interface E1/0/1 reduced 20


使用BFD监视上行链路:

[S2]bfd echo-source-ip 8.8.8.8    //地址任意

[S2]track 11 bfd echo interface e1/0/1 remote ip 23.1.1.3 local ip 23.1.1.2

注意:23.1.1.3为上游IP,23.1.1.2为自己与上游接口的IP地址

[S2-Vlan-interface11]vrrp vrid 11 track 11 reduced 20

[S2-Ethernet1/0/1]bfd min-receive-interval 500

[S2-Ethernet1/0/1]bfd min-transmit-interval 500                  

[S2-Ethernet1/0/1]bfd detect-multiplier 6


监控内网线路,实现主备的快速切换:

[S2]bfd echo-source-ip 8.8.8.8    //地址任意

[S2]track 10 bfd echo interface Vlan-interface 10 remote ip 172.16.10.252 local ip 172.16.10.253

注意:vlan 10 为内网vlan ,172.16.10.252是自己给内网提供的网关地址,172.16.10.253为对端提供的网关地址

[S2-Vlan-interface10]vrrp vrid 10 track 10 switchover  

//若探测到S1不可达,S2立即切换为Master

//若不执行以上操作,则等待3个通告周期后切换。









查看VRRP配置:

<S1>dis vrrp verbose