4.4 Configure and verify IP SLA
ENCOR 350-401 v1.2 · 4.0 Network Assurance
IP SLA makes a router send test traffic itself (pings, UDP jitter probes, HTTP or DNS requests) and measure the answer: reachability, round-trip time, loss and jitter. Its real power is the link to object tracking: a static route, an HSRP priority or a policy can depend on whether a probe through the path still succeeds, so failover happens when the ISP fails, not only when the cable does.
What you must know
- Configure an ICMP echo probe with a source interface, frequency and timeout, and schedule it.
- Know which operations need
ip sla responderon the far end. - Tie a probe to a track object, with delay to avoid flapping.
- Make a static default route depend on the track, with a floating backup.
- Read
show ip sla statisticsandshow track.
Probes
Each IP SLA operation has a type and a target. icmp-echo needs nothing on the far end. udp-jitter measures delay, jitter and loss in each direction for voice and needs ip sla responder on a Cisco device at the far end. Others include udp-echo, tcp-connect, http and dns.
ip sla 1
icmp-echo 192.0.2.53 source-interface GigabitEthernet0/0
frequency 10
timeout 2000
threshold 1000
ip sla schedule 1 life forever start-time nowTracking and failover
A track object turns the probe's result into up or down. reachability is up while the probe gets answers (even slow ones); state is up only while the return code is OK, so an answer above the threshold counts as down. Add delay so a single lost ping does not move traffic.
track 1 ip sla 1 reachability
delay down 10 up 30
!
ip route 0.0.0.0 0.0.0.0 203.0.113.1 track 1
ip route 0.0.0.0 0.0.0.0 198.51.100.1 5
ip route 192.0.2.53 255.255.255.255 203.0.113.1While the target answers through ISP A (1), the tracked route is in the table. When ISP A's network fails, the probe times out, track 1 goes down after the delay, the tracked route is removed and traffic takes the AD 5 route to ISP B (2). The host route keeps the probe itself on ISP A, so it notices when ISP A recovers.
The same track object can drive HSRP (standby 1 track 1 decrement 20), so a distribution switch whose upstream path fails hands the gateway role to its peer.
Commands
show ip sla configuration 1 | The operation's type, target, frequency, timeout and threshold. |
show ip sla statistics 1 | The latest result: return code (OK, Timeout, Over threshold), RTT and success and failure counts. |
show track 1 | The track's state, how many times it changed, and which routes or groups use it. |
show ip route static | Whether the tracked route or the floating route is installed. |
ip sla responder | On the far device: answers udp-jitter and similar probes. |
Exam traps
- An IP SLA operation does nothing until it is scheduled (
ip sla schedule … start-time now). - The threshold must not be larger than the timeout.
- Without a host route or source interface pinned to the primary path, the probe follows the backup after failover and the primary never comes back.
reachabilityignores the threshold;statetreats over-threshold as down.- udp-jitter needs
ip sla responderon the target; icmp-echo does not.
Check yourself
- You configured
ip sla 1butshow ip sla statisticsshows no results. What is missing? ip sla schedule 1 life forever start-time now.- Why add a host route for the probe target via ISP A?
- So the probe always tests ISP A. Otherwise, once the default route moves to ISP B, the probe succeeds through ISP B and the primary route comes back while ISP A is still down.
- Which tracking type counts a slow (over-threshold) answer as down?
track … ip sla … state.- Which probe type needs a responder on the far end?
- udp-jitter (and other UDP operations to Cisco targets):
ip sla responderon that device.
Labs
Try it live: HSRPv2 with object tracking and IP SLA