HSRP and VRRP configuration, tracking and troubleshooting on Cisco IOS
In short: HSRP and VRRP give hosts a virtual default gateway shared by two routers. Configure the same group and virtual IP on both, raise the priority of the preferred router, enable pre-emption, and track uplinks so failover happens when the path behind the gateway fails. Most faults are mismatched groups, versions or authentication, or hellos not reaching the peer.
Before you start
The concepts of first hop redundancy, with active and standby routers sharing a virtual IP and virtual MAC address, are covered in Layer 3 redundancy: HSRP, VRRP and GLBP. This note is about configuring and fixing them. The examples use VLAN 10 (192.168.10.0/24): R1 is 192.168.10.2, R2 is 192.168.10.3, and hosts use the virtual gateway 192.168.10.1.
| HSRP v1 | HSRP v2 | VRRPv3 | |
|---|---|---|---|
| Multicast address | 224.0.0.2, UDP 1985 | 224.0.0.102, UDP 1985 | 224.0.0.18, IP protocol 112 |
| Groups | 0 to 255 | 0 to 4095 | 1 to 255 |
| Virtual MAC | 0000.0c07.acXX | 0000.0c9f.fXXX | 0000.5e00.01XX |
| Default timers | Hello 3 s, hold 10 s | Hello 3 s, hold 10 s | Advertisement 1 s |
| IPv6 | No | Yes | Yes |
HSRP configuration
track 1 interface GigabitEthernet0/0 line-protocol
!
interface Vlan10
ip address 192.168.10.2 255.255.255.0
standby version 2
standby 10 ip 192.168.10.1
standby 10 priority 110
standby 10 preempt
standby 10 track 1 decrement 20
standby 10 authentication md5 key-string Gw-Key-2026
R2 gets the same commands with its own address and the default priority of 100 (pre-emption is still useful there, so it can take back control after its own reboot if it is meant to). Points to remember:
- Both routers must use the same version, group, virtual IP and authentication.
- Pre-emption is off by default in HSRP. Without it, a higher-priority router that recovers stays standby.
- Tracking lowers the priority when something fails. The decrement must take the active router below the standby's priority (110 - 20 = 90, below 100), otherwise nothing changes.
- For load sharing, use two groups: R1 active for VLAN 10, R2 active for VLAN 20.
VRRP configuration
Current IOS XE uses VRRPv3, enabled globally, with address-family sections. VRRP pre-empts by default and tracking works the same way.
fhrp version vrrp v3
!
interface Vlan10
ip address 192.168.10.2 255.255.255.0
vrrp 10 address-family ipv4
address 192.168.10.1 primary
priority 110
track 1 decrement 20
If a router's real interface address is the virtual IP, it is the address owner, takes priority 255 and is always master while it is up.
Troubleshooting checklist
show standby brieforshow vrrp brief: which router is active or master, priorities, pre-emption and virtual IP.- Both routers active (or both master): they cannot hear each other's hellos. Check the VLAN exists and is allowed on the trunk between them, that no ACL blocks the multicast address or port, and that group number and version match. Each router's log will usually show the other as missing.
- Standby never takes over after an uplink failure: check tracking is configured, the tracked object actually goes down (
show track), the decrement is large enough, and pre-emption is enabled on the standby. - Authentication or virtual IP mismatch: logs report it; correct the configuration on one side.
- Hosts lose connectivity during failover: check that hosts point to the virtual IP, not a real router address, and that switches learn the virtual MAC on the new port (the new active router sends gratuitous ARPs).
Real-world example: a split-brain gateway at a school
At a secondary school, both core switches suddenly showed HSRP active for the staff VLAN, and some staff PCs lost access every few minutes. A trunk between the two core switches had been re-patched during summer works, and its allowed VLAN list no longer included the staff VLAN. Each switch stopped hearing the other's hellos, so both became active and both answered for the virtual MAC, and the access switches kept moving the MAC between uplinks. Adding the VLAN back to the trunk restored one active and one standby router, and the school added an alert for HSRP state changes to its monitoring.
Practice
R1 (priority 110) fails and comes back. R2 is active. What must be configured on R1 for it to become active again?
R1 has priority 105 and tracks its uplink with decrement 5. R2 has priority 100. Does R2 take over when the uplink fails?
Both HSRP routers show as active. What is the most likely cause?
Key takeaways
- Both routers need the same version, group, virtual IP and authentication.
- HSRP pre-emption is off by default; VRRP pre-empts by default.
- Track uplinks and use a decrement that drops priority below the peer.
- Two active routers means hellos are not getting through.
- Use HSRP v2 or VRRPv3 for IPv6 and large group numbers.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.