wireguard vpn 失败并出现错误:找不到设备“wg0”

wireguard vpn 失败并出现错误:找不到设备“wg0”

你好,我是 ubuntu 的新手,我大约 6 个月前安装了 wireguard,它运行良好,直到昨天我的 ubuntu 更新时,wirguard 无法启动,并显示以下状态:

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

这是我的 Ubuntu 版本:Ubuntu 18.04.4 LTS

答案1

尝试重新安装软件包wireguard-dkms(删除并重新安装)。之后可能需要重新启动。

答案2

运行以下命令:

sudo apt-get update
sudo apt-get upgrade
sudo systemctl enable --now systemd-resolved

并重启系统

它对我来说很有效,我希望它对你有帮助!

答案3

对我来说,@Błotosmętek一开始可以工作,但是在进行实验之后systemctl restart ...它就再也没有恢复,并出现以下错误:

Sep 10 10:46:46 ryzen wg-quick[6005]: RTNETLINK answers: File exists
Sep 10 10:46:46 ryzen wg-quick[5915]: [#] resolvconf -d tun.wg0 -f
Sep 10 10:46:46 ryzen wg-quick[5915]: [#] ip link delete dev wg0
Sep 10 10:46:46 ryzen systemd[1]: [email protected]: Main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 10 10:46:46 ryzen systemd[1]: [email protected]: Failed with result 'exit-code'.
Sep 10 10:46:46 ryzen systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.

因此采取了这里描述的网络管理器方式:https://www.xmodulo.com/wireguard-vpn-network-manager-gui.html

相关内容