TransWikia.com

Wireguard "Unknown device type" "Protocol not supported"

Raspberry Pi Asked on December 22, 2021

I recently installed Raspberry Pi OS on my Pi 3b. After some basic configuration and running raspi-config, I installed wireguard using apt and the debian backport repos, according to a tutorial.

I wasn’t able to start the service though:

# systemctl start wg-quick@wg0
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.

# journalctl -u wg-quick@wg0
raspberrypi systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
raspberrypi wg-quick[1773]: [#] ip link add wg0 type wireguard
raspberrypi wg-quick[1773]: Error: Unknown device type.
raspberrypi wg-quick[1773]: Unable to access interface: Protocol not supported
raspberrypi wg-quick[1773]: [#] ip link delete dev wg0
raspberrypi wg-quick[1773]: Cannot find device "wg0"
raspberrypi systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
raspberrypi systemd[1]: [email protected]: Failed with result 'exit-code'.
raspberrypi systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.

The key lines are Unknown device type and Unable to access interface: Protocol not supported. It seems like wireguard isn’t able to create a new wireguard interface, as if the kernel module didn’t exist…

3 Answers

For those that have the same issue but had a working wireguard set-up, (Linux headers were installed in the past) a bad kernel update may provoke a Linux headers mismatch.

I tried the following command:

sudo dpkg-reconfigure raspberrypi-kernel-headers

and that solved my issue.

Answered by gabrielgbs97 on December 22, 2021

I haven't followed the tutorial you used but wireguard is heavy under development and there are some outdated installation tutorials on the web. Try this Wireguard installation that uses an official backport from Debian Bullseye. I have just tested it again with success.

Answered by Ingo on December 22, 2021

According to a comment on r/Wireguard, this error is caused by having the wrong kernel headers:

dkms packages (wireguard-dkms this time) need kernel headers for current kernel you have loaded (uname -a). As long as kernel is updated through apt or aptitude you should not run into problems, but if you update kernel with rpi-update you'll likely get newer kernel than what is available through package repository and there will be no headers available for it

The Foundation now offers headers for the rpi kernel, they just have to be installed. From the official online documentation on kernel headers:

If you are compiling a kernel module or similar, you will need the Linux Kernel headers. These provide the various function and structure definitions required when compiling code that interfaces with the kernel.

sudo apt install raspberrypi-kernel-headers

Note that it can take quite a while for this command to complete, as it installs a lot of small files. There is no progress indicator.

After installing raspberrypi-kernel-headers, and rebooting, Wireguard started normally.

Answered by Keith on December 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP