In this guide
How HSRP works
Hot Standby Router Protocol is a first-hop redundancy protocol. A group of Layer 3 devices shares a virtual IP address and virtual MAC address. Hosts use the virtual IP as their default gateway, while HSRP selects an Active device and a Standby device.
When the Active device fails or otherwise relinquishes the role, the Standby device can take over the virtual gateway function. The virtual address allows hosts to retain the same default gateway.
Priority and election
HSRP priority is normally 100 by default and can be configured from 1 to 255. A higher priority is preferred during election processing. If priorities are equal, the interface IP address is used as a tie-break in supported implementations.
The effective priority can be reduced by object tracking. This lets a router remain operational for the LAN while lowering its HSRP preference when another tracked resource fails.
Preemption
Preemption allows a higher-priority HSRP device to take the Active role when it becomes eligible. Without preemption, a device with a higher configured priority does not necessarily take over from an already-active lower-priority device simply because it has returned to service.
A preemption delay can be used to give a recovering router time to establish its routing information before taking the Active role.
Object tracking
HSRP tracking can reduce the effective priority when a tracked interface or object changes state. This is useful when the LAN-facing interface remains up but an important upstream path has failed. The exact tracking commands and capabilities vary by platform.
Timers
Common Cisco HSRP defaults are a 3-second hello timer and 10-second hold timer. These values are configurable. The hold timer controls how long an HSRP device waits without receiving a valid hello before considering the peer unavailable.
Changing timers affects convergence and control traffic. Very aggressive values should be tested against the platform and network conditions rather than selected solely because they look faster.
Virtual MAC
| Version | Common virtual MAC format | Group range |
|---|---|---|
| HSRPv1 | 0000.0C07.ACxx | 0–255 |
| HSRPv2 | 0000.0C9F.Fxxx | 0–4095 |
Use the HSRP Calculator to generate the virtual MAC for a group and work through a two-router priority election.
Troubleshooting
- Verify both devices are on the same Layer 2 segment for the HSRP group.
- Check the HSRP group number and virtual IP address.
- Compare configured and effective priorities, including tracking reductions.
- Check whether preemption is enabled and whether a preemption delay is configured.
- Compare hello and hold timers.
- Check authentication configuration where used.
- Use platform commands such as
show standbyto inspect Active/Standby state, timers, virtual IP, virtual MAC and tracking. - Check the underlying VLAN, interface and routing state separately from HSRP.
References
- Cisco First Hop Redundancy Protocols Configuration Guide — HSRP.
- RFC 2281 — Cisco Hot Standby Router Protocol (HSRP).