Introduction
In enterprise networks, gateway availability is critical. If the default gateway router fails, users may lose access to resources outside their local network even though the LAN remains operational.
To overcome this problem, Cisco introduced Hot Standby Routing Protocol (HSRP), a First Hop Redundancy Protocol (FHRP) that provides gateway redundancy and high availability.
HSRP allows multiple routers to work together and present a single virtual gateway IP address to end devices. If the active router fails, another router automatically takes over, ensuring minimal disruption to network traffic.
What is HSRP?
HSRP stands for Hot Standby Routing Protocol. It is a Cisco proprietary redundancy protocol designed to provide continuous gateway availability.
Instead of configuring hosts with the physical IP address of a router, hosts use a virtual IP address. Multiple routers participate in an HSRP group and share responsibility for maintaining that virtual gateway.
Only one router forwards traffic at a time, while another router remains ready to take over during a failure.
How HSRP Works
HSRP operates by electing routers into different roles.
- Active Router – Forwards user traffic.
- Standby Router – Takes over if the active router fails.
- Listen Router – Monitors HSRP messages but does not actively participate in forwarding.
The routers exchange hello packets to monitor each other's availability.
If hello packets stop arriving from the active router, the standby router assumes control of the virtual IP address and virtual MAC address.
HSRP Topology Example
Consider the following scenario:
- Router R1 IP Address: 192.168.10.1
- Router R2 IP Address: 192.168.10.2
- Virtual Gateway IP: 192.168.10.254
- Client Default Gateway: 192.168.10.254
Clients never know which router is active because they always communicate with the virtual gateway address.
HSRP States
A router participating in HSRP transitions through several states:
- Initial
- Learn
- Listen
- Speak
- Standby
- Active
The Active state forwards traffic, while the Standby state waits to take over during a failure.
Basic HSRP Configuration
The following example configures HSRP Group 10 on Router R1.
interface GigabitEthernet0/0 ip address 192.168.10.1 255.255.255.0 standby 10 ip 192.168.10.254 standby 10 priority 110 standby 10 preempt
The higher priority value makes Router R1 the preferred active router.
Configure Standby Router
Configure Router R2 as follows:
interface GigabitEthernet0/0 ip address 192.168.10.2 255.255.255.0 standby 10 ip 192.168.10.254 standby 10 priority 100 standby 10 preempt
Since Router R2 has a lower priority, it becomes the standby router.
HSRP Priority
Priority determines which router becomes the active router.
The default HSRP priority is 100.
The router with the highest priority becomes active.
| Router | Priority | Role |
|---|---|---|
| R1 | 110 | Active |
| R2 | 100 | Standby |
What is Preemption?
By default, if the active router fails and later comes back online, it does not automatically regain the active role.
The preempt command allows the higher-priority router to reclaim the active role when it becomes available again.
standby 10 preempt
HSRP Tracking
Interface tracking allows HSRP to react to WAN failures.
If an important uplink fails, the router can reduce its priority and allow another router to become active.
interface GigabitEthernet0/0 standby 10 track GigabitEthernet0/1 20
If GigabitEthernet0/1 goes down, the HSRP priority decreases by 20 points.
Verification Commands
Use the following commands to verify HSRP operation:
show standby show standby brief show standby all
The output displays the active router, standby router, virtual IP address, and current HSRP state.
Sample Verification Output
R1# show standby brief Interface Grp Pri State Active Standby Virtual IP Gi0/0 10 110 Active local 192.168.10.2 192.168.10.254
HSRP Version 1 vs Version 2
| Feature | Version 1 | Version 2 |
|---|---|---|
| Group Range | 0-255 | 0-4095 |
| Multicast Address | 224.0.0.2 | 224.0.0.102 |
| Scalability | Limited | Higher |
Troubleshooting HSRP
If HSRP is not functioning correctly, verify the following:
- Both routers are in the same HSRP group.
- Virtual IP address matches on all routers.
- HSRP version is consistent.
- Hello and Hold timers match.
- Layer 2 connectivity exists between routers.
- No ACL or security policy is blocking HSRP packets.
Benefits of HSRP
- Provides gateway redundancy.
- Minimizes downtime during router failures.
- Transparent failover for end users.
- Easy to deploy and manage.
- Supports load-sharing designs using multiple HSRP groups.
Conclusion
HSRP is one of the most widely deployed First Hop Redundancy Protocols in Cisco environments. By providing a virtual default gateway, HSRP ensures continuous network availability and protects users from gateway failures.
Ask Your Doubt