Move a gateway address between two routers
VRRP peers share a virtual router ID and virtual IP. During failover, verify the address on the interface as well as the router role.
stateDiagram-v2
[*] --> Initialize
Initialize --> Master: startup, priority 255
Initialize --> Backup: startup
Backup --> Master: master-down timer
Master --> Backup: advert from higher priority, or equal with higher address
Master --> Initialize: shutdown
Backup --> Initialize: shutdown
A new master assumes the virtual address and announces it (gratuitous ARP for IPv4, unsolicited neighbor advertisement for IPv6). wren show vrrp prints the state.
Configure the first router
The lab configures priority 200 on router A. Router B uses the same VRID and virtual address with a lower priority.
router-id = "10.0.0.1"
[[vrrp]]
interface = "veth0"
vrid = 51
priority = 200
advert-interval = 300
virtual-address = ["10.0.0.254"]
prefix-length = 24
Observe the result
bash scripts/vrrp-smoke.sh
On a separate running instance, inspect the same state:
wren show vrrp
ip -4 addr show dev veth0
The fixture checks that only A holds 10.0.0.254 initially, then checks that B assumes the address after A stops.
Track the right link
Use the uplink tracking lab to lower effective priority when a tracked interface fails. With address-interface, elections can run on a separate interface from the VIP. The address ownership test exercises removal and recreation of the serving link.
Appliance forwarding authority
VRRP manages address ownership. Sentinel can additionally gate forwarding on a lease from an independent witness. Its explicit two-node mode has different partition guarantees: two isolated members cannot distinguish peer failure from loss of every control path. Use the Sentinel operator handbook for appliance enrollment and failover procedures.