Wiki DE Start in the browser

Wiki › Protocols

VRRP (redundant gateway)

Two routers share a virtual gateway address. If the master fails, the backup takes over, and the computers notice nothing.

Layer
3 (Vermittlung)
Standard
RFC 9568, RFC 826
See an example
See demo

The problem: a single gateway

Every computer knows exactly one default gateway. If that router fails, nobody reaches other networks any more, even if a second router is ready: the computers know nothing about it. You would have to change the gateway everywhere.

The solution: a virtual address

With VRRP (Virtual Router Redundancy Protocol, version 3 per RFC 9568), two or more routers form a group. They share a virtual IP address, for example 192.168.1.1, and a virtual MAC address 00:00:5e:00:01:VRID (VRID = group number). The computers use the virtual address as their gateway.

  • The router with the highest priority (1–254, default 100) is master. It answers ARP for the virtual address with the virtual MAC and forwards the packets.
  • The others are backups and wait.
  • If the virtual address is a router's own interface address, it is the owner and always has priority 255.

Advertisements and takeover

The master sends an advertisement every second to the multicast address 224.0.0.18 (IP protocol 112, TTL 255, the source is the virtual MAC). If they stop, the backup counts:

A backup with priority 100 therefore takes over after about 3.6 seconds, one with 200 already after 3.2: the stronger backup wins. The new master announces itself with a gratuitous ARP so that the switches learn where the virtual MAC is now. Nothing changes for the computers.

Preempt, tracking, accept mode

  • Preempt (default): if a router with a higher priority comes back, it takes the role. Without preempt the running master stays.
  • Tracking: if not the LAN but the uplink of the master fails, it is reachable but useless. With tracking it then lowers its priority by a decrement, and the backup takes over. If a router runs VRRP on both sides, each side needs tracking on the other, otherwise replies go through the wrong router.
  • Accept mode: per RFC 9568 the master drops packets to the virtual address itself (unless it is the owner). Only with accept mode does it answer, for example, a ping to the gateway.

In leyoNET

Router, firewall and layer 3 switch: device window → Redundancy, add a group with interface, VRID, virtual address and priority. On the command line in interface mode vrrp 1 ip 192.168.1.1, vrrp 1 priority 110, vrrp 1 track eth1 decrement 20, vrrp 1 accept-mode; show vrrp brief shows master and backup. The packet list filters with vrrp, the hex view shows version, VRID, priority and checksum.

How to do it in leyoNET

The same text as in the app’s help (F1 key).

Redundant gateway (VRRP)

If the default gateway fails, no computer reaches other networks. With VRRP (version 3, RFC 9568), two or more routers (or layer 3 switches) share a virtual address that computers use as their gateway.

  • Each group has a number (VRID) and with it the virtual MAC 00:00:5e:00:01:VRID.
  • The router with the highest priority (default 100) is master: it answers ARP for the virtual address and forwards traffic. It announces itself every second with an advertisement to 224.0.0.18 (IP protocol 112, TTL 255).
  • The others are backups. If the advertisements stop for 3 seconds plus a little skew time, the strongest backup takes over and announces itself with a gratuitous ARP. Computers notice nothing; their gateway stays the same.
  • Preempt (default): a router with a higher priority takes the role back.
  • Tracking: if the master's uplink fails, it lowers its priority so that a backup takes over. If a router runs VRRP on both sides, each side needs tracking, otherwise replies go through the wrong router.
  • Accept mode: only with it does the master answer a ping to the virtual address. If the virtual address is the router's own interface address, the router is its owner (priority 255).

Set it up in the device window under Redundancy or in interface mode: vrrp 1 ip 192.168.1.1, vrrp 1 priority 110, vrrp 1 track eth1 decrement 20. show vrrp brief shows the state.

See an example

  • VRRP: redundant gateway

    Two routers share a virtual gateway address (.1) in both networks. Router 1 has the higher priority and is master; Router 2 waits as backup. Tracking makes Router 1 step down on both sides if one side fails.

    PC 1 pings the web server continuously. Remove the cable Router 1–LAN: after about 3.5 s Router 2 takes over, the ping continues, the PCs keep their gateway. Packet list with filter «vrrp»: advertisements to 224.0.0.18. Plug the cable back in: Router 1 takes the role back (preempt).

    Watch live Project file

“Watch live” opens the network in leyoNET, the simulation runs in a loop. In the app you find it under File → Demo networks, with a step-by-step tour.

Practise

  • ★★★★☆ Gateway without failure (VRRP) · 4 goals · Worksheet (German)

In leyoNET under Tools → Exercise catalogue. Every exercise checks itself.

What leyoNET simplifies

ProtocolLayerSimplification in the simulation
VRRP3Version 3 for IPv4 only: advertisement every second to 224.0.0.18 (TTL 255, virtual MAC as source) with real checksum; Master_Down_Interval and Skew_Time as in the standard; preempt, accept mode, owner (priority 255), resignation with priority 0; tracking of one interface (priority minus decrement, as vendors do); one virtual address per group, no VRRP for IPv6

Standards

  • RFC 9568 – Virtual Router Redundancy Protocol (VRRP) Version 3 for IPv4 and IPv6
  • RFC 826 – An Ethernet Address Resolution Protocol

Read on

Found a mistake or have an idea? Source of this page on GitHub.