Home > HSRP IP Route Tracking

HSRP IP Route Tracking

May 13th, 2013 in Guide Go to comments

In this article we will discuss about HSRP and do a lab on it.

Quick reminder about HSRP

+ Hot Standby Router Protocol (HSRP) is a Cisco proprietary protocol.
+ With HSRP, two or more devices support a virtual router with a fictitious MAC address and unique IP address
+ Hosts use this IP address as their default gateway and the MAC address for the Layer 2 header
+ The virtual router’s MAC address is 0000.0c07.ACxx , in which xx is the HSRP group. Multiple groups (virtual routers) are allowed.
+ The Active router forwards traffic. The Standby router is backup and monitors periodic hellos (multicast to 224.0.0.2,
UDP port 1985) to detect a failure of the active router.
+ The active router is chosen because it has the highest HSRP priority (default priority is 100). In case of a tie, the router
with the highest configured IP address wins the election
+ A new router with a higher priority does not cause an election unless it is configured to preempt.

HSRP States

+ Initial: HSRP is not running.
+ Learn: The router does not know the virtual IP address and is waiting to hear from the active router.
+ Listen: The router knows the IP and MAC of the virtual router, but it is not the active or standby router.
+ Speak: Router sends periodic HSRP hellos and participates in the election of the active router.
+ Standby: Router monitors hellos from active router and assumes responsibility if active router fails.
+ Active:Router forwards packets on behalf of the virtual router.

Load balancing traffic across two uplinks to two HSRP routers with a single HSRP group is not possible. The trick is to use two
HSRP groups:
+ One group assigns an active router to one switch.
+ The other group assigns another active router to the other switch.

(Reference: SWITCH official Certification Guide)

That is all for the boring HSRP theory, let do a lab to understand more about HSRP! We will use the topology below for this lab:

HSRP_Tracking_Topology.jpg

IOS used: c3640-jk9s-mz.124-16.bin

Tasks in this lab:

+ Configure IP addresses as shown and run EIGRP on R2, R3, R4
+ Configure HSRP: R2 is the Active HSRP while R3 is the Standby HSRP
+ Tracking route to 4.4.4.4, traffic should goes to R3 once the route to 4.4.4.4 is lost in R2 or the metric to R4’s loopback interface increases.

IP Address and EIGRP Configuration

R1 (configured as a host)
no ip routing
ip default-gateway 123.123.123.254 //This is the virtual IP of HSRP group
interface FastEthernet0/0
ip address 123.123.123.1 255.255.255.0
no shutdown
R2
interface FastEthernet0/0
ip address 123.123.123.2 255.255.255.0
no shutdown
!
interface FastEthernet1/0
ip address 24.24.24.2 255.255.255.0
no shutdown
!
router eigrp 1
network 24.0.0.0
network 123.0.0.0
R3
interface FastEthernet0/0
ip address 123.123.123.3 255.255.255.0
no shutdown
!
interface FastEthernet1/0
ip address 34.34.34.3 255.255.255.0
no shutdown
!
router eigrp 1
network 34.0.0.0
network 123.0.0.0
R4
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface FastEthernet0/0
ip address 24.24.24.4 255.255.255.0
no shutdown
!
interface FastEthernet1/0
ip address 34.34.34.4 255.255.255.0
no shutdown
!
router eigrp 1
network 4.0.0.0
network 24.0.0.0
network 34.0.0.0

HSRP Configuration

R2
interface FastEthernet0/0
standby 10 ip 123.123.123.254
standby 10 priority 200
standby 10 preempt
R3
interface FastEthernet0/0
standby 10 ip 123.123.123.254
standby 10 priority 150
standby 10 preempt

Note: The virtual IP address of HSRP group must be in the same subnet of the IP address on this interface (Fa0/0)

After entering above commands we will see R2 takes Active state after going from Speak to Standby:

%HSRP-5-STATECHANGE: FastEthernet0/0 Grp 10 state Speak -> Standby
*Mar 1 00:10:22.487: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 10 state Standby -> Active
*Mar 1 00:10:22.871: %SYS-5-CONFIG_I: Configured from console by console

The “show standby” command on R2 confirms its state:

HSRP_Tracking_R2_show_standby.jpg

Now R2 is in HSRP Active state with virtual MAC address of 00000c07.ac0a. Notice that the last two numbers of the MAC address (0a) is the HSRP group number in hexadecimal form (0a in hexa = 10 in decimal)

The “show standby” command on R3 reveals it is in Standby state:

HSRP_Tracking_R3_show_standby.jpg

Now we will see what happens if we turn off interface Fa0/0 on R2:
R2(config)#interface fa0/0
R2(config-if)#shutdown

HSRP_Tracking_R2_show_standby_interface_down.jpg

HSRP_Tracking_R3_show_standby_interface_R2_down.jpg

As we can see, the HSRP state of R2 went back to Init while the HSRP state of R3 moved to Active.

HSRP Tracking IP Route

In this part instead of tracking an interface going up or down we can track if the metric of a route to a destination changes or not. In particular we will try to track the route to the loopback interface of R4 (4.4.4.4). First we should check the routing table of R2:

HSRP_Tracking_R2_show_ip_route.jpg

We learn that the metric to the loopback interface of R4 (4.4.4.4) is 156160 and is summarized to 4.0.0.0/8 prefix because EIGRP summarizes route by default.

Now add tracking ip routing to R2

R2(config)#track 1 ip route 4.0.0.0 255.0.0.0 metric threshold
R2(config-track)#threshold metric up 61 down 62

and on interface fa0/0 add these commands to apply the track:

R2(config)#interface fa0/0
R2(config-if)#standby 10 track 1 decrement 60

The command track ip route metric threshold is used to track the metric change of a route. For example in this case the second command threshold metric up 61 down 62 specifies the low and high thresholds.

up: Specifies the up threshold. The state is up if the scaled metric for that route is less than or equal to the up threshold. The default up threshold is 254.
down: Specifies the down threshold. The state is down if the scaled metric for that route is greater than or equal to the down threshold. The default down threshold is 255.

Then, how do we indicate the up value should be 61 and down value should be 62? This is because EIGRP routes are scaled by means of 2560 so if we divide the EIGRP metric (156160 in this case) by 2560 we will get 61 (156160 / 2560 = 61). 2560 is the default metric resolution value for EIGRP and can be modified by the track resolution command (for example: track resolution ip route eigrp 400). The table below lists the metric resolution for popular routing protocols.

Routing protocol Metric Resolution
Static 10
EIGRP 2560
OSPF 1
RIP is scaled directly to the range from 0 to 255 because its maximum metric is less than 255

In this case if the metric for route to 4.0.0.0/8 in the routing table is less than or equal to 61 then the state is up. If the metric is greater or equal to 62, the state is down. We can verify if the track is working correctly by the show track command.

HSRP_Tracking_R2_show_track.jpg

When the state is Down, R2’s priority will be deduced by 60: 200 – 60 = 140 which is less than the priority of R3 (150) -> R3 will take the Active state of R2.

HSRP_Tracking_R2_show_standby_down_state.jpg

HSRP_Tracking_R3_show_track_no_route.jpg

A very important note we wish to mention here is: the route for tracking should be exactly same as displayed in the routing table or the track would go down because no route is found. For example if we try tracking the route to the more specific route 4.4.4.0/24 or 4.4.4.4/24 the track would go down because EIGRP summarizes route by default before advertising through another major network. Let’s try this!

R2(config)#no track 1 ip route 4.0.0.0 255.0.0.0 metric threshold
R2(config)#track 1 ip route 4.4.4.0 255.255.255.0 metric threshold
R2(config-track)#threshold metric up 61 down 62

Now check if the track is working or not:

HSRP_Tracking_R2_show_track_no_route.jpg

The track on R2 goes down so R2’s priority is reduced by 60 which causes R3 takes the Active state.

In this case if we wish to bring up the track route to 4.4.4.0/24 we just need to use the “no auto-summary” command on R4 which causes R4 to advertise the more specific route of 4.4.4.0/24.

R4(config)#router eigrp 1
R4(config-router)#no auto-summary

Now R4 advertises the detailed 4.4.4.0/24 network and it matches with our tracking process so the tracking process will go up.

HSRP_Tracking_R2_show_ip_route_no_auto-summary.jpg

HSRP_Tracking_R2_show_track_no_auto-summary.jpg

The GNS3 initial and final configs can be downloaded here:

Initial Configs: http://www.networktut.com/download/HSRP_initial.zip
Final Configs: http://www.networktut.com/download/HSRP_finalConfigs.zip

(Good reference: http://www.cisco.com/en/US/docs/ios/12_2sb/feature/guide/sbaiptrk.html)

Comments (50) Comments
Comment pages
1 2 324
  1. Hoang Thinh
    May 15th, 2013

    on R 1, should type : ip default-gateway 123.123.123.254

  2. Hoang Thinh
    May 16th, 2013

    or ip route 0.0.0.0 0.0.0.0 123.123.123.254

  3. Sherif
    May 16th, 2013

    pls can anybody tell me how the questions will look like is it going to come with the diagram or just as it is on this ticket. pls reply to labite80@yahoo.com> thank you all

  4. sam
    July 5th, 2013

    It will be like ticket 2 and the rest with the layers diagrams

  5. Sarah
    July 25th, 2013

    Guys please help me out, IT IS URGENT
    Have my exam in a weeks time and I am unable to load the GNS3 lab files from here. It seems to give me the same IOS problem everyone is having. Can someone please guide me in detail as to what I should do, I really need to get it done or i will fail. Please help me ASAP.
    Waiting for your reply desperately!!!!!!!!!!

  6. Noxseii
    July 31st, 2013

    @sarah: give me your email address and I will email you some IOS’s…

  7. Ace
    August 12th, 2013

    @ Noxseii
    please e-mail me also the IOS. Thank you. ace_forgotten@yahoo.com

  8. Jezza
    August 15th, 2013

    @Noxseli @Ace @Arvind

    I solved the issue with GNS3 labs I was having. I realised that the GNS3 lab link here is to a tar file format and to open it you can use 7-Zip which can be downloaded for free. When opened with this it is in GNS3. The lab is not fully configured but you can use it to become familiar with the commands.

  9. Claux
    October 8th, 2013

    HI guys,
    I was wondering if you could send me some IOS,
    thank you very much
    claux_foru@libero.it

  10. imad
    January 10th, 2014

    digitaltut not opening admin please help

  11. angry
    January 10th, 2014

    @networktut@
    route site not working…

  12. sandeep
    January 16th, 2014

    I did take TSHOOT last week it is very easy exam in my view. But I did find a little bit confused in the end. I got 975.

  13. John Smith
    January 19th, 2014

    sandeep – January 16th, 2014

    I will be taking the TSHOOT soon. Do you think certprepare.com has all the questions and answers?

  14. fgb
    March 26th, 2014

    pls where do i find jeremy’s tshoot vedios?..plssssssssssssssss

  15. Selva
    April 6th, 2014

    Nice detailed, simple Notes

  16. Anonymous
    April 12th, 2014

    Pls help me, I need dump for this exam. Can you send for me by email hoanghuy@outlook.com ? Thank all so much.

  17. lawangeen
    April 17th, 2014

    @networktut.
    Under the screen shot 4. It says that
    “As we can see, the HSRP state of R1 went back to Init while the HSRP state of R2 moved to Active.”
    My question is that R1 must be R2 and R2 must be R3.

  18. networktut
    April 17th, 2014

    @lawangeen: Thanks for your detection. It was a typo and we have just fixed it!

  19. sami
    April 25th, 2014

    hi all
    subscribe to that channel for free
    https://www.youtube.com/watch?v=rwBAZWTFfMw
    thanks

  20. VomitosArcaz
    May 22nd, 2014

    Hi mates!!

    I want to prepare this exam and I have this dumps:

    -Cisco.Exact-Exams.642-832.v2014-01-11.by.MMFSH.238q
    -74 Cisco.ActualTests.642-832.v2013-04-29.by.Igor.70q
    -33 Cisco.Certkey.642-832.v2014-01-24.by.Toni.14q

    Which is the valid dump?

    Regards!

  21. LOLOPUTERO
    May 22nd, 2014

    74 Cisco.ActualTests.642-832.v2013-04-29.by.Igor.70q ONLY!!!

  22. Goku
    May 23rd, 2014

    for those who are having trouble loading the lab,just download this IOS

    http://www.4shared.com/file/am33ukyK/c3640-jk9s-mz124-16.html?locale=en

  23. Rob
    June 17th, 2014

    @networktut

    There seems to be an error in the mentioned default gatway for R1:

    ip default-gateway 10.2.1.254 //This is the virtual IP of HSRP group

  24. networktut
    June 18th, 2014

    @Rob: Yes, thanks for your detection. We fixed it!

  25. Chandan Jha
    June 27th, 2014

    it will helpfull

  26. Azeem
    July 23rd, 2014

    Can anyone please send me valid dums and tickets of T-shott.
    I will be really thankful to him

    Azeem@cib.gov.sa

  27. Shah Muhammad
    August 15th, 2014

    Hi VomitosArcaz May 22nd, 2014
    oh brother where are you it is old dumps dont learn form it learn latest 200-120

  28. Mohammed Talib
    September 14th, 2014

    guys , i complete preparing for exam but afraid that big change happened any one know or took exam this month

  29. g
    November 10th, 2014

    can anyone send the latest version of vce player????

    Thank you

  30. Anonymous
    November 10th, 2014

    *TSHOOT exam

  31. Romeogur
    November 13th, 2014

    Good article mate. Thanks alot.

  32. Gerrit
    December 13th, 2014

    Mohsin, all information you need for the exam is on networktut.com, you don’t need VCE for TSHOOT.

  33. Vivek
    January 1st, 2015

    Well Exaplained…Thanks

  34. Younas
    January 14th, 2015

    Really good… Thnx

  35. stringbender
    January 17th, 2015

    What a great, great website. Tells you everything you need to know for the exam and explains the concepts behind the technology as well. Don’t forget to donate after you pass your exam. I’ve never seen the ask here but they deserve it!

  36. stringbender
    January 17th, 2015

    Correction:

    I’ve never seen them ask here…….(I spell very well but my typing on this laptop sorely lacks):-)

  37. stringbender
    January 17th, 2015

    I have a question from a practical standpoint. What is the advantage of tracking the route metric over an interface. I can’t think of a scenario where it would be necessary as opposed to optional to track the metric.

  38. AQEL
    January 18th, 2015

    is this dump still valid?

    please feedback..

  39. Talha
    January 19th, 2015

    @AQEL

    Yes, its still valid. Gave the exam on the 17th and passed with 945/1000

  40. Anonymous
    January 30th, 2015

    []

    I Have cleared my EXAM today thanks to the Link [[ bc.vc/7IxVNd ]] is Very

    usefull they Providing study material and ..pdf.. etc

  41. Anonymous
    February 18th, 2015

    pass

    finally i got cleared my exams i studied with dump and exam material avaiable hear

    t h e g h i b h a @ b l o g s p o t . c o m

  42. Vitthal
    February 22nd, 2015

    Excellent explained

  43. hemanath
    February 23rd, 2015

    i have exam tomorrow can you send pdf dumpes

  44. hemanath
    February 23rd, 2015

    khemanath@yahoo.com my mail id

  45. elson
    March 17th, 2015

    why is there no config in the switch side?

  46. HisWILL
    March 24th, 2015

    I have download Cisco.Actualtests.300-115.v2014-12-19.by.Galvin.158q.
    158q (is latest?)

    What portable or other version of VCE can I use ?
    I know need to install one version, then run crack for it work wokr?

    thank you!

  47. Siaulius
    March 29th, 2015

    Could someone share latest dumps you have siaulietisss@yahoo.com Thank you in advance

  48. Patrick
    May 4th, 2015

    Thanks a lot! Very well done.

  49. Alisher
    May 25th, 2015

    Can I use “track” commands on PacketTracert? Anybody knows?

  50. Joe
    May 30th, 2015

    @Alisher:

    No, unfotunatly you can’t use the specific “track” command(s) within PacketTracer release 6.1 and the current release 6.2 too :(

    However you can always “track” a Standby Interface (Link) within both PacketTracer 6.1 and 6.2 – e.g. like this:

    standby 10 track FastEthernet0/1 – (Standby Interface Sub-command)

Comment pages
1 2 324