首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >“wg的作业-快速@wg0.服务失败,因为控制进程与错误代码一起退出”

“wg的作业-快速@wg0.服务失败,因为控制进程与错误代码一起退出”
EN

Unix & Linux用户
提问于 2023-03-11 02:40:25
回答 1查看 1.1K关注 0票数 0

我试图在Ubuntu18.04位上安装wireguard,下面是视频教程之一。

步骤systemctl start wg-quick@wg0.service

代码语言:javascript
运行
复制
Job for wg-quick@wg0.service failed because the control process exited with error code. 
See "systemctl status wg-quick@wg0.service" and "journalctl -xe" for details.

运行systemctl status wg-quick@wg0.service提供:

代码语言:javascript
运行
复制
● wg-quick@wg0.service - WireGuard via wg-quick(8) for wg0
   Loaded: loaded (/lib/systemd/system/wg-quick@.service; indirect; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2023-03-11 00:02:48 UTC; 7min ago
     Docs: man:wg-quick(8)
           man:wg(8)
           https://www.wireguard.com/
           https://www.wireguard.com/quickstart/
           https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
           https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
  Process: 18984 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=1/FAILURE)
 Main PID: 18984 (code=exited, status=1/FAILURE)

Mar 11 00:02:48 my-vps.name systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
Mar 11 00:02:48 my-vps.name wg-quick[18984]: [#] ip link add wg0 type wireguard
Mar 11 00:02:48 my-vps.name wg-quick[18984]: RTNETLINK answers: Operation not supported
Mar 11 00:02:48 my-vps.name wg-quick[18984]: Unable to access interface: Protocol not supported
Mar 11 00:02:48 my-vps.name wg-quick[18984]: [#] ip link delete dev wg0
Mar 11 00:02:48 my-vps.name wg-quick[18984]: Cannot find device "wg0"
Mar 11 00:02:48 my-vps.name systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=1/FAILURE
Mar 11 00:02:48 my-vps.name systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'.
Mar 11 00:02:48 my-vps.name systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.

运行journalctl -xe显示:

代码语言:javascript
运行
复制
Mar 10 23:46:27 my-vps.name wg-quick[18951]: [#] ip link add wg0 type wireguard
Mar 10 23:46:27 my-vps.name wg-quick[18951]: RTNETLINK answers: Operation not supported
Mar 10 23:46:27 my-vps.name wg-quick[18951]: Unable to access interface: Protocol not supported
Mar 10 23:46:27 my-vps.name wg-quick[18951]: [#] ip link delete dev wg0
Mar 10 23:46:27 my-vps.name wg-quick[18951]: Cannot find device "wg0"

我的wg0.conf看起来像:

代码语言:javascript
运行
复制
[Interface]
PrivateKey = myprivatekeyhere
Address = 10.0.0.1/24
ListenPort = 51830
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o venet0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o venet0 -j MASQUERADE

modprobe wireguard说:

代码语言:javascript
运行
复制
modprobe: FATAL: Module wireguard not found in directory /lib/modules/4.15.0

ls /lib/modules返回:

代码语言:javascript
运行
复制
4.15.0  4.15.0-206-generic

uname -r显示:

代码语言:javascript
运行
复制
4.15.0

重新启动并没有帮助。搜索没有帮助。

EN

回答 1

Unix & Linux用户

发布于 2023-03-11 13:53:29

因此,是的,正如错误所述:您没有内核的wireguard模块,因此无法执行wireguard。

您需要构建并安装wireguard模块(因为您使用的是非常老的发行版,内核是旧的,所以没有内核内的wireguard,您需要单独安装它;如果启用了宇宙恢复功能,请安装wireguard-dkms。更好的是,更新到一个更现代的Ubuntu;从那时起已经有了两个长期的支持版本。Linux内核> 5.6的任何内容都可能包含了wireguard模块;因此,可以使用Ubuntu22.04)

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/739376

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档