What is HSRP and How to Configure it in Cisco Switch?

What is HSRP?

The Hot Standby Router Protocol (HSRP) is a Cisco-proprietary redundancy protocol that is used to provide redundancy for the default gateway on a network. HSRP provides for automatic failover in the event of router or link failure.

In HSRP, a group of routers works together to appear as a single virtual router to the hosts on the LAN. The virtual router has a virtual IP address and a virtual MAC address. One of the routers in the group is elected as the active router and handles all traffic for the virtual router. The other routers in the group are standby routers and take over if the active router fails.

What are the Uses of HSRP?

HSRP can be used in a number of situations where gateway redundancy is desired, such as the following:

  • To provide redundant default gateways for hosts on a LAN
  • To provide redundant routers for forwarding traffic to other networks or the Internet
  • To provide redundant NAT routers

What are the Advantages of HSRP?

HSRP has a number of advantages over other redundancy protocols, such as VRRP and GLBP:

  • HSRP is supported by a wide range of Cisco routers, making it a good choice for organizations that use Cisco equipment.
  • HSRP uses multicast rather than broadcast traffic, which reduces the amount of traffic on the network.
  • HSRP can be configured to use different tracking methods to determine when to failover, giving administrators more flexibility.

What are the Disadvantages of HSRP?

HSRP has a few disadvantages that should be considered before using it:

  • HSRP is a proprietary protocol, so it can only be used on Cisco equipment.
  • HSRP requires more configuration than VRRP or GLBP, making it more complex to set up.
  • HSRP uses multicast traffic, which may not be supported by all networking equipment.

How to Configure HSRP in Cisco Switch?

What is HSRP and How to Configure it in Cisco Switch

#1. The first step is to create a group for the HSRP virtual router. This is done by using the “standby” command in global configuration mode.

  • For example, to create a group 1 virtual router, the following command would be used:

switch(config)# standby 1

#2. The next step is to configure the IP address of the virtual router. This is done by using the “IP” command in group configuration mode.

  • For example, to configure a virtual IP address of 10.1.1.1/24 for group 1, the following command would be used:

switch(config-standby)# ip 10.1.1.1 255.255.255.0

#3. The next step is to configure the priority of the virtual router. This is done by using the “priority” command in group configuration mode. The priority can be any number between 1 and 255, with 1 being the highest priority and 255 being the lowest. The default priority is 100.

  • For example, to configure a priority of 150 for group 1, the following command would be used:

switch(config-standby)# priority 150

#4. The next step is to configure the preemption delay. Preemption is when a standby router takes over for an active router. The delay is the amount of time that must elapse before a standby router can take over for an active router. This is done by using the “preempt” command in group configuration mode. The delay can be any number of seconds between 0 and 3600. The default delay is 5 seconds.

  • For example, to configure a preemption delay of 10 seconds for group 1, the following command would be used:

switch(config-standby)# preempt 10

#5. The next step is to configure the Hello interval. The Hello interval is the amount of time between hello packets that are sent by the active router. This is done by using the “hello-interval” command in group configuration mode. The interval can be any number of seconds between 1 and 255. The default interval is 3 seconds.

  • For example, to configure a Hello interval of 5 seconds for group 1, the following command would be used:

switch(config-standby)# hello-interval 5

#6. The next step is to configure the hold time. The hold time is the amount of time that a router will keep its status as active or standby before checking if the other router is still alive. This is done by using the “hold time” command in group configuration mode. The hold time can be any number of seconds between 1 and 255. The default hold time is 10 seconds.

  • For example, to configure a hold time of 15 seconds for group 1, the following command would be used:

switch(config-standby)# holdtime 15

#7. The final step is to configure the track interface. The track interface is used to monitor the status of a physical interface. If the status of the interface changes, the priority of the virtual router can be changed accordingly. This is done by using the “track” command in group configuration mode.

  • For example, to configure tracking of interface FastEthernet0/1 for group 1, the following command would be used:

switch(config-standby)# track FastEthernet0/1

#8. After the HSRP group has been configured, the next step is to configure the physical interface that will be used by the group. This is done by using the “standby” command in interface configuration mode.

  • For example, to configure FastEthernet0/1 to use group 1, the following command would be used:

switch(config-if)# standby 1

After the physical interface has been configured, the HSRP group will be up and running.

Can We Do the Load Balancing with HSRP?

Yes, we can do load balancing with HSRP. By configuring multiple HSRP groups on the same router and assigning different priorities to each group, we can achieve load balancing. The router will then send traffic to the HSRP group with the highest priority.

Leave a Comment