Anyone aware of a way to tie a static route to HSRP, so that it is only advertised when the router is Active?
I cannot think of any way to do this other than via an EEM script which looks at syslog for state changes.
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.Sign up to join this community
EEM/EOT script is the right approach for this feature taken on its own. If there is a VPN involved, you could consider using reverse route injection.
That's an interesting question. Have an idea.. little bit messy, but could potentially do what you need...
Setup dummy secondary IP subnet on your HSRP group (ie. 192.0.2.0/29)
interface FastEthernet 0/1
ip address 192.0.2.2 255.255.255.248 secondary
standby X ip 192.0.2.1 secondary
Reserve static ARP for your "floating IP" towards physical MAC address of the interface:
arp 192.0.2.1 xxxx.yyyy.zzzz arpa
ip sla 1
ip sla schedule 1 life forever start-time now
track 1 ip sla 1 reachability
ip route 198.51.100.0 255.255.255.0 203.0.113.1 track 1
I haven't tested this, so give it a go and see if it works..
Intention is that when router in question becomes standby it will stop replying to icmp on active IP (and HSRP peer will also not respond due to static ARP reservation). As a result IP SLA probe will start failing and so track object will get triggered. This in turn will withdraw static route from the table..
Again this is subject to testing as I haven't tested it.