2

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.

Any ideas?

1
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Commented Aug 10, 2017 at 3:50

2 Answers 2

2

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.

1

That's an interesting question. Have an idea.. little bit messy, but could potentially do what you need...

  1. 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

  2. Reserve static ARP for your "floating IP" towards physical MAC address of the interface:

arp 192.0.2.1 xxxx.yyyy.zzzz arpa

  1. Create (and start) an IP SLA probe to your "floating IP":

ip sla 1 icmp-echo 192.0.2.1 threshold 2000 timeout 2000 frequency 5 ! ip sla schedule 1 life forever start-time now

  1. Create track object that tracks reachability of your IP SLA:

track 1 ip sla 1 reachability

  1. Finally create your static route tied against the track object:

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.

Regards,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.