Wireguard VPN - How to fix Operation not supported if it worked before?

matt3o picture matt3o · Jun 13, 2020 · Viewed 8.7k times · Source

Trying to get up my VPN interface with sudo wg-quick down wg0;sudo wg-quick up wg0 raised:

RTNETLINK answers: Operation not supported Unable to access interface: Protocol not supported

I am not sure what happened but the only thing I did was reboot. I did not update my packages. Still something apparently changed.

Answer

MiSHuTka picture MiSHuTka · Mar 15, 2021

In my case there were no appropriate kernel headers installed.

First you need to know your current kernel version:

# uname --kernel-release
4.19.0-14-cloud-amd64

Important part here is "cloud-amd64" (there are several versions of "linux-headers-..." package, use apt list linux-headers-* to see what is available).

Then install appropriate kernel headers (I'm using Debian):

# apt install linux-headers-cloud-amd64

Then re-install wireguard-dkms package:

# apt install --reinstall wireguard-dkms

Reboot your OS:

# reboot