1拓扑结构:
该网络结构有几个关键点:VRRP、STP、NQA
当核心1检测202.106.0.20失败时,nqa联动 track 对核心sw1 的priority进行减80,核心sw2获取vrip,从而接入层用户优先从核心sw2出。当核心sw1检测202.106.0.20成功时,sw1的 priority恢复150,sw1 重新获取vrip
以下是部分配置
核心sw1
#
interface Vlan-interface831
description 2F-1
ip address 192.168.20.253 255.255.255.0
vrrp vrid 25 virtual-ip 192.168.20.254
vrrp vrid 25 priority 150
vrrp vrid 25 timer advertise 2
#track 1 联动 vrid 自动减1,从而sw2获取vip:192.168.20.254
vrrp vrid 25 track 1 reduced 80
dhcp select relay
dhcp relay server-select 1
#创建 admin test 策略
nqa entry admin test
#类型icmp检测
type icmp-echo
#检测地址ip
destination ip 202.106.0.20
#检测频率
frequency 100
reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
#track联动
track 1 nqa entry admin test reaction 1
#nqa策略admin test 启动
nqa schedule admin test start-time now lifetime forever
核心sw2
#
interface Vlan-interface831
description 2F-1
ip address 192.168.20.252 255.255.255.0
vrrp vrid 25 virtual-ip 192.168.20.254
vrrp vrid 25 priority 110
vrrp vrid 25 timer advertise 2
dhcp select relay
dhcp relay server-select 1