Cisco IOS IP SLA Configuration: ICMP Echo and Track Objects - 夜莺博客

Cisco IOS IP SLA Configuration: ICMP Echo and Track Objects

When your primary WAN link goes down at the ISP side, a plain static default route keeps sending traffic into a black hole because the local interface never goes down. Cisco IOS IP SLA solves this by generating real probes - ICMP echo, UDP jitter, TCP connect - and feeding the results into track objects that can pull down a static route and trigger a backup link. This guide shows the complete IP SLA workflow on IOS/IOS-XE: define the probe, schedule it, track it, and use it for static route failover.

IP SLA ICMP Echo Operation Basics

An ICMP echo operation measures end-to-end response time between the router and any IP device. No responder is needed on the destination - a normal ping target such as the ISP next-hop works. Operations are numbered, defined in ip sla configuration mode, and must be explicitly started with ip sla schedule.

Configuring a Basic ICMP Echo Probe

R1(config)# ip sla 1
R1(config-ip-sla)# icmp-echo 2.2.2.2 source-interface FastEthernet0/0
R1(config-ip-sla-echo)# timeout 1000
R1(config-ip-sla-echo)# threshold 2
R1(config-ip-sla-echo)# frequency 3
R1(config-ip-sla-echo)# exit
R1(config)# ip sla schedule 1 life forever start-time now

The probe sends an ICMP echo to 2.2.2.2 every 3 seconds (frequency), waits 1000 ms (timeout) and records a reaction when the RTT exceeds 2 ms (threshold).

Tracking the Probe with a Track Object

Create a track object that follows the probe state, then tie your default route to it:

R1(config)# track 1 ip sla 1 reachability
R1(config-track)# exit
R1(config)# ip route 0.0.0.0 0.0.0.0 2.2.2.1 track 1
R1(config)# ip route 0.0.0.0 0.0.0.0 3.3.3.1 10

While the probe answers, track 1 is up and the primary route (metric 1) is installed. When the ISP link dies at the far end, the track goes down, the primary route is removed from the RIB, and the floating backup route (metric 10) takes over. You can also use track 1 ip sla 1 state for stricter state tracking.

Verification Commands

R1# show ip sla configuration
R1# show ip sla statistics
R1# show track
R1# show ip route 0.0.0.0

In show track, look for Reachability is Up/Down and the latest operation return code. Other useful operation types include udp-jitter for voice-quality measurement and tcp-connect for application reachability.

Related Guides on This Site

IP SLA often drives HSRP failover decisions - see Cisco HSRP with priority, preempt and track, or trigger actions on probe failure with Cisco EEM applets. For Linux equivalents see Keepalived VRRP failover setup.

原文链接:https://networklessons.com/ip-services/ip-sla-service-level-agreement-on-cisco-ios