![wireguard vpn 失败并出现错误:找不到设备“wg0”](https://linux22.com/image/925798/wireguard%20vpn%20%E5%A4%B1%E8%B4%A5%E5%B9%B6%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF%EF%BC%9A%E6%89%BE%E4%B8%8D%E5%88%B0%E8%AE%BE%E5%A4%87%E2%80%9Cwg0%E2%80%9D.png)
你好,我是 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