现在的情况是,有可能无法配置客户公司那边的设备,只能通过一方的配置实现双机热备,所以可以使用HSRP+IP SLA+TRACK+EEM,通过EEM监视自己LAN口的状态,一旦条件成立,DOWN掉WAN口。
-----------IP SLA部分不变---------
ip sla monitor 1
type echo protocol ipIcmpEcho 172.20.0.10
ip sla monitor schedule 1 life forever start-time now
---------------------
track 2 rtr 1 reachability
------------------------
interface FastEthernet0/0
ip address 172.10.15.254 255.255.255.0
duplex auto
speed auto
standby 1 ip 172.10.15.100
standby 1 priority 120
standby 1 preempt
standby 1 track 2 decrement 60
-----------------定义如果F0/0 DOWN掉,则激活下列命令,使S1/0也DOWN掉---
event manager session cli username s1/0_upDOWN
event manager applet track_2
event syslog pattern "Interface FastEthernet0/0, changed state to administratively down"
action 1.0 cli command "en"
action 2.0 cli command "config ter"
action 3.0 cli command "int s1/0"
action 4.0 cli command "shut"
-----------------------定义一旦F0/0可用了,S1/0也会自动激活---
event manager applet track_3
event syslog pattern " Interface FastEthernet0/0, changed state to up"
action 10.0 cli command "en"
action 11.0 cli command "config ter"
action 12.0 cli command "int s1/0"
action 13.0 cli command "no shut" |