Wireguard: wg0: Could not create IPv4 socket

Hello,

I have an AR750S with 3.201 Firmware.
In the past I have been using a wireguard client connection.
But this is not working anymore, I get the error message “VPN client failed to connect” and when I look into the logs I find the message:

kern.err kernel: [ 96.100177] wireguard: wg0: Could not create IPv4 socket

I have checked everything I can connect to the wireguard server from my laptop but not from the router. The configuration has been working in the past, I did not change anything.
I think the last time I used the wireguard connection was with the previous firmware version.
Is there a known bug with wireguard in the current firmware?

Maybe it is related to port, what port are you using for wireguard?

Use the following command to find out the ports in use on the router

netstat -tulpn

I am using port 55815 for wireguard and it has been working on this port in the past.
The netstat cmd only shows dnsmasq listening on port 53, dropbear on 22, lighthttp on 80,83,443.
For the wireguard port I get:

udp 0 0 0.0.0.0:55815 0.0.0.0:* -

So it does not show a PID or Progamm name for this entry.

Are you able to try other ports?

OK, this is really odd.
I changed the port in my wireguard client configuration and the connection was immediately established. So far so good, next I changed the port back to the old one and the connection was also established.
It is working again but I don’t really know why. I did not do anything other than use another port for a minute.
I just hope now it is stable like this and is not a recurring thing.