How to Configure HSRP on Cisco Router

HSRP stands for Hot Standby Routing Protocol. It is a Cisco proprietary protocol that provides high availability and redundancy. It enables a set of router interfaces to work together and present them as a single virtual router (default gateway) to the clients on a network. HSRP uses a virtual MAC address and an IP address that is shared by a group of configured routers. It uses the concept of Active and Standby (Master/Backup) routers for redundancy. The Active router is the router that is preferred to route the network packets. The Standby router is the router that takes over the routing responsibilities when the Active router fails. In this post, we will learn how to configure HSRP on Cisco routers.

The Active router is the router that is preferred to route the network packets. The Standby router is the router that takes over the routing responsibilities when the Active router fails. In this post, we will learn how to configure HSRP on Cisco routers.

Before to configure HSRP, you should consider the following:

The following interface configuration commands are used to set the characteristics to elect the Active and Standby routers.

standby priority
standby preempt
standby track

In addition, these commands are also used to set the behavior regarding when a new active router will take over the routing responsibilities.

The Active and Standby routers can be elected by using the Priority value. If preemption is enabled, the router with the highest priority will become the Active router. If the priority values of two or more routers are equal in a group of configured routers, the current Active router will not be changed. The priority value can vary from 1 to 255. The highest number means the highest priority and higher the chances to become the Active router. The priority of a router can change dynamically if an interface is configured with the standby track command, and another interface on the router goes down.

Once you have configured the HSRP routing protocol on Master and Backup routers, now it’s time to verify your configuration. To do so, execute the following command on Master router and examine the output shown in the following figure.

Master#show standby

In the preceding figure, you can see that Master router is currently acting as an Active router because it has higher priority (101) than the Backup router (99).

To explain what happens when the Active router fails, we will shut down the Fa0/0 interface on Master router. To do so, execute the following commands.

Master(config)#int fa0/0
Master(config-if)#shutdown

Now, move on to the Backup router and execute the following command.

Backup#show standby

In the preceding figure, you can see that Backup router becomes the Active router and takes the routing responsibilities as soon as the interface of Master router goes down.

The destination network can still be reached because clients will use 10.0.0.150 virtual IP address as the default gateway. When the Master router fails, the Backup router will take the routing responsibilities. When the Backup router fails, the Master router will take the routing responsibilities. This is what the HSRP protocol does.

In this post, we have discussed how to configure HSRP on Cisco switch and how it can help to provide the redundancy. Please share the post if you think it can help others too.