One of my readers has asked an interesting question: can you reload a router when pinging a specific IP address from it fails? While there are other ways of dealing with stuck interfaces or routing processes, sometimes such a drastic measure is the only workaround, so here's how you do it:
- Configure an IP SLA measurement (you'll find the necessary commands in the Not-so-Very-Static Routes section of my IP Corner article Small Site Multihoming). You might want to use the after parameter in the ip sla schedule command to ensure the router does not get reloaded immediately after the startup due to IP routing table not being populated.
- Configure a tracked object based on the IP SLA measurement with the track object-id rtr sla-id reachability command
- Configure an EEM applet that will reload the router if the tracked object enters the down state
event manager applet PingHasFailedNote: this article is part of You've asked for it series.
event track 100 state down
action 1.0 syslog msg "Ping has failed, reloading the router"
action 2.0 reload