OPNsense plugin for VRRP (Virtual Router Redundancy Protocol) using the freevrrpd daemon.
This plugin integrates VRRP as a first-class VIP type in OPNsense, alongside the existing CARP, IP Alias, and Proxy ARP modes. VRRP VIPs are configured through the standard Virtual IPs interface and managed by the freevrrpd daemon.
- VRRP VIP mode in Interfaces > Virtual IPs
- Automatic freevrrpd daemon management
- Netgraph-based virtual interfaces (ngeth)
- PF firewall anchor for VRRP traffic
- CARP/VRRP mutual exclusivity per interface
- OPNsense 25.1 or later
- freevrrpd daemon (patched version with proper restart handling)
Requires FreeBSD and the OPNsense plugins repository.
# Clone plugins repo and add this plugin
git clone https://github.com/opnsense/plugins.git
cd plugins/sysutils
git clone --recurse-submodules https://github.com/chall37/os-freevrrpd.git
# Build freevrrpd from submodule and package everything
cd os-freevrrpd
./build.shThe freevrrpd daemon is built from the chall37/FreeVRRPd submodule, which includes fixes for proper daemon restart handling. This will be switched to upstream once the fixes are merged.
pkg add os-freevrrpd-<version>.pkgThe plugin:
- Installs the embedded freevrrpd daemon
- Patches OPNsense core files to add VRRP support
- Registers service hooks and firewall anchor
All patches are reverted on uninstall.
- Navigate to Interfaces > Virtual IPs
- Click Add
- Select VRRP as the mode
- Configure:
- Interface: The interface for VRRP advertisements
- Address: The virtual IP address
- VRID: Virtual Router ID (1-255), must be unique per interface
- Priority: Router priority (1-254), higher = more likely to be master
- Password: Optional authentication (max 8 characters)
DHCP servers do not automatically advertise the VRRP VIP as the gateway. You must manually configure DHCP options:
In Services > Dnsmasq DNS & DHCP > DHCP Options, add:
- Option 3 (router): Set to your VRRP VIP
- Option 6 (dns-server): Set to your VRRP VIP
Additionally, add listen-address=<VIP> to /usr/local/etc/dnsmasq.conf.d/ so DHCP responses come from the VIP.
In Services > DHCPv4 > [Interface], set:
- Gateway: Your VRRP VIP
- DNS servers: Your VRRP VIP
-
VIP Model Extension: The plugin patches
Vip.xmlto addvrrpmode and VRRP-specific fields (vrid, priority, password, etc.) -
Interface Whitelisting: Patches
interfaces.incso services recognize VRRP VIPs as valid interface addresses -
Daemon Management: The
freevrrpd.incplugin hook manages the freevrrpd daemon lifecycle, starting/stopping based on VRRP VIP presence -
Netgraph Interfaces: freevrrpd creates ngeth interfaces with virtual MAC addresses (00:00:5e:00:01:XX) for each VRID
-
Firewall Integration: A PF anchor allows traffic from VRRP-enabled subnets on ngeth interfaces, placed before antispoof rules
build.sh # Build script
freevrrpd/ # Daemon submodule (chall37 fork)
contrib/Makefile # Installs built daemon into package
+POST_INSTALL # Plugin post-install script
+PRE_DEINSTALL # Plugin pre-deinstall script
src/
etc/inc/plugins.inc.d/
freevrrpd.inc # Service hooks and VIP lifecycle
opnsense/
scripts/OPNsense/Freevrrpd/
patch_core.php # Core file patcher (install/uninstall)
service/
conf/actions.d/
actions_freevrrpd.conf # configd actions
templates/OPNsense/Freevrrpd/
freevrrpd.conf # Daemon config template
freevrrpd.pf.conf # PF rules template
BSD 2-Clause License