Hot Standby Routing Protocol or HSRP is a Cisco’s proprietary Layer 2 method of providing high network availability by providing redundancy for IP hosts on an IEEE 802 LAN configured with a default gateway address. HSRP routes IP traffic without relying on the availability of any single router. It enables a set of router interfaces to work together to present the appearance of a single virtual router or default gateway to the hosts on a LAN. When HSRP is configured on a network or segment, it provides a virtual Media Access Control (MAC) address and an IP address that is shared among a group of configured routers.

HSRP RFC

HSRP States

  1. Disable
  2. Init
  3. Listen
  4. Speak
  5. Standby
  6. Active

HSRP Features

  • Virtual IP address
  • Standby routers listen for hello messages from the Active router
  • Highest priority wins range 1 – 255 the default is 100
  • Interface tracking local router decrease its priority when tracking objects
  • Up to 255 HSRP Groups
  • Virtual MAC: 0000.0C17.ACXX where XX is the HSRP Group
  • Virtual IP address must be unique and part of the same subnet
  • Clear text MD5 authentication

Multicast

  • Hello message every 3 seconds
  • Dead Interval at 10
  • Address = 224.0.0.2
  • UDP Port = 1985

Standby Tracking

  • Default decrement value = 10
  • Default standby priority = 100

Load balancing with MHSRP

Using MHSRP allows for multiple groups or grouping of Routers that can be used for load balancing between the groups. This is something similar to Gateway Load Balancing but not really. It requires two separate DHCP configuration for the Clients and static Host must be configured with the correct MHSRP Group.

Group Addressing

When you configure a group of Routers as part of an HSRP group, they listen for the HSRP MAC address for that group as well as their own burned-in MAC address. I always thought that what was actually happening is IGMP join messages were being exchanged between the Routers, but that’s not the case. Whats actually happening when you configure two or more routers to be part of an HSRP group is that they actually listen for the HSRP MAC address for that group as well as their own burned in MAC address.

Election

The Router with the highest configured priority wins the election. If all Routers are using their default priority of 100 then the Router with the highest configured IP address will win the election.

Lets get started by configuring R1 Ethernet Interface and enabling HSRP

R1#configure terminal
R1(config)#interface FastEthernet0/0
R1(config-if)#ip address 192.168.254.2 255.255.255.0
R1(config-if)#duplex full
R1(config-if)#speed 100
R1(config-if)#standby 1 ip 192.168.254.1
R1(config-if)#standby 1 preempt delay minimum 2
R1(config-if)#standby 1 track Serial0/0
R1(config-if)#exit
R1(config)#
R1#

Lets take a brief look at the HSRP status on Router R1

R1#show standby brief

Interface Grp Prio P State  Active Standby       Virtual IP
Fa0/0     1   100  P Active local  192.168.254.2 192.168.254.1

Lets get HSRP up and running on Router R2

R2#configure terminal
R2(config)#interface FastEthernet0/0
R2(config-if)#ip address 192.168.254.3 255.255.255.0
R2(config-if)#duplex full
R2(config-if)#speed 100
R2(config-if)#standby 1 ip 192.168.254.1
R2(config-if)#standby 1 priority 99
R2(config-if)#standby 1 preempt delay minimum 2
R2(config-if)#standby 1 track Serial0/0
R2(config-if)#exit
R2(config)#exit
R2#

Lets take a brief look at the HSRP status on Router R2

R2#show standby brief

Interface  Grp   Prio  P  State     Active                Standby    Virtual IP
Fa0/0       1       99    P  Active   192.168.254.2    local         192.168.254.1

Lets get Router R3 up and running along with HSRP

R3#configure terminal
R3(config)#interface FastEthernet0/0
R3(config-if)#ip address 192.168.254.4 255.255.255.0
R3(config-if)#duplex full
R3(config-if)#speed 100
R3(config-if)#standby 1 ip 192.168.254.1
R3(config-if)#standby 1 priority 98
R3(config-if)#standby 1 preempt delay minimum 2
R3(config-if)#standby 1 track Serial0/0
R3(config-if)#exit
R3(config)#exit
R3#

Now that HSRP is up and running on Router R3 lets take a brief look

R3#show standby brief

Interface Grp Prio P State  Active         Standby Virtual IP
Fa0/0     1   98   P Active 192.168.254.2  local   192.168.254.1

Interface Tracking

As you can see all three Routers are tracking their respective Serial Interface toward the ISP. Lets shutdown the Serial Interfaces down on one of the Router and see what happens with the priority. I’m using the default decrement value of 10 throughout the configurations. This default value of 10 can be changed as follows.

R1#debug standby events
HSRP Events debugging is on
R1#

Now that we have HSRP debugging enabled or R1 lets shutdown the Serial interface.

R1#configure terminal
R1(config)#interface s0/0
R1(config-if)#shutdown
R1(config-if)#exit
R1#
*Mar %LINK-5-CHANGED: Interface Serial1/0, changed state to down
*Mar %LINEPROTO-5-UPDOWN: Line protocol on Serial1/0, changed state to down
*Mar  HSRP: Fa0/0 API arp proto filter, 0000.0c07.ac01 is active vMAC for grp 1 - filter
*Mar HSRP: Fa0/0 Grp 1 Active: j/Coup rcvd from higher pri router (99/192.168.254.3)
*Mar HSRP: Fa0/0 Grp 1 Active router is 192.168.254.3, was local
*Mar HSRP: Fa0/0 Grp 1 Standby router is unknown, was 192.168.254.3
*Mar HSRP: Fa0/0 Grp 1 Active -> Speak
*Mar %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Active -> Speak

Example: standby track serial0/0 x where x is the new decrement value

Possible Failure Scenarios

  • If R1’s Serial interface were to fail R1’s new priority would be 100 – 10 = 90
  • If R2’s Serial interface were to fail R2’s new priority would be 99 – 10 = 89
  • If R3’s Serial interface were to fail R3’s new priority would be 98 – 10 = 88

All three Routers have been configured with preemptions. This basically means that in the event of an interface failure and subsequent recovery the Router in questions would retain its original position based on its respective priority.

R1#show standby brief

Interface Grp Prio P State  Active  Standby       Virtual IP
Fa0/0     1   100  P Active local   192.168.254.2 192.168.254.1

We can see the R1 currently has a priority of 100. Lets enable HSRP debugging

R1#show standby brief

Interface Grp Prio P State  Active        Standby       Virtual IP
Fa0/0     1   90   P Active 192.168.254.3 192.168.254.2 192.168.254.1

I hope you found this post on HSRP helpful and informative. Be sure to let me know what you think by leaving suggestions, and feedback in the comments section below. You can find out more about these and other articles be checking out recent posts and archives. To learn more about me be sure to check out the About page. And as always thanks again for visiting The Packet.