Static route configuration with Track

Static route configuration with Track




R1:-

interface FastEthernet0/0
 ip address
12.12.12.1 255.255.255.0
no shut

ip route 0.0.0.0 0.0.0.0 12.12.12.2 track 10

ip sla 10
 icmp-echo
12.12.12.2
ip sla schedule 10 life forever start-time now


track 10 ip sla 10 reachability

R2:-

interface FastEthernet0/0
 ip address
12.12.12.2 255.255.255.0
no shut

verification:-

R1# show track 10
Track 10
  IP SLA 10
reachability
  Reachability is
Up
    4 changes, last
change 00:02:43
  Latest operation
return code: OK
  Latest RTT
(millisecs) 18
  Tracked by:
   
STATIC-IP-ROUTING 0
R1#

R1#sh ip sla statistics

Round Trip Time (RTT) for       Index 10
Type of operation: icmp-echo

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
       + –
replicated route, % – next hop override

Gateway of last resort is 12.12.12.2 to network 0.0.0.0

S*    0.0.0.0/0
[1/0] via 12.12.12.2
      12.0.0.0/8 is variably subnetted, 2 subnets,
2 masks
C       
12.12.12.0/24 is directly connected, FastEthernet0/0
L       
12.12.12.1/32 is directly connected, FastEthernet0/0
R1#
        Latest RTT:
32 ms
Latest operation start time: *14:58:56.863 UTC Sat Apr 1
2017
Latest operation return code: OK
Number of successes: 5
Number of failures: 3
Operation time to live: Forever

R1#sh ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
  Known via
“static”, distance 1, metric 0, candidate default path
  Routing
Descriptor Blocks:
  * 12.12.12.2
      Route metric
is 0, traffic share count is 1
R1#

Test1:- Remove Ip from R2

R2(config)#int fa0/0
R2(config-if)#no ip add
R2(config-if)#

Verification:-


R1# show track 10
*Apr  1
15:01:04.151: %TRACKING-5-STATE: 10 ip sla 10 reachability Up->Down
R1# show track 10
Track 10
  IP SLA 10
reachability
  Reachability is
Down
    5 changes, last
change 00:00:10
  Latest operation
return code: Timeout
  Tracked by:

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
       + –
replicated route, % – next hop override

Gateway of last resort is not set

      12.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
12.12.12.0/24 is directly connected, FastEthernet0/0
L       
12.12.12.1/32 is directly connected, FastEthernet0/0


R1#