HSRP: Hot Standby Routing Protocol

Manandhar SudipManandhar Sudip
5 min read

Basic

HSRP stands for Hot Standby Routing Protocol. It is an important Cisco proprietary protocol that provides a redundant gateway for hosts on a local subnet. However, HSRP does not provide load-balancing solutions.

HSRP allows us to configure two or more routers into a standby group that shares an IP address and a MAC address. This group provides a default gateway for hosts on the local subnet.

About Standby Group

In HSRP, there is a concept of a standby group, which contains multiple routers, including the virtual router, active router, standby router, and other routers on the network.

The virtual router is not a physical entity, but rather a virtual router with its separate IP address and MAC address. All packets are delivered to this address, and the routing is handled by the active router, which is a physical router that receives all the packets sent to the virtual router. The active router is responsible for routing packets to different networks and replying the content to local hosts.

The standby router is a backup router that immediately comes into action when the active router fails. Other routers are available on the network, which do not directly or indirectly listen to the packets sent to the virtual IP address, but do listen to the packets sent to their dedicated addresses. These routers also take part in the election process.

The standby group is required for the configuration of HSRP. This group ensures that there is a backup router available in case the active router fails, thereby providing redundancy and increasing network reliability.

Purpose of HSRP

  • HSRP is used for redundancy and fault tolerance purposes.

  • With HSRP, we can configure multiple physical routers to appear as a single logical router. This provides redundancy, so if one router fails, another standby router takes over immediately.

  • Having multiple routers in an HSRP standby group eliminates the risk of a single point of failure, ensuring high availability for network traffic.

So, how is this redundancy or fault tolerance feature accomplished?

HSRP accomplishes this by creating a virtual router that has its own IP and MAC addresses. The virtual IP address is configured on each host machine as the default gateway, while the virtual MAC address is returned when an ARP request is sent by a host.

This virtual router serves as a placeholder for multiple physical routers in the network. The hosts are not aware of the physical routers and do not care which one is actively forwarding the traffic. Instead, the redundancy protocol decides which physical router will actively forward traffic and which one will be on standby in case the active router fails.

The HSRP protocol uses a priority system to determine which router will be the active one. The router with the highest priority value will be the active router, while the other routers will remain on standby. In case the active router fails, one of the standby routers with the next highest priority value will take over as the active router.

Now the question arises: how does the standby router know whether the active router is working properly or not?

In HSRP, there is a constant message exchange between the active router, standby router, and other routers on the network, which is called the Hello Message. Hello messages provide all of the required communication for the routers, including the information required to accomplish the election that determines the active and standby router positions.

The Hello Message also holds the key to the failover process. If the standby router stops receiving Hello packets from the active router, it then takes over the active router role. As soon as the active router stops responding to Hello Messages, the standby router automatically becomes the active router and starts responding to host requests.

Interface Tracking

In HSRP, interface tracking is a feature that allows for monitoring of the interfaces on the active router. If the outside link of the active router goes down, the standby router will take over and become the active router.

This is important because it allows for faster failover and ensures that traffic is always routed correctly. Without interface tracking, the active router can continue to send traffic through an interface that is down, causing a network outage.

Interface tracking works by monitoring the status of the interface on the active router. If the interface goes down, the active router sends a multicast message to the standby router, which then takes over as the active router. This ensures that traffic continues to flow without interruption.


Configuration

I created my configuration for it, using 3 routers, 1 server, 1 switch, and 2 PCs, as seen in the picture. All devices and interfaces have been configured with individual IP addresses as shown in the picture.

For Active Router A

Active#config t
Active(config)#int fa0/0    
Active(config-if)#standby 1 ip 192.168.1.100   
Active(config-if)#standby 1 priority 110

For Standby Router B

Standby#config t
Standby(config)#int fa0/0  
Standby(config-if)#standby 1 ip 192.168.1.100

Note:

  • Here, 1 is a standby group number, which must be the same on all routers sharing HSRP duties.

  • 192.168.1.100 is the IP address of the virtual router, which is also the same on all routers sharing HSRP duties and this is a gateway address.

The only difference is that we haven't set priority for the standby router, so its default priority is 100. So that it is a standby router. If we had set the priority of the second router to more than 110, then the second router would be active.

Now that we've implemented HSRP, all traffic from both PCs must pass through Router A. And as soon as Router A detects an issue, all packets are routed through standby Router B.

Also, we have some of the commands to check the various statuses of HSRP.

Active(config-if)#do show standby
Active(config-if)#do show standby brief
Active#debug standby

I hope you guys understood the HSRP. I tried to write as simply as I could.
Adios, Amigos. Hasta la vista.

0
Subscribe to my newsletter

Read articles from Manandhar Sudip directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Manandhar Sudip
Manandhar Sudip

Computer Engineer