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

VRRP Packet FormatRFC 5798 · PROPOSED STANDARD · March 2010PriorityRFC 5798 · PROPOSED STANDARD · March 2010Parameters Per Virtual RouterRFC 5798 · PROPOSED STANDARD · March 2010Virtual Router MAC AddressRFC 5798 · PROPOSED STANDARD · March 2010

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.

Host · gw 192.0.2.1Gateway: 192.0.2.1R1 · pri 120VRID: 1R2 · pri 100VRID: 1Upstream
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
Host · gw 192.0.2.1hostGateway: 192.0.2.1
R1 · pri 120routerVRID: 1
R2 · pri 100routerVRID: 1
Upstreamcloud
Host · gw 192.0.2.1R1 · pri 120linkup
Host · gw 192.0.2.1R2 · pri 100linkup
R1 · pri 120Upstreamlinkup
R2 · pri 100Upstreamlinkup
1 / 4

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.

Version 3, type Advertisement, priority 120, one-second interval (100 centiseconds), advertising virtual address 192.0.2.1. Checksum left zero in the example values — the field is computed on the wire with this octet pair cleared.

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

Master for VRID 1 at priority 120 with uplink tracking.

Cisco IOS-XE 17.12 · Catalyst 9300, ISR 4451draft

  1. interface Vlan10
     vrrp 1 address-family ipv4
      address 192.0.2.1 primary
      priority 120
      preempt delay minimum 30

    VRID 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

  2. interface Vlan10
     vrrp 1 address-family ipv4
      timers advertise 100

    Advertisement interval in centiseconds on platforms that expose VRRPv3 units — 100 is the RFC default of one second.

    RFC 5798 §5.2.7

  3. track 1 interface GigabitEthernet0/0/1 line-protocol
    interface Vlan10
     vrrp 1 address-family ipv4
      track 1 decrement 30

    When 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.

  1. Both routers believe they are master, and hosts see duplicate-address warnings.

    Narrow it down

    1. Confirm each router sees the other’s advertisements, in both directions.
    2. Compare the virtual router identifier, the advertisement interval and any authentication on both.
    3. 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 2010
  2. The virtual address is reachable but traffic through it is black-holed after an upstream link fails.

    Narrow it down

    1. Check whether the master still holds mastership after losing its upstream.
    2. Look for object tracking on the upstream interface.
    3. 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.

  3. Failover happens but takes seconds, and voice calls drop.

    Narrow it down

    1. Read the advertisement interval and the derived master-down interval.
    2. Check whether preemption is enabled and whether a delay is configured.
    3. 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 2010
  4. Every reload of the primary router forces a failover even when a non-owner backup was intended to stay master during maintenance.

    Narrow it down

    1. Check whether the virtual IP is configured as a real interface address on one router.
    2. Confirm that router’s priority is 255.
    3. 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 2010
  5. A lower-priority router briefly becomes master when it comes online, then immediately yields.

    Narrow it down

    1. Compare Max Adver Int on both routers.
    2. 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.

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.

MasterMax Adver Int: 100 csBackupMaster_Down_Interval: ~3 s + skew
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
MasterrouterMax Adver Int: 100 cs
BackuprouterMaster_Down_Interval: ~3 s + skew
MasterBackuplinkup
1 / 4

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.

Check yourself

  • Both routers are master and hosts report a duplicate address. What is the cause?
  • The master loses its upstream link. What does VRRP do by default?
  • With the default one-second interval, roughly how long does failover take?
  • Why do hosts not need to do anything when mastership moves?
  • What does priority 255 mean?
  • What does an advertisement with priority 0 tell backups?
  • How does one VRRP group share traffic across both routers?
  • After tracking drops R1 below R2 and R2 becomes Master, what restores R1?