IP SLA: Configuration on Cisco Routers

ip sla-cisco-static-route
In the absence of a dynamic routing protocol, sometimes you will find your routers fail to re-route traffic when a link becomes unavailable. This is a typical problem faced by most small networks that have a router connected to a tier 3 ISP which doesn’t run a dynamic routing protocol. It’s all good if you have ensured you have multiple links to multiple ISPs ensuring redundancy is in place. But if you don’t have IP SLA configured, at some point you will be left frustrated like I was when one of the ISPs on my routers had an internal network outage.

A static route stays up until the interface goes down. That is, if the interface that is part of the same subnet as the next hop goes down, the router thinks the next hop is unavailable and therefore, marks the route down. Traffic should then simply re-route using the secondary default static route you have in place.

However, if the interface stays up but the ISP starts discarding your traffic internally, than you will simply be blackholing your own traffic! This means a network outage is on the cards.
So how can we insert some intelligence on the router itself so that it can mark a route down in a situation like this?

Cisco’s IP SLA is great feature to tackle this problem.

To configure IP SLA refer to the following configuration snippet.

Static route config:

 

The above configuration is pretty standard. It configures two static routes pointing towards two different next-hop addresses with a difference in the distance for both to ensure the route via 150.122.31.1 is always preferred.

In order to ensure our router is actively performing some sort of tracking  we have inserted the configuration command track 1.

What this would do is refer the router to look for IP SLA config and perform tracking based on that.

Refer to the IP SLA config snippet below.

IP SLA Config:

 

All the above configuration would do is keep sending ICMP requests to the next hop 8.8.8.8 every 5 seconds as defined by the frequency command.

It would wait for 2000 milliseconds to receive a response from the pinged destination.

Upon configuration of the command track 1 ip sla 1 reachability, IP SLA tracking would begin which would then record any lapses  in ping responses from 8.8.8.8. Upon a lapse, the primary static route would go down making way for the secondary route to become active.

However, the router would keep sending ICMP probes and as soon as it would receive a response, the primary static route would be re-added into the routing table. Based on our configuration, this would demote the active route with next-hop 121.221.33.9 as it’s administrative distance is configured higher at 250.

So there it is! Your guide to ensuring your routers with static configuration always have a valid path to the internet.

Got questions? Leave a comment! Let’s chat.

Rafay Rasool is a Network Specialist with over 8 years of experience designing, configuring and implementing core network solutions based predominantly but not limited to Juniper Routers, Switches and Firewalls along with other vendors such as Cisco, Huawei, Siemens, Aerohive, Ringmaster, Pulse etc for Internet Service Provider and Enterprise Networks.

Rafay is an avid supporter of network automation and likes to code and automate networking solutions.