IP SLA tracking

Posted: February 12, 2016 in CISCO

IP SLA generates packets that can be used to  check route availability,and if it fails,we can define and configure specific actions.

Untitled

In this example,we’ll monitor link between R1 and ISP1_DNS_SERVER  and between R1 and web_server.If link between R1 and ISP1_DNS1_SERVER  fails,SLA will detect these changes and it will set new static route to point to R3 router.

R2:

!
interface FastEthernet0/0
ip address 209.165.201.31 255.255.255.0
duplex full
!
interface Serial1/0
ip address 209.165.200.225 255.255.255.252
serial restart-delay 0
!
interface Serial1/1
ip address 209.165.202.1 255.255.255.252
serial restart-delay 0
!
interface Serial1/2
ip address 209.165.100.1 255.255.255.0
shutdown
serial restart-delay 0
!
router eigrp 1
network 209.165.0.0 0.0.255.255
!

R3:

!
interface FastEthernet0/0
ip address 209.165.203.157 255.255.255.0
duplex full
!
interface Serial1/0
ip address 209.165.200.226 255.255.255.252
serial restart-delay 0
!
interface Serial1/1
ip address 209.165.202.129 255.255.255.252
serial restart-delay 0
!
interface Serial1/3
ip address 209.165.110.251 255.255.255.0
serial restart-delay 0
!
router eigrp 1
network 209.165.0.0 0.0.255.255

R4:

!
interface FastEthernet0/0
ip address 209.165.200.253 255.255.255.0
duplex full
!
interface Serial1/2
ip address 209.165.100.254 255.255.255.0
serial restart-delay 0
!
interface Serial1/3
ip address 209.165.110.254 255.255.255.0
serial restart-delay 0
!
router eigrp 1
network 209.165.0.0 0.0.255.255

Configuring IP SLA

IP SLA will be configured to ping a  IP address on the R2’s s1/1 interface,every 10 seconds (frequency 10).The probe will start now and it will run forever

 

!11 is only locally significant
R1(config)# ip sla 11
ping R2's s1/1 interface
R1(config-ip-sla)# icmp-echo 209.165.201.30
run every 10 seconds
R1(config-ip-sla-echo)# frequency 10
R1(config-ip-sla-echo)# exit
!start now and run forever
R1(config)# ip sla schedule 11 life forever start-time now

Create a second probe to test connectivity between R1 and web_server (209.165.200.254)

R1(config)# ip sla 22
R1(config-ip-sla)# icmp-echo 209.165.200.254
R1(config-ip-sla-echo)# frequency 10
R1(config-ip-sla-echo)# exit
R1(config)# ip sla schedule 22 life forever start-time now

Create static routes which will be used/deleted based on success or failures of IP SLA probes and assign

!route to R2's s1/1 AD 2
R1(config)# ip route 0.0.0.0 0.0.0.0 209.165.202.1 2
!route to R3's s1/1 AD 3
R1(config)# ip route 0.0.0.0 0.0.0.0 209.165.202.129 3

Because AD of 2 209.165.202.1 is default route

R1(config)#do sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default, U – per-user static route
o – ODR, P – periodic downloaded static route, H – NHRP, l – LISP
+ – replicated route, % – next hop override

Gateway of last resort is 209.165.202.1 to network 0.0.0.0

S*    0.0.0.0/0 [2/0] via 209.165.202.1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Loopback0
L        192.168.1.1/32 is directly connected, Loopback0
D     209.165.110.0/24 [90/2681856] via 209.165.202.129, 00:23:42, Serial1/1
209.165.200.0/24 is variably subnetted, 2 subnets, 2 masks
D        209.165.200.0/24
[90/2684416] via 209.165.202.129, 00:23:42, Serial1/1
D        209.165.200.224/30
[90/2681856] via 209.165.202.129, 00:23:42, Serial1/1
[90/2681856] via 209.165.202.1, 00:23:42, Serial1/0

 

Define an object that tracks the SLA probe:

!track the state of the IP SLA operation
R1(config)#track 1 ip sla 11 reachability
!down delay 10 seconds and 1 second of UP delay
!if destination (209.165.201.30) fails immediately
!and comes back in 10 seconds,no impact
R1(config-track)#delay down 10 up 1
R1(config)# track 2 ip sla 22 reachability
R1(config-track)#delay down 10 up 1

Add the track statement to the default routes

!route to R2's s1/1 AD 2
R1(config)# ip route 0.0.0.0 0.0.0.0 209.165.202.1 2 track 11
route to R3's s1/1 AD 3
R1(config)# ip route 0.0.0.0 0.0.0.0 209.165.202.129 3 track 22
R1(config)#do debug ip routing

Simulate R1-ISP1_DNS_SERVER link failure by shutting down R2’s f0/0 interface

R1(config)#
*Feb 12 22:39:59.599: RT: delete route to 209.165.201.0 via 209.165.202.1, eigrp metric [90/2172416]
*Feb 12 22:39:59.599: RT: no routes to 209.165.201.0, delayed flush
*Feb 12 22:39:59.603: RT: delete network route to 209.165.201.0/24
*Feb 12 22:39:59.607: RT: updating eigrp 209.165.201.0/24 (0x0):
via 209.165.202.1 Se1/0  1048578

*Feb 12 22:39:59.611: RT: rib update return code: 5
*Feb 12 22:39:59.615: RT: updating eigrp 209.165.201.0/24 (0x0):
via 209.165.202.129 Se1/1  1048578

*Feb 12 22:39:59.619: RT: rib update return code: 5
R1(config)#
*Feb 12 22:40:15.795: %TRACKING-5-STATE: 1 ip sla 11 reachability Up->Down
*Feb 12 22:40:15.799: RT: del 0.0.0.0 via 209.165.202.1, static metric [2/0]
*Feb 12 22:40:15.799: RT: delete network route to 0.0.0.0/0
*Feb 12 22:40:15.803: RT: default path has been cleared
*Feb 12 22:40:15.807: RT: updating static 0.0.0.0/0 (0x0):
via 209.165.202.129   1048578

*Feb 12 22:40:15.811: RT: add 0.0.0.0/0 via 209.165.202.129, static metric [3/0]
*Feb 12 22:40:15.815: RT: default path is now 0.0.0.0 via 209.165.202.129
*Feb 12 22:40:15.819: RT: updating static 0.0.0.0/0 (0x0):

Tracking changes 1 changes tracking states from up to down,deletes default route

0.0.0.0 0.0.0.0 209.165.202.1,and shortly adds new default route 0.0.0.0 0.0.0.0 209.165.202.129

R1#
*Feb 12 22:40:34.871: %SYS-5-CONFIG_I: Configured from console by console
R1#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M – mobile, B – BGP
D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
E1 – OSPF external type 1, E2 – OSPF external type 2
i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
ia – IS-IS inter area, * – candidate default, U – per-user static route
o – ODR, P – periodic downloaded static route, H – NHRP, l – LISP
+ – replicated route, % – next hop override

Gateway of last resort is 209.165.202.129 to network 0.0.0.0

S*    0.0.0.0/0 [3/0] via 209.165.202.129
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Loopback0
L        192.168.1.1/32 is directly connected, Loopback0
D     209.165.110.0/24 [90/2681856] via 209.165.202.129, 00:44:06, Serial1/1
209.165.200.0/24 is variably subnetted, 2 subnets, 2 masks
D        209.165.200.0/24
[90/2684416] via 209.165.202.129, 00:44:06, Serial1/1
D        209.165.200.224/30
[90/2681856] via 209.165.202.129, 00:44:06, Serial1/1
[90/2681856] via 209.165.202.1, 00:44:06, Serial1/0

R1#trace 209.165.200.254
Type escape sequence to abort.
Tracing the route to 209.165.200.254
VRF info: (vrf in name/id, vrf out name/id)
1 209.165.202.129 132 msec 96 msec 8 msec
2 209.165.110.254 168 msec 100 msec 208 msec
3 209.165.200.254 96 msec 88 msec 96 msec

 

R1#sh ip sla stat
IPSLAs Latest Operation Statistics

IPSLA operation id: 11
Latest RTT: NoConnection/Busy/Timeout
Latest operation start time: 22:48:03 UTC Fri Feb 12 2016
Latest operation return code: Timeout
Number of successes: 116
Number of failures: 67
Operation time to live: Forever

IPSLA operation id: 22
Latest RTT: 72 milliseconds
Latest operation start time: 22:48:00 UTC Fri Feb 12 2016
Latest operation return code: OK
Number of successes: 19
Number of failures: 0
Operation time to live: Forever

Note that IP SLA 11 last return code is Timeout (R1-ISP1_DNS1_SERVER) and

IP SLA 22 returns OK (R1-web_server)

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s