L3 · fhrp · reviewed
VRRP
Virtual Router Redundancy Protocol
Several routers share a virtual IPv4 or IPv6 address; the highest priority owns it and advertises so backups can take over when silence means the master is gone.
Presenter modeEmbed this figure
Why it exists
Hosts need a default gateway that survives a router failure. Giving every host two gateways and teaching them to fail over is rare; giving the LAN one virtual address that a pair of routers can own is the usual answer. IntroductionRFC 5798 · PROPOSED STANDARD · March 2010
VRRP elects one Master to forward for that virtual address and one or more Backups that take over when advertisements stop — or when the master resigns with priority zero. VRRP OverviewRFC 5798 · PROPOSED STANDARD · March 2010
Highest priority owns the virtual address
Two routers share 192.0.2.1 as VRID 1. Priority elects the master; the backup forwards nothing until silence or priority zero says otherwise.
Both routers join VRID 1 for virtual address 192.0.2.1. The host’s default gateway is that address — not either router’s physical address. Host · gw 192.0.2.1: Gateway 192.0.2.1. R1 · pri 120: VRID 1. R2 · pri 100: VRID 1. Upstream.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| Host · gw 192.0.2.1 | host | Gateway: 192.0.2.1 |
| R1 · pri 120 | router | VRID: 1 |
| R2 · pri 100 | router | VRID: 1 |
| Upstream | cloud | — |
| Host · gw 192.0.2.1 — R1 · pri 120 | link | up |
| Host · gw 192.0.2.1 — R2 · pri 100 | link | up |
| R1 · pri 120 — Upstream | link | up |
| R2 · pri 100 — Upstream | link | up |
Both routers join VRID 1 for virtual address 192.0.2.1. The host’s default gateway is that address — not either router’s physical address.
What changed
- R1 · pri 120: VRID → 1
- R2 · pri 100: VRID → 1
- Host · gw 192.0.2.1: Gateway → 192.0.2.1
- Emphasis on Host · gw 192.0.2.1
How it works
The Master sends Advertisement packets (IP protocol 112) to 224.0.0.18. Backups listen; if Master_Down_Interval expires without a higher-or-equal advertisement, a Backup becomes Master. VRRP Packet FormatRFC 5798 · PROPOSED STANDARD · March 2010
Priority elects the Master. 255 is reserved for the router that owns the virtual address; backups use 1–254 (default 100); 0 means the Master is leaving. PriorityRFC 5798 · PROPOSED STANDARD · March 2010
The IPv4 virtual MAC is 00-00-5E-00-01-{VRID}. Hosts ARP once; failover moves the same MAC. The new Master sends a gratuitous ARP so switches relearn the port — not so hosts rewrite their caches. Virtual Router MAC AddressRFC 5798 · PROPOSED STANDARD · March 2010
Max Adver Int is in centiseconds (default 100). Master_Down_Interval is three intervals plus a skew, so the one-second default yields multi-second silence detection unless the interval is shortened or BFD is used. Parameters Per Virtual RouterRFC 5798 · PROPOSED STANDARD · March 2010
On the wire
Constructed examples, encoded from the field table below them — not captured traffic.
- IPv4
- Protocol 112, destination 224.0.0.18, TTL 255. A packet that has been routed would not keep TTL 255, so a reduced TTL is discarded. RFC 5798
- VRRP Advertisement
- Version, type, VRID, priority, count, reserved, Max Adver Int, checksum, then IPvX addresses. RFC 5798
Configure it
interface Vlan10 vrrp 1 address-family ipv4 address 192.0.2.1 primary priority 120 preempt delay minimum 30VRID 1 owns 192.0.2.1. Priority 120 beats the peer’s 100. Preempt delay waits for routing before taking mastership back after a recovery.
Common mistake: Omitting preempt delay so a recovering router takes traffic before its RIB is populated.
RFC 5798 §5.2.4
interface Vlan10 vrrp 1 address-family ipv4 timers advertise 100Advertisement interval in centiseconds on platforms that expose VRRPv3 units — 100 is the RFC default of one second.
RFC 5798 §5.2.7
track 1 interface GigabitEthernet0/0/1 line-protocol interface Vlan10 vrrp 1 address-family ipv4 track 1 decrement 30When the uplink goes down, priority falls by 30 so the backup can win. Without this, a master with a dead upstream keeps the role.
Common mistake: Tracking the LAN interface instead of the uplink — the LAN is what VRRP already knows about.
Verify
show vrrp brief- VRID, priority, state (Master/Backup), and virtual IP.
show track 1- Tracked uplink state and whether the decrement is applied.
Caveats
- Marked draft: syntax has not been checked against Cisco documentation or a device.
- Older IOS `standby` is HSRP; `vrrp` / `vrrp … address-family` is VRRP — do not mix the two for one gateway.
When it breaks
Symptom first, because that is what you have when it happens.
Both routers believe they are master, and hosts see duplicate-address warnings.
Narrow it down
- Confirm each router sees the other’s advertisements, in both directions.
- Compare the virtual router identifier, the advertisement interval and any authentication on both.
- Check whether an intermediate switch is filtering the multicast address.
Cause
The two routers cannot hear each other. Election assumes a shared segment, so a broken path between them produces two masters, each correctly concluding it is alone.
Fix
Restore the path and align the parameters that must match. A mismatched interval or identifier is a partition in effect even when the link is fine.
State DescriptionsRFC 5798 · PROPOSED STANDARD · March 2010The virtual address is reachable but traffic through it is black-holed after an upstream link fails.
Narrow it down
- Check whether the master still holds mastership after losing its upstream.
- Look for object tracking on the upstream interface.
- Confirm the backup has a working path.
Cause
VRRP tracks itself, not the network beyond it. A router with a failed uplink is still a perfectly healthy VRRP master and keeps attracting traffic it cannot forward.
Fix
Track the upstream interface or a route and decrement priority when it fails, so mastership follows the path rather than the router.
Failover happens but takes seconds, and voice calls drop.
Narrow it down
- Read the advertisement interval and the derived master-down interval.
- Check whether preemption is enabled and whether a delay is configured.
- Look at how long the switch takes to relearn the virtual MAC.
Cause
The backup waits three advertisement intervals plus a skew before declaring the master down. At the one-second default that is over three seconds.
Fix
Shorten the interval, or track the link with BFD so failure is detected rather than inferred from silence.
Parameters Per Virtual RouterRFC 5798 · PROPOSED STANDARD · March 2010Every reload of the primary router forces a failover even when a non-owner backup was intended to stay master during maintenance.
Narrow it down
- Check whether the virtual IP is configured as a real interface address on one router.
- Confirm that router’s priority is 255.
- Compare with using a dedicated virtual address neither router owns.
Cause
The address owner must run at priority 255 and always wins the election. Reloading the owner always moves mastership away and back.
Fix
Use a virtual address that neither router owns when you want priority-based primary selection without owner semantics, or accept that the owner is always primary.
PriorityRFC 5798 · PROPOSED STANDARD · March 2010A lower-priority router briefly becomes master when it comes online, then immediately yields.
Narrow it down
- Compare Max Adver Int on both routers.
- Check whether the higher-priority master advertises more slowly than the backup expects.
Cause
A backup configured for a faster rate can time out a slower higher-priority master before hearing it, then relinquish when the advertisement arrives.
Fix
Align advertisement intervals; do not run a higher-priority master slower than its backups.
Maximum Advertisement Interval (Max Adver Int)RFC 5798 · PROPOSED STANDARD · March 2010
Design notes
Track the uplink or a critical route and decrement priority on failure. VRRP alone has no view past the LAN; a master with a dead upstream is a black hole that looks healthy.
Load sharing needs multiple VRIDs with mastership split and hosts pointed at different virtual addresses — or GLBP / anycast gateway. One group has one forwarder. VRRP OverviewRFC 5798 · PROPOSED STANDARD · March 2010
Running HSRP and VRRP on the same segment for the same gateway problem produces two independent elections and two virtual MACs. They do not interoperate.
Preempt is on by default in RFC 5798. Prefer a short preempt delay so a returning higher-priority router finishes IGP convergence before it takes traffic.
Misconceptions
- “VRRP load balances across both routers.”
- One master forwards; the backup forwards nothing. Load sharing needs several VRRP groups with mastership split between them and hosts pointed at different virtual addresses — or a protocol designed for it, like GLBP.
- “The virtual IP has to be an address neither router owns.”
- It may be an address one router owns. That router is then the address owner, always runs at priority 255, and always wins the election — which is a design choice with consequences, not an accident. PriorityRFC 5798 · PROPOSED STANDARD · March 2010
- “Hosts need to be told about the failover.”
- They do not, and that is the point. The virtual MAC moves with mastership, so the host’s ARP entry stays correct. The new master sends a gratuitous ARP to move the switch’s forwarding entry, not to inform the host.
More walkthroughs
Healthy master, dead pathfailure
The master loses its upstream and keeps advertising. Hosts still send to the virtual MAC; packets black-hole until tracking drops priority.
R1 is Master with a working uplink. Advertisements keep R2 in Backup. Traffic from the host leaves through R1. Host. R1 Master: Role Master. R2 Backup: Role Backup. Upstream.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| Host | host | — |
| R1 Master | router | Role: Master |
| R2 Backup | router | Role: Backup |
| Upstream | cloud | — |
| Host — R1 Master | link | up |
| Host — R2 Backup | link | up |
| R1 Master — Upstream | link | up |
| R2 Backup — Upstream | link | up |
R1 is Master with a working uplink. Advertisements keep R2 in Backup. Traffic from the host leaves through R1.
What changed
- R1 Master: Role → Master
- R2 Backup: Role → Backup
- Emphasis: Path OK
Silence costs three intervals plus skewdesign-choice
At the one-second default, failover from silence is over three seconds. Priority zero resigns immediately; shortening the interval or adding BFD is how voice survives.
Advertisements go out every Max Adver Int centiseconds. Default is 100 — one second. The backup’s Master_Down_Interval is three advertisement intervals plus a skew based on priority. Master: Max Adver Int 100 cs. Backup: Master_Down_Interval ~3 s + skew.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| Master | router | Max Adver Int: 100 cs |
| Backup | router | Master_Down_Interval: ~3 s + skew |
| Master — Backup | link | up |
Advertisements go out every Max Adver Int centiseconds. Default is 100 — one second. The backup’s Master_Down_Interval is three advertisement intervals plus a skew based on priority.
What changed
- Master: Max Adver Int → 100 cs
- Backup: Master_Down_Interval → ~3 s + skew
- Adv / 1 s: Master → Backup
Terms
- VRRP priority
- Master election value. 255 is reserved for the address owner. Preempt is on by default in RFC 5798; Cisco HSRP preempts only when configured.