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.

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.

Configure HSRP Step By Step

To configure HSRP on Cisco routers, we will use the following topology. You can use either Cisco Packet Tracer version 6 or GNS3 simulator to configure HSRP.Configure HSRP using Cisco Packet Tracer

  1. On WAN router, execute the following commands to configure the appropriate IP addresses on the Loopback1, Fa0/0, and Fa0/1 interfaces.
WAN(config)#interface Loopback1
WAN(config-if)#ip address 200.200.200.1 255.255.255.0
WAN(config-if)#no shutdown
WAN(config-if)#exit

WAN(config)#interface Fa0/0
WAN(config-if)#ip address 172.16.2.1 255.255.255.0
WAN(config-if)#no shutdown
WAN(config-if)#exit

WAN(config)#interface Fa0/1
WAN(config-if)#ip address 172.16.1.1 255.255.255.0
WAN(config-if)#no shutdown
WAN(config-if)#exit
  • The following figure shows the IP configuration of WAN router.Configure IP Addresses to implement HSRP
  1. Once you have configured the appropriate IP addresses, execute the following commands to configure the RIP version 2 routing protocol.
WAN(config)#router rip
WAN(config-router)#version 2
WAN(config-router)#network 172.16.1.0
WAN(config-router)#network 172.16.2.0
WAN(config-router)#network 200.200.200.0
WAN(config-router)#no auto-summary
WAN(config-router)#exit
  1. Once you have configured IP addresses and routing on WAN router, move on to Master router and execute the following command. This router will act as Active router.
  2. Execute the following commands to configure IP address on the Fa0/0 interface.
Master(config)#interface Fa0/0
Master(config-if)#ip address 10.0.0.10 255.255.255.0
Master(config-if)#no shutdown
Master(config-if)#exit
  1. Next, execute the following command to define a group number (1-4096) and set 10.0.0.150 as the virtual IP address.
Master(config-if)#standby 1 ip 10.0.0.150
  1. Next, execute the following command to set the priority value, to enable preempt, and to set the track interface.
Master(config-if)#standby 1 priority 101
Master(config-if)#standby 1 preempt
Master(config-if)#standby 1 track fa0/1
  1. Next, execute the following commands to set the IP address on the Fa0/1 interface.
Master(config)#interface Fa0/1
Master(config-if)#ip address 172.16.1.2 255.255.255.0
Master(config-if)#no shutdown
Master(config-if)#exit
  1. Next, execute the following commands to configure the RIP version 2 routing.
Master(config)#router rip
Master(config-router)#version 2
Master(config-router)#network 172.16.1.0
Master(config-router)#network 10.0.0.0
Master(config-router)#no auto-summary
Master(config-router)#exit
  1. The following figure shows the configuration of Master router.
    Configure HSRP Active Router
  2. Now, move on to Backup router and execute the following commands. On this router, we will set the priority value as 99 (lower than Master router).
Backup(config)#interface Fa0/0
Backup(config-if)#ip address 10.0.0.20 255.255.255.0
Backup(config-if)#no shutdown

Backup(config-if)#standby 1 ip 10.0.0.150
Backup(config-if)#standby 1 priority 99
Backup(config-if)#standby 1 preempt
Backup(config-if)#exit

Backup(config)#interface Fa0/1
Backup(config-if)#ip address 172.16.2.2 255.255.255.0
Backup(config-if)#no shutdown
Backup(config-if)#exit

Backup(config)#router rip
Backup(config-router)#version 2
Backup(config-router)#network 172.16.2.0
Backup(config-router)#network 10.0.0.0
Backup(config-router)#no auto-summary
Backup(config-router)#exit
  1. 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

Verify HSRP Active Router

  1. In the preceding figure, you can see that Master router is currently acts as Active router because it has higher priority (101) than Backup router (99).
  2. 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
  1. Now, move on to Backup router and execute the following command.
  • Backup#show standby

Configure redundnacy using HSRP

  1. 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.

Posted in Cisco, Routing, Switching Tagged with: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*