HSRP (Hot Standby Router Protocol) – In-Depth Guide
1. HSRP Overview
HSRP is a Cisco proprietary First Hop Redundancy Protocol (FHRP) that provides gateway redundancy. If the active router fails, a standby router takes over automatically, ensuring network continuity.
- Multiple routers form an HSRP group sharing a virtual IP address.
- One router is Active, others remain in Standby.
- Hosts configure the virtual IP as their default gateway.
Example Scenario:
Two routers (R1 & R2) form HSRP Group 1 with virtual IP 192.168.1.254
. Hosts point their default gateway to this virtual IP.
2. HSRP Versions
Version | Key Differences | When to Use |
---|---|---|
HSRP v1 | Group numbers 0–255, IPv4 only, MAC 00:00:0c:07:ac:XX |
Legacy setups, IPv4-only networks |
HSRP v2 | Group numbers 0–4095, IPv6 support, MAC 00:00:0c:9f:fX:XX |
Modern networks, IPv6 required, multiple groups |
3. HSRP States and State Machine
State | Description |
---|---|
Initial | Startup, no HSRP activity yet |
Learn | Learns virtual IP |
Listen | Listening for hello messages |
Speak | Exchanges hello messages, election process starts |
Standby | Ready to take over if Active fails |
Active | Currently forwarding packets |
Timers: Hello (default 3s), Hold (default 10s).
4. HSRP Priority and Preemption
- Default Priority: 100
- Higher priority routers become Active
Configuring Priority and Preemption:
standby [group] priority [value] standby [group] preempt
5. HSRP Group and Virtual MAC/IP
Group Number: Identifies HSRP instance.
Virtual MAC Address Format:
- HSRP v1:
00:00:0c:07:ac:XX
- HSRP v2:
00:00:0c:9f:fX:XX
Example Configuration:
interface g0/1 standby 1 ip 192.168.1.254 standby 1 priority 110 standby 1 preempt
6. Timers and Convergence
- Hello Timer: Interval for hello messages (3s default).
- Hold Timer: Wait before declaring router down (10s default).
Adjust timers carefully to balance fast convergence and network load:
standby [group] timers [hello] [hold]
7. HSRP Interface Tracking
Decreases priority if a key interface fails:
standby [group] track [interface] [decrement value]
8. Authentication
Secures HSRP traffic between routers.
- Plain-text:
standby [group] authentication [string]
- MD5: More secure:
standby [group] authentication md5 key-string [string]
9. Load Sharing Techniques
Use multiple HSRP groups with different virtual IPs for load distribution.
10. Integration with Other Protocols
Protocol | Description |
---|---|
VRRP | Standard-based alternative to HSRP |
GLBP | Cisco protocol supporting load balancing with one virtual IP |
11. HSRP over NBMA and Point-to-Point Links
- NBMA: Ensure broadcast mapping or static configuration.
- Point-to-Point: Usually not needed due to direct links.
12. Show and Debug Commands
show standby
: Detailed HSRP statusshow standby brief
: Brief statusdebug standby events
: Monitor state transitionsdebug standby packets
: Inspect HSRP traffic
13. Troubleshooting HSRP
Issue | Possible Cause | Solution |
---|---|---|
Split-brain | Both routers Active | Check timers, priority, preemption |
No failover | Priority/preempt misconfigured | Verify priority and preempt settings |
State inconsistencies | HSRP version mismatch, interface down | Check configuration and interfaces |
14. Advanced Topics
- BFD integration: Faster failure detection.
- Graceful Restart: Minimal disruption during failover.
Sample Configuration:
interface GigabitEthernet0/1 ip address 192.168.10.2 255.255.255.0 standby 10 ip 192.168.10.254 standby 10 priority 110 standby 10 preempt
When to Use HSRP
- Enterprise networks
- Data centers
- Multi-router campuses