Scenario
You are operating an OPNsense HA pair in active/passive. The following symptoms appear:
- Master node becomes unreachable but the cluster does not fail over
- Virtual IPs disappear from the network; downstream devices lose connectivity
- Backup node still shows BACKUP status after master loss
Available evidence:
ifconfigon the backup showscarp: INITon the VIP parent interface, rather than BACKUP or MASTERtcpdump -n -i <parent> proto carpon the backup shows no advertisements from the master on the interface the VIP is bound tonet.inet.carp.demotionon the backup is non-zero, or the VHID does not match the master
Your task
Determine the cause, recover, document, and validate.
Investigation
The investigation follows the discipline taught in Part XXVII:
- Form hypothesis, find evidence, test, validate.
- Use the available evidence above to bound the search.
- Reach one of the likely root causes.
Recovery procedure
(Do not reveal until you have reasoned through the problem.)
- Identify the failing component.
- Apply the remediation pathway.
- Validate with the verification step.
- Document the incident.
Remediation
- On the backup, run
ifconfigagainst the VIP parent interface — read thecarp:line and thennet.inet.carp.demotion. If the counter is non-zero, subtract exactly what was added; writing 0 does nothing, because the sysctl adjusts rather than assigns. 2. Runtcpdump -n -i <parent> proto carpon both sides, on the interface the VIP is bound to, and verify the master’s advertisements are seen. 3. Check that VHID, advbase, advskew and password match between peers;netstat -s -p carpshows a rising “discarded for bad authentication” count when the password is wrong. 4. Make sure the firewall rules on that parent interface pass protocol CARP and the switch is not filtering224.0.0.18. 5. Test by demoting the master — Interfaces → Virtual IPs → Status → Enter Persistent CARP Maintenance Mode — or by pulling the master’s parent link.
Verification
The backup transitions to MASTER within about three advertisement intervals (3 × advbase, plus the advskew fraction of a second); VIPs migrate; downstream connectivity resumes. Test by demoting the master.
Rollback
Re-enable CARP on the original master; verify both nodes return to expected roles.
Prevention
Treat every VIP parent interface as part of the HA control plane: it must pass protocol CARP and reach the multicast group 224.0.0.18 on both nodes. Keep the sync interface separate, with its own VLAN and a rule passing IP protocol pfsync (240) between the two sync addresses. Verify VHID/advbase/advskew with a config-diff job. Run a quarterly failover test in maintenance windows.