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"
解决
远程登录权限不够。
作者:Yogile
出处:https://www.cnblogs.com/Yogile/p/17868440.html
版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构