'RNETLINK answers: Operation not supported'. (fresh Ubuntu, fresh Wireguard)
I installed Ubuntu just today to run WireGuard
I then followed their installation instructions for Ubuntu.
sudo add-apt-repository ppa:wireguard/wireguard
sudo apt-get update
sudo apt-get install wireguard-dkms wireguard-tools
Unfortunately their 'Quick start' has been anything, but...
$ ip link add dev wg0 type wireguard
RNETLINK answers: Operation not supported
I checked headers, checked updates, etc. No dice.
Solution 1:
I face the same problem.... but I fix that by luck when I tried to install it with source compile in Wireguard website. I run the following and it is resolved:
sudo apt-get install libmnl-dev libelf-dev linux-headers-$(uname -r) build-essential pkg-config
Solution 2:
Just reboot, that should have fixed your problem.
But still: Wireguard although it works fine for me is still in beta and not meant for daily use. From the developers website at wireguard.com:
Warning: WireGuard is currently under development, and therefore any installation steps here should be considered as experimental. We are rapidly working toward mainline inclusion, at which point we will consider this codebase non-experimental.
Solution 3:
Most probably the wireguard
kernel module is not loaded.
Just try a modprobe wireguard
. If this shows an error, the problem is that the module did not compile correctly for your kernel. This, most probably, is because wireguard is still not completely "stable".
If this is the case, just wait for an update of wireguard, in case of such an error this should be the case within a few days, as the wireguard devs seem to fix these kind of problems very fast.
Solution 4:
With 18.04 bionic the wireguard dkms module wasn't built with a version of a 4.15.x kernel + headers for me (it was though in the past?). When upgrading to the recently available "hardware enablement" 4.18 kernel the module was successfully built (see output of dpkg-reconfigure wireguard
or dkms status wireguard
).
Check for necessary desktop/server package(s) installs in the ubuntu wiki.