wireguard assignment with wg0 (resolved)

Started by bucky2780, June 07, 2021, 04:20:50 AM

Previous topic - Next topic
June 07, 2021, 04:20:50 AM Last Edit: June 07, 2021, 04:27:59 AM by bucky2780
I am working through the road warrior setup of wireguard in the opnsense docs.

when it comes to assignment/routing I have a showstopper that mystifies me.

I assign wg0 as an interface. But when I try to enable it I get the following error....

>>
The following input errors were detected:

    The DHCP Server is active on this interface and it can be used only with a static IP configuration. Please disable the DHCP Server service on this interface first, then change the interface configuration.
>>
However ipv4 config type is defined as (none)... so that can't be the problem.

really confusing... so any ideas are appreciated.


I deleted the existing wg0 assignment, and re-added it. I was able to save it while enabling it without getting the dhcp error. Looks like the uI was holding on to something....

I encountered the same issue but deleting/re-adding the wgX assignment didn't solve it for me.

In my case, it turned out there was a
<dhcpd>...</dhcpd> section in the
/conf/config.xml file that contained a legacy ISC-DHCPD configuration from waaaay back when I used that - despite having migrated to Kea DHCP already ages ago. It seems OPNsense does not delete configuration for services/tools that are being disabled/uninstalled - maybe that's for a restore scenario where you re-install/re-enable that service... who knows.

Root cause for the error message:

Back in the days when I used ISC-DHCPD, one of my networks was configured on the
opt4 identifier, which later got freed up by a network redesign and then got re-used when I set up Wireguard.

It appears that when attempting to enable the new Wireguard interface, OPNsense still evaluated the old ISC-DHCPD configuration for the
opt4 identifier - which (obviously) had DHCP enabled and therefore threw the error:

The following input errors were detected:

The DHCP Server is active on this interface and it can be used only with a static IP configuration. Please disable the DHCP Server service on this interface first, then change the interface configuration.

The solution was to SSH into the OPNsense box, manually edit
/conf/config.xml and remove the
<opt4>...</opt4> section that was nested inside the
<dhcpd>...</dhcpd> section of the XML code.

With this fix in place, I was able to enable the Wireguard interface.