BACKUP's downed WAN can be re-upped by rc.linkup / interface reconfigure (dual-WAN) #3

Closed
opened 2026-10-18 17:14:41 -07:00 by eric · 0 comments
Owner

Severity: High · Location: 10-wancarp:423-430 (BACKUP branch) and the runtime-only design in general

The BACKUP branch only takes WAN down in memory; config.xml still has enable=1, which the README prerequisite requires. Anything in OPNsense that re-reads the config and reconfigures the interface undoes the script, and no CARP event fires to correct it.

Confirmed path in OPNsense core:

  • src/etc/devd/ifnet.conf: a LINK_UP event runs configctl interface linkup start <dev>.
  • src/etc/rc.linkup: if the on-disk enable is set, it calls interface_configure(false, $interface, true, true). That brings WAN up, starts DHCP and restores the default route.

How it fails: the modem or ISP equipment reboots, a cable is re-seated, or (on virtio) the host toggles the link. A NIC that still reports carrier while administratively down (vtnet does, per the LOWER_UP notes) sends LINK_UP, and WAN comes up on the BACKUP while the MASTER also has it. That is the dual-WAN failure the script exists to prevent. Clicking Apply on the WAN page or running configctl interface reconfigure wan on the BACKUP does the same thing.

Suggested fix:

  • At least document the hazard in the README.
  • Better: add a reconcile step, such as a cron job that re-runs the script with the node's current CARP state (taken from ifconfig carp: lines), so drift gets fixed.
**Severity:** High · **Location:** `10-wancarp:423-430` (BACKUP branch) and the runtime-only design in general The BACKUP branch only takes WAN down in memory; `config.xml` still has `enable=1`, which the README prerequisite requires. Anything in OPNsense that re-reads the config and reconfigures the interface undoes the script, and no CARP event fires to correct it. Confirmed path in OPNsense core: - `src/etc/devd/ifnet.conf`: a `LINK_UP` event runs `configctl interface linkup start <dev>`. - `src/etc/rc.linkup`: if the on-disk `enable` is set, it calls `interface_configure(false, $interface, true, true)`. That brings WAN up, starts DHCP and restores the default route. **How it fails:** the modem or ISP equipment reboots, a cable is re-seated, or (on virtio) the host toggles the link. A NIC that still reports carrier while administratively down (vtnet does, per the `LOWER_UP` notes) sends `LINK_UP`, and WAN comes up on the BACKUP while the MASTER also has it. That is the dual-WAN failure the script exists to prevent. Clicking Apply on the WAN page or running `configctl interface reconfigure wan` on the BACKUP does the same thing. **Suggested fix:** - At least document the hazard in the README. - Better: add a reconcile step, such as a cron job that re-runs the script with the node's current CARP state (taken from `ifconfig` `carp:` lines), so drift gets fixed.
eric closed this issue 2026-10-18 17:24:56 -07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
eric/10-wancarp#3
No description provided.