core: Wireguard interface not coming online after reboot - "required IPv4 interface address could not be found, skipping"

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

Some of my wireguard interfaces are not coming up on reboot with the below error message. Some time back, I was experiencing similar issues when using DNS endpoints but was able to fix it by using IP addresses instead. Now running into this problem. Appears as if some dependencies are not quite ready when Wireguard is starting.

2024-05-18T08:34:39-04:00 | Warning | wireguard | /usr/local/opnsense/scripts/Wireguard/wg-service-control.php: The required VPS1 IPv4 interface address could not be found, skipping.

I noticed this sometime during the 24.1.x versions but not sure exactly when it worked last.

To Reproduce

Steps to reproduce the behavior:

  1. Have a Wireguard interface setup similar to https://docs.opnsense.org/manual/how-tos/wireguard-client-mullvad.html#
  2. Restart Opnsense
  3. Interface will be down at time of boot, error message in Wireguard logs
  4. Manually disabling and enabling interface will bring the connection up right away

Expected behavior

Wireguard interfaces should start at boot

Screenshots instance peer interface

Environment

Software version used and hardware type if relevant, e.g.:

OPNsense 24.1.7-amd64 FreeBSD 13.2-RELEASE-p11 OpenSSL 3.0.13

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (5 by maintainers)

Most upvoted comments

  • Far Gateways is for a gateway outside the subnet, ie… your ip is 10.10.10.2 but gateway needs to be 192.168.1.1.
  • Dynamic Gateway policy is similar to far gateway but slightly different, both exist to allow non standard network configuration. Its only needed for some unusual use cases, but not for your case.

In your case, i believe the issue stems from having created a static gateway + defined a static gateway in wireguard. When the link comes up, Wireguard tries to add the gateway again but fails as it already exists, causing the error.

I assume you want to name your gateways appropriately. Well you can still rename dynamically created gateways by using the ‘clone’ function. After changing the name the old will disappear and your newly named version remains. If you wish to rename it later again you’ll need to delete it, then use the clone again.