Wireguard returns "RTNETLINK answers: No such device" error -> low MTU
I use a Wireguard VPN to tunnel my traffic when on public wifi - but I couldn't use Wireguard from a recent network! This specific network was causing Wireguard to fail with the error message "RTNETLINK answers: No such device."
I hadn't changed any configurations, so I was very confused why a device was missing!
I found the answer on the WireGuard mailing list, IPv6 requires MTU of at least 1280 - and when I ran ip a
I could see the public wifi only allowed up to 1270!
The fix for "RTNETLINK answers: No such device":
Disable IPv6 altogether (to prevent a leak if you do somehow switch back to IPv6
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1; sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1; sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
And update the AllowedIPs Wireguard config to exclude IPv6.
And you should be able to connect!
Reminder
If you need to re-enable IPv6 remember to revert the changes to your config file! The disabling of IPv6 DOES NOT persist between reboots. (You can disable IPv6 permanantly in /etc/sysctl.conf if needed.)