Wireguard 问题处理记录

1. resolvconf: command not found

问题描述

root@firewall:~# wg-quick up firewall
[#] ip link add firewall type wireguard
[#] wg setconf firewall /dev/fd/63
[#] ip -4 address add 10.0.1.2/24 dev firewall
[#] ip link set mtu 1420 up dev firewall
[#] resolvconf -a firewall -m 0 -x
/usr/bin/wg-quick: line 32: resolvconf: command not found
[#] ip link delete dev firewall
root@firewall:~# apt install resolvconf

解决

apt install openresolv

若仍然提示 resolvconf: command not found ,则试试 ssh root@127.0.0.1 。无法连接则调整权限: SSH连接报错 “Permission denied” 的解决方法 - Yogile - 博客园 (cnblogs.com)

若登陆后 wg-quick up firewall 执行正常,则说明:默认账户转 su 无法获取完整 root 权限。

/etc/sudoers.d 中, su -l root 添加文件 firewall (nano /etc/sudoers.d/firewall):

firewall   ALL=(ALL:ALL) ALL

输入 echo "<root密码>" | sudo -S wg-quick up firewall ,即可命令行执行程序。

来源

2. Unable to access interface: No such device

问题描述

root@firewall:~# wg-quick up firewall
[#] ip link add firewall type wireguard
[#] wg setconf firewall /dev/fd/63
Temporary failure in name resolution: `example:51820'. Trying again in 1.00 seconds...
Temporary failure in name resolution: `example:51820'. Trying again in 1.10 seconds...
^C[#] ip link delete dev firewall
Unable to access interface: No such device
[#] ip link delete dev firewall
Cannot find device "firewall"

解决

远程登录权限不够。

posted @ 2023-11-30 21:38  Yogile  阅读(805)  评论(0编辑  收藏  举报