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:
- I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
- I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue
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:
- Have a Wireguard interface setup similar to https://docs.opnsense.org/manual/how-tos/wireguard-client-mullvad.html#
- Restart Opnsense
- Interface will be down at time of boot, error message in Wireguard logs
- Manually disabling and enabling interface will bring the connection up right away
Expected behavior
Wireguard interfaces should start at boot
Screenshots
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)
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.