Virtual Router Redundancy Protocol (VRRP)

How an IETF standard elects an active IPv4 or IPv6 virtual router on a LAN.

Virtual router ID, address and MAC

A VRRP virtual router groups one or more virtual IP addresses under a Virtual Router Identifier (VRID). The active router forwards packets sent to the virtual router. For IPv4 it answers ARP for the virtual address, and for IPv6 it answers Neighbor Discovery.

The VRID forms the last byte of the standard virtual MAC. For VRID 1 the IPv4 MAC is 00:00:5e:00:01:01 and the IPv6 MAC is 00:00:5e:00:02:01. Only the active router owns the forwarding role for that virtual router.

Priority and the active-down timer

The router that owns the virtual IP as its real interface address uses priority 255 and becomes active when available. For other routers, a higher configured priority is preferred. VRRPv3 enables preemption by default, and a higher-priority backup can take over a lower-priority active router when preemption is in effect.

The active router sends advertisements. If they stop arriving, a backup waits for its active-down timer before taking over. Some device displays use Master for the role called Active Router in RFC 9568.

Try it in a lab

  1. On two VRRP-capable routers in the same VLAN, configure VRID 1 with the same IPv4 virtual address, separate from both real interface addresses. Give the intended active router the higher priority and confirm the Active and Backup roles.
  2. Use a host on the VLAN to test the virtual gateway and note the ARP entry. Shut the active router’s LAN interface while keeping the backup and host links up.
  3. Watch the backup assume the active role and verify the host can reach the same gateway address again without changing its configuration.

Sources