wg-quick fails with: Failed to resolve interface "tun": No such device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
wireguard (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
After I upgraded to Ubuntu 22.10 today, wg-quick started to fail with the abovementioned message when I try to run it as I used to:
sudo wg-quick up mycfg
[#] ip link add mycfg type wireguard
[#] wg setconf mycfg /dev/fd/63
[#] ip -4 address add 10.6.0.32/24 dev mycfg
[#] ip link set mtu 1420 up dev mycfg
[#] resolvconf -a tun.mycfg -m 0 -x
Failed to resolve interface "tun": No such device
[#] ip link delete dev mycfg
I've found out the following link: https:/
but I don't understand how exactly the solution works, and I thought I'd better discuss it with you guys as well. Thank you :)
ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: wireguard-tools 1.0.20210914-
ProcVersionSign
Uname: Linux 5.19.0-19-generic x86_64
ApportVersion: 2.23.1-0ubuntu2
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct 11 20:36:29 2022
InstallationDate: Installed on 2022-09-24 (17 days ago)
InstallationMedia: Ubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809.1)
SourcePackage: wireguard
UpgradeStatus: Upgraded to kinetic on 2022-10-11 (0 days ago)
Changed in wireguard (Ubuntu): | |
status: | Invalid → Confirmed |
Hello and thank you for taking the time to report a bug.
It is not clear from your description what the problem might be. It seems like you're not using systemd-resolved as your resolver, is that correct?
I tried configuring wireguard in a system with and without systemd-resolved active. When systemd-resolved is running, wireguard can successfully adjust /etc/resolv.conf (assuming that there's a DNS entry in the wireguard configuration file). If you choose to disable systemd-resolved and write your own /etc/resolv.conf, you will need to manually invoke the commands to adjust the file yourself. You should also see a warning like this:
[#] resolvconf -a tun.mul -m 0 -x /update. d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf /resolv. conf
/etc/resolvconf
But what you're seeing is different: it seems like your kernel doesn't have the tun interface setup.
Could you please paste the contents of your wireguard configuration file (taking care to remove any sensitive data)?
For what it's worth, we also have an extensive guide explaining how to set up wireguard:
https:/ /ubuntu. com/server/ docs/wireguard- vpn-introductio n
I am marking this bug as Incomplete for now while we wait for more info from your side. Feel free to mark it as New again when you provide the requested data. Thanks.