What is HSRP ?

 What is HSRP ?

The Hot Standby Router Protocol (HSRP) is a Cisco-specific redundancy protocol designed to create fault-tolerant default gateway configurations within a network. It allows multiple routers to collaborate and appear as a single virtual router to connected devices. In an HSRP configuration, several routers work collectively to provide network redundancy, ensuring continuous network availability even if one router experiences failure.

HSRP operates by enabling routers within a group to communicate via a multicast address (224.0.0.2) over User Datagram Protocol (UDP) port 1985. Among these routers, one is designated as the “active” router, while another is selected as the “standby” router.

What is HSRP ?

Fundamental Elements of HSRP:

  • Active Router: This router is responsible for forwarding packets on behalf of the virtual router. It periodically transmits “hello” messages to the standby router to indicate its active and operational status.
  • Standby Router: The standby router monitors the “hello” messages from the active router. If it fails to receive a “hello” message within the designated “hold time,” it presumes the active router has failed and assumes the active role.
  • Virtual Router: The virtual router represents the combined logical entity of both the active and standby routers. It possesses its own IP and MAC addresses, which connected devices use as their default gateway.
  • HSRP State Transition: Routers in HSRP move through several states—Initial, Learn, Listen, Speak, Standby, and Active—that reflect the process of selecting an active router and ensuring redundancy.
  • Preemption: This capability enables a router with a higher priority to assume the active role once it becomes available, even if the current active router is still operational. This is beneficial when a preferred router recovers from a failure.
  • Load Balancing: HSRP supports load balancing by configuring multiple HSRP groups, each with distinct virtual IP addresses. Hosts can be assigned to different groups, distributing network traffic across several routers.
  • HSRP Versions: Two versions exist—HSRP version 1 (HSRPv1) and version 2 (HSRPv2). HSRPv2 offers improvements such as IPv6 support and a larger number of groups.

The Purpose of HSRP

HSRP is primarily designed to ensure high availability and fault tolerance for default gateway configurations within a network. It accomplishes this by allowing multiple routers to collaborate and present a single virtual router to connected hosts. This setup guarantees continuous network operation even if one router in the group fails, maintaining uninterrupted connectivity for devices.


Key objectives of HSRP include:

  • Redundancy: HSRP provides redundancy by designating an active router alongside a standby router. Should the active router fail, the standby router seamlessly assumes control, preventing network downtime.
  • High Availability: The protocol maintains constant availability by ensuring there is always an active router ready to handle traffic for connected hosts, thereby maximizing network uptime.
  • Network Stability: HSRP enhances network reliability through smooth failover processes from the active to the standby router, minimizing packet loss and reducing disruptions to hosts.
  • Load Balancing (optional): HSRP can support load balancing by configuring multiple HSRP groups with distinct virtual IP addresses, enabling hosts to be distributed among these groups and balancing traffic across several routers.

Configurations 

HSRP Configurations on Router R1

R1# configure t
R1(config)# interface Gi0/0
R1(config-if)# no shutdown
R1(config-if)# ip address 192.168.1.2 255.255.255.0
R1(config-if)# standby 1 ip 192.168.1.1
R1(config-if)# standby 1 priority 110
R1(config-if)# exit
R1(config)#end
R1#

HSRP Configurations on Router R2

R2# configure t
R2(config)# interface Gi0/0
R2(config-if)# no shutdown
R2(config-if)# ip address 192.168.1.3 255.255.255.0
R2(config-if)# standby 1 ip 192.168.1.1
R2(config-if)# standby 1 priority 100
R2(config-if)# exit
R2(config)#end
R2#