Route selection by host reachability with Cisco SLA

Cisco’s SLA features, available in IOS other than IP Base, allow modification of the routing table based on a monitored item. In this example, we’ll monitor an Internet address, and change the default route if that address is unreachable.

In this example, I’ll use as the remote ip address. FE0/0 goes to the primary provider, FE0/1 goes to a backup connection. FE 0/0 is (gw, FE 0/1 is, (gw

First, we need to make sure the ping to goes out FE0/0 – otherwise, this may bounce around as the address becomes available over the redundant link.
ip route

Now, let’s set up our SLA. icmp-echo establishes ping, and the schedule line tells the router to run this forever. There are other methods available, too.

ip sla 1
ip sla schedule 1 life forever start-time now

Let’s be sure it’s running:

router#sh ip sla statistics
IPSLAs Latest Operation Statistics
IPSLA operation id: 1
Latest RTT: 1 milliseconds
Latest operation start time: *16:00:53.925 UTC Tue Jan 27 2009
Latest operation return code: OK
Number of successes: 33
Number of failures: 0
Operation time to live: Forever

Now that we’re SLA monitoring this address, what do we do with this information? Track is used to make things happen!
track 1 ip sla 1 reachability

While we’re at it, let’s look at the track status:
router#sh track 1
Track 1
IP SLA 1 reachability
Reachability is Up
1 change, last change 11:14:51
Latest operation return code: OK
Latest RTT (millisecs) 1
Tracked by:

Lastly, let’s set our routes to use the track:
ip route track 1
ip route 200

The first route will vary with the track state, the second is weighted so it won’t normally be used.

The Conversation

Follow the reactions below and share your own thoughts.

7 Responses to “Route selection by host reachability with Cisco SLA”

  1. February 07, 2009 at 11:45 pm, mramadan said:



  2. October 30, 2009 at 8:31 am, BLP said:

    Great! Thank you!


  3. February 26, 2010 at 10:21 am, sanjay said:

    Nice explanation


  4. March 16, 2010 at 2:25 pm, Anonymous said:

    thankss..very useful for my knowledge


  5. September 11, 2010 at 12:20 am, Woodlander said:

    Thank you. The example clarifies the concept well.


  6. October 06, 2011 at 4:13 pm, Sjaak de Vries said:

    Hi, thanks for this article. I had to make a few minor adjustments to get this running on a C3550 w/ c3550-ipservicesk9-mz.122-44.SE6. I had to use “track 1 rtr 1 reachability”, so not the “ip sla” part. Now it works like a charm :)


  7. February 28, 2012 at 1:08 am, ivica said:

    very nice, short but clear


Leave a Reply