IP SLA is a feature that allows a router to track whether or not there is a failure in the Layer 1 network along the path to the destination. Once a failure in the Layer 1 network is discovered, the route will be removed from the routing table:
For example:
Here is the problem:
Since R1 and R3 are on the same layer 2 segment but not on the same physical network, R1 will not remove it's route to R3's loopback network when there is a failure in the Layer 1 network segment. In other words, R1 has no way of knowing if 13.13.13.3 is available. The result of this situation is that if R1's link to 13.13.13.3 is down, traffice between the Loopbacks of R1 and R3 will be dropped.
Configuration:
R1:
ip route 3.3.3.0 255.255.255.0 13.13.13.3
R3:
ip route 1.1.1.0 255.255.255.0 13.13.13.1
R1# show ip route
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
S 3.3.3.0 [1/0] via 13.13.13.3
13.0.0.0/24 is subnetted, 1 subnets
C 13.13.13.0 is directly connected, FastEthernet0/0
R1#show ip route 3.3.3.3
Routing entry for
3.3.3.0/24
Known via "static", distance 1, metric 0
Routing Descriptor Blocks:
*
13.13.13.3
Route metric is 0, traffic share count is 1
We have connectivity from R1's Loopback to R3's Loopback:
R1#ping 3.3.3.3 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/32/44 ms
After Shutting down Switch FastEthernet 0/1 Interface:
Now on the Switch, I will shut down interface fastethernet 0/1 that connects to R1.
Sw(config-if)#int fa1/0
Sw(config-if)#shut
Notice that the route to R3 Loopback is still in the routing table. It didn't get removed!
R1#show ip route 3.3.3.3
Routing entry for
3.3.3.0/24
Known via "static", distance 1, metric 0
Routing Descriptor Blocks:
*
13.13.13.3
Route metric is 0, traffic share count is 1
The interface is UP/UP:
R1#show ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 13.13.13.1 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
Loopback0 1.1.1.1 YES manual up
If I ping R3's Loopback:
R1#ping 3.3.3.3 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
.....
Success rate is 0 percent (0/5)
Let's configure IP SLA:
R1(config)#ip sla 1
R1(config-ip-sla)#icmp-echo 13.13.13.3 source-interface fa0/0
R1(config-ip-sla-echo)#frequency 5
R1(config-ip-sla-echo)#timeout 200
R1(config)#ip sla schedule 1 life forever start-time now
Verify:
R1#show ip sla statistics 1
Round Trip Time (RTT) for Index 1
Latest RTT: NoConnection/Busy/Timeout
Latest operation start time: *00:17:25.351 UTC Fri Mar 1 2002
Latest operation return code: Timeout
Number of successes: 0
Number of failures: 6
Operation time to live: Forever
Now configure tracking that watches the IP SLA instance.
R1(config)#track 1 rtr 1
R1(config)#no ip route 3.3.3.0 255.255.255.0 13.13.13.3
R1(config)#ip route 3.3.3.0 255.255.255.0 13.13.13.3 track 1
Verify:
R1#show track 1
Track 1
Response Time Reporter 1 state
State is Down
1 change, last change 00:01:04
Latest operation return code: Timeout
Tracked by:
STATIC-IP-ROUTING 0
Now the route to R3's Loopback has been uninstalled.
R1#show ip route 3.3.3.3
% Network not in table