You may have encountered the RTNETLINK answers: Operation not supported error when trying to start your wg0 interface on Debian 10. This post will show you how to fix that.

The issue is that the Linux headers were not installed when loading the kernel module. TO fix this w will need to do the following:

Install the Linux Kernel Headers

This can sometimes be fixed with

sudo apt upgrade

If not, then to fix this, we need to need to install the Kernel headers.

uname -r

Search if your Kernel headers are in the repositories.

apt search linux-headers-$(uname -r)

If so then install them and skip down to the reconfigure section:

apt install linux-headers-$(uname -r)

If not, we’ll need to upgrade your Kernel. My Kernel was 4.19.0.10 so I did a search for 4.19.0 and found 4.19.0.11. This will be a minnor release so nothing to be too worried about.

apt search linux-headers-*

Install the new Kernel and Reboot

apt install linux-image-4.19.0-11-cloud-amd64
reboot

Install the headers for your Kernel

apt install linux-headers-4.19.0-11-cloud-amd64

Reconfiguring the Wireguard Kernel Module

Reconfigure your dkms module and load it.

dpkg-reconfigure wireguard-dkms
modprobe wireguard