Using IP SLA Monitor with Cisco EEM
Here is a handy way to use EEM to failover to a second ISP – use with a route-map:
Cisco EEM configuration:
event manager applet BGP_ISP_DOWN
event track 1 state down
action 1.0 cli command “enable”
action 1.1 cli command “conf t”
action 1.2 cli command “no ip prefix-list own-prefix seq 10 permit 10.10.10.0/24”
action 1.3 cli command “ip prefix-list own-prefix-backup seq 15 permit 10.10.10.0/24”
action 1.4 syslog msg “BGP peer ISP1 down 10.10.10.0/24 now through ISP2”
IP SLA Configuration:
ip sla 1
icmp-echo x.x.x.x source-interface GigabitEthernet0/1.101
timeout 15000
frequency 15
ip sla schedule 1 life forever start-time now
!
track 1 rtr 1
track 2 rtr 2
track 2 list boolean or
object 1
object 2
event manager applet BGP_ISP_DOWN
event track 3 state down
—-
IP SLA for multiple hosts:
Multiple objects can also be tracked by means of a list, using a flexible method for combining objects with Boolean logic. This functionality includes:
– Boolean AND function—When a tracked list has been assigned a Boolean AND function, each object defined within a subset must be in an up state, so that the tracked object can also be in the up state.
– Boolean OR function—When the tracked list has been assigned a Boolean OR function, it means that at least one object defined within a subset must also be in an up state, so that the tracked object can also be in the up state.
If you need both hosts down for the tracked object to be down then you need a boolean OR because if you take the truth table for AND it is:
1 and 1 = 1
1 and 0 = 0
0 and 1 = 0
0 and 0 = 0
But the OR is:
1 or 1 = 1
1 or 0 = 1
0 or 1 = 1
0 or 0 = 0