Free tech learning for everyone, from basics to pro

Routing & SwitchingNetworking SecurityIntermediate

IP SLA and object tracking on Cisco IOS: failover when the internet, not the cable, breaks

In short: A static default route stays in the table as long as its exit interface is up, even if the ISP is broken further along. IP SLA sends regular test packets, a track object turns the result into up or down, and static routes or HSRP priorities can then follow that state. This gives clean failover to a backup link.

Why the interface status is not enough

Imagine a branch with a fibre internet line and a 4G backup. The primary default route points at the ISP router. One morning the ISP's upstream fails. Your Ethernet link to the ISP router is still up, so the static route stays in the table and every packet disappears into a black hole. The backup link never takes over because nothing told the router there was a problem.

Tracking a real path, not just an interfaceIP SLA probeping 8.8.8.8 every5 sTrack objectup or downStatic routeinstalled only ifupBackup routefloats in onfailure
Figure 1. The probe tests reachability beyond the next hop, and the static route follows the result.

Step 1: create the probe

ip sla 10
 icmp-echo 8.8.8.8 source-interface GigabitEthernet0/0
 frequency 5
 threshold 1000
 timeout 1000
ip sla schedule 10 life forever start-time now

The router pings 8.8.8.8 every five seconds out of the primary link. Pick a target that is stable and outside your ISP's first router, such as a public DNS server or your own server in the data centre. Using two probes to two different targets and combining them avoids a false failover when one target has a bad day.

Step 2: track the probe

track 10 ip sla 10 reachability
 delay down 15 up 60

The delay settings stop flapping. The track only goes down after 15 seconds of failure, and only comes back up after 60 seconds of success, so a single lost ping does not bounce your users between links.

Step 3: tie the route to the track

ip route 0.0.0.0 0.0.0.0 203.0.113.1 track 10
ip route 0.0.0.0 0.0.0.0 Cellular0/2/0 250
! Make sure the probe itself always uses the primary link
ip route 8.8.8.8 255.255.255.255 203.0.113.1

The host route for 8.8.8.8 is important. Without it, once the primary default route is removed the probe would leave through the 4G link, succeed, and bring the primary back up, creating a loop of failovers.

Other things you can track

  • HSRP or VRRP priority: standby 1 track 10 decrement 30 makes the router hand over the gateway role when its path fails.
  • Policy-based routing: set ip next-hop verify-availability 203.0.113.1 1 track 10.
  • Boolean tracks: track 20 list boolean or combining two probes, so the route is only withdrawn if both targets fail.
  • EEM scripts can react to a track change by sending an alert or changing NAT.

Verification

show ip sla statistics 10 shows the latest result and counts of successes and failures. show track 10 shows the current state and how many times it changed. show ip route static confirms which default route is installed.

Real-world example: the café chain

A chain of cafés used 4G backup links that never seemed to work. Card payments failed whenever the broadband provider had an outage. The routers only had a floating static route, so the backup never activated while the Ethernet to the modem stayed up. Adding an IP SLA probe to the payment provider's address, with a 20-second down delay, made the 4G link take over automatically. The next outage went unnoticed by customers.

Practice

Why can a static default route stay in the table while the internet is down?
Static routes are only removed when the exit interface or next hop becomes unreachable locally; a failure further upstream does not affect them.
What does delay down 15 up 60 under a track object do?
It waits 15 seconds before declaring the track down and 60 seconds before declaring it up again, to prevent flapping.
Why add a host route for the probe target via the primary link?
So the probe always tests the primary path and does not succeed through the backup link after failover.

Key takeaways

  • Interface status does not show upstream failures; IP SLA tests the real path.
  • Track objects turn probe results into up or down states.
  • Static routes, HSRP and PBR can all follow a track object.
  • Use delays and a host route for the probe target to avoid flapping.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: