VRRP基础配置
1.实验拓扑
实验配置
[Master WAC-Vlanif1]dis this
#
interface Vlanif1
ip address 192.168.1.11 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 120
vrrp vrid 1 track interface GigabitEthernet0/0/1 reduced 30
#
return
#
interface GigabitEthernet0/0/1
stp disable
#
[Standby WAC-Vlanif1]dis this
#
interface Vlanif1
ip address 192.168.1.21 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.1
#
return
#
interface GigabitEthernet0/0/1
stp disable
#
#
interface GigabitEthernet0/0/1
stp disable
#
#
interface GigabitEthernet0/0/2
stp disable
#
如果使用bfd来检测链路故障的方案中,WAC的bfd相关配置如下:
Master WAC
#
bfd
#
#
bfd vrrp bind peer-ip 192.168.1.21 interface Vlanif1
discriminator local 1
discriminator remote 2
min-tx-interval 100
min-rx-interval 100
commit
#
#
interface Vlanif1
ip address 192.168.1.11 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.1
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 120
#
Standby WAC
#
bfd
#
#
bfd vrrp bind peer-ip 192.168.1.11 interface Vlanif1
discriminator local 2
discriminator remote 1
min-tx-interval 100
min-rx-interval 100
commit
#
#
interface Vlanif1
ip address 192.168.1.21 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.1
vrrp vrid 1 track bfd-session 2 increased 30 //可以在Standby WAC上调用bfd检测链路状态,让其优先级增加,或者在Master WAC调用bfd检测链路状态,让其优先级减少,只需要一方使用就ok
#
实验结果
配置完后dis vrrp brief可看到Master WAC做主设备,Standby WAC做备设备
PC能ping通Gateway
Core Switch shutdown G0/0/1后,会进行主备切换,备设备会升为主设备
PC业务丢几个包后可正常ping通
Core Switch undo shutdown G0/0/1后,原主设备经120S后重新升为主,Standy WAC恢复为备。