HSRP and Object Tracking

In this post an example of HSRP in conjunction with object-tracking. For this post I used the same diagram as I used in some of the previous MPLS posts, the only difference here is that I placed a switch between router R13 and the PE router R3.

As you can see in the network diagram below we configured HSRP between router R13 and router R6. The way it is configured now the HSRP process tracks the router’s FastEthernet links towards the PE routers. But what will happen if for example not the Fa1/0 link of router R13 fails but interface Fa0/1 of Switch 1 will fail?

HSRP


Configuration of HSRP between router R13 and router R6 :

R6 :


interface FastEthernet0/0
 ip address 150.1.61.6 255.255.255.0
 speed auto
 full-duplex
 standby 1 ip 150.1.61.1
 standby 1 priority 95
 standby 1 preempt
 standby 1 track FastEthernet1/0
end
    

R13 :


interface FastEthernet0/0
 ip address 150.1.61.13 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 150.1.61.1
 standby 1 preempt
 standby 1 track FastEthernet1/0
end
    

Let’s shut down the Fa0/1 interface on Switch 1 :

Switch 1 :


Switch_1(config)#int fa0/1
Switch_1(config-if)#shut
Switch_1(config-if)#
    

Now let’s see if router R13 is still the active HSRP router :

R13 :


R13#sh standby
FastEthernet0/0 - Group 1
  State is Active
    2 state changes, last state change 00:02:30
  Virtual IP address is 150.1.61.1
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.916 secs
  Preemption enabled
  Active router is local
  Standby router is 150.1.61.6, priority 95 (expires in 7.980 sec)
  Priority 100 (default 100)
    Track interface FastEthernet1/0 state Up decrement 10
  IP redundancy name is "hsrp-Fa0/0-1" (default)
    

As you can see router R13 is still the active HSRP router because nothing happens to the tracked interface. This is a situation you don’t want in your network. The way we can change this is to track the connectivity to an ip-address. See below the configuration of “ip sla” to check reachability to the ip-address 150.1.31.3 of the PE router.

Below the configuration on router R13 :

R13 :


ip sla monitor 2
 type echo protocol ipIcmpEcho 150.1.31.3
 frequency 5
ip sla monitor schedule 2 start-time now
!
track 10 rtr 2
!
interface FastEthernet0/0
 ip address 150.1.61.13 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 150.1.61.1
 standby 1 preempt
 standby 1 track FastEthernet1/0
 standby 1 track 10 decrement 50
    

Now let’s shut the Fa0/1 interface of Switch 1 down once again and see what will happen to the HSRP process between router R13 and router R6.

Switch 1 :


Switch_1(config-if)#shut
Switch_1(config-if)#
    

Now let’s see what happens on router R13 :

R13 :


R13#
*Mar  1 00:16:22.767: %HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak
R13#sh standby
FastEthernet0/0 - Group 1
  State is Standby
    7 state changes, last state change 00:00:03
  Virtual IP address is 150.1.61.1
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.072 secs
  Preemption enabled
  Active router is 150.1.61.6, priority 95 (expires in 8.180 sec)
  Standby router is local
  Priority 50 (default 100)
    Track interface FastEthernet1/0 state Up decrement 10
    Track object 10 state Down decrement 50
  IP redundancy name is "hsrp-Fa0/0-1" (default)
    

As you can see, because router R13 cannot reach ip-address 150.1.31.3 router R13 decrements 50 and router R6 becomes the active HSRP router.

Now let’s enable the Fa0/1 interface on Switch 1 again :

R13 :


R13#
*Mar  1 00:14:53.963: %BGP-5-ADJCHANGE: neighbor 150.1.31.3 Up
*Mar  1 00:14:58.735: %HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active
R13#sh standby
FastEthernet0/0 - Group 1
  State is Active
    5 state changes, last state change 00:00:21
  Virtual IP address is 150.1.61.1
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.196 secs
  Preemption enabled
  Active router is local
  Standby router is 150.1.61.6, priority 95 (expires in 7.212 sec)
  Priority 100 (default 100)
    Track interface FastEthernet1/0 state Up decrement 10
    Track object 10 state Up decrement 50
  IP redundancy name is "hsrp-Fa0/0-1" (default)
    

Leave a comment

Your comment