top of page

HSRP IP Route Tracking

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:

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 shutdownR2
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.0R4
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 preemptR3
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:

Lets Connect The World

Subscribe to CCIE topics

Mohammed Anwarul Islam

bottom of page