[GH-ISSUE #261] linux配置vpn客户端时,service xl2tpd restart 不成功 #243

Closed
opened 2026-03-02 08:00:45 +03:00 by kerem · 2 comments
Owner

Originally created by @karmen on GitHub (Oct 27, 2021).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/261

问题描述
服务端已搭建好,问题出现在linux配置vpn客户端,按照 https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#%E4%BD%BF%E7%94%A8%E5%91%BD%E4%BB%A4%E8%A1%8C%E9%85%8D%E7%BD%AE-linux-vpn-%E5%AE%A2%E6%88%B7%E7%AB%AF 步骤,运行 service xl2tpd restart 出现以下:

[root@iZwz97d32td9ogxvfk37tlZ gzmh]# service xl2tpd restart
Redirecting to /bin/systemctl restart xl2tpd.service
Job for xl2tpd.service failed because the control process exited with error code.
See "systemctl status xl2tpd.service" and "journalctl -xe" for details.
[root@iZwz97d32td9ogxvfk37tlZ gzmh]# systemctl status xl2tpd.service
● xl2tpd.service - Level 2 Tunnel Protocol Daemon (L2TP)
Loaded: loaded (/usr/lib/systemd/system/xl2tpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2021-10-27 15:05:27 CST; 9s ago
Process: 700223 ExecStart=/usr/sbin/xl2tpd -D (code=exited, status=1/FAILURE)
Process: 700404 ExecStartPre=/sbin/modprobe -q l2tp_ppp (code=exited, status=1/FAILURE)
Main PID: 700223 (code=exited, status=1/FAILURE)

Oct 27 15:05:27 iZwz97d32td9ogxvfk37tlZ systemd[1]: Starting Level 2 Tunnel Protocol Daemon (L2TP)...
Oct 27 15:05:27 iZwz97d32td9ogxvfk37tlZ systemd[1]: xl2tpd.service: Control process exited, code=exited status=1
Oct 27 15:05:27 iZwz97d32td9ogxvfk37tlZ systemd[1]: xl2tpd.service: Failed with result 'exit-code'.
Oct 27 15:05:27 iZwz97d32td9ogxvfk37tlZ systemd[1]: Failed to start Level 2 Tunnel Protocol Daemon (L2TP).

重现步骤
重现该 bug 的步骤:
完全按照文档,进行到 service xl2tpd restart

期待的正确结果
service xl2tpd restart 正常

日志
启用日志,检查 VPN 状态,并且添加错误日志以帮助解释该问题(如果适用)。

服务器信息(请填写以下信息)

  • Docker 主机操作系统: [比如 Ubuntu 20.04]
  • 服务提供商(如果适用): [比如 GCP, AWS]

客户端信息(请填写以下信息)

  • 设备: linux
  • 操作系统: centos8
  • VPN 模式: [IPsec/L2TP]

其它信息

谢谢

Originally created by @karmen on GitHub (Oct 27, 2021). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/261 **问题描述** 服务端已搭建好,问题出现在linux配置vpn客户端,按照 https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#%E4%BD%BF%E7%94%A8%E5%91%BD%E4%BB%A4%E8%A1%8C%E9%85%8D%E7%BD%AE-linux-vpn-%E5%AE%A2%E6%88%B7%E7%AB%AF 步骤,运行 **service xl2tpd restart** 出现以下: [root@iZwz97d32td9ogxvfk37tlZ gzmh]# service xl2tpd restart Redirecting to /bin/systemctl restart xl2tpd.service Job for xl2tpd.service failed because the control process exited with error code. See "systemctl status xl2tpd.service" and "journalctl -xe" for details. [root@iZwz97d32td9ogxvfk37tlZ gzmh]# systemctl status xl2tpd.service ● xl2tpd.service - Level 2 Tunnel Protocol Daemon (L2TP) Loaded: loaded (/usr/lib/systemd/system/xl2tpd.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2021-10-27 15:05:27 CST; 9s ago Process: 700223 ExecStart=/usr/sbin/xl2tpd -D (code=exited, status=1/FAILURE) Process: 700404 ExecStartPre=/sbin/modprobe -q l2tp_ppp (code=exited, status=1/FAILURE) Main PID: 700223 (code=exited, status=1/FAILURE) Oct 27 15:05:27 iZwz97d32td9ogxvfk37tlZ systemd[1]: Starting Level 2 Tunnel Protocol Daemon (L2TP)... Oct 27 15:05:27 iZwz97d32td9ogxvfk37tlZ systemd[1]: xl2tpd.service: Control process exited, code=exited status=1 Oct 27 15:05:27 iZwz97d32td9ogxvfk37tlZ systemd[1]: xl2tpd.service: Failed with result 'exit-code'. Oct 27 15:05:27 iZwz97d32td9ogxvfk37tlZ systemd[1]: Failed to start Level 2 Tunnel Protocol Daemon (L2TP). **重现步骤** 重现该 bug 的步骤: 完全按照文档,进行到 service xl2tpd restart **期待的正确结果** service xl2tpd restart 正常 **日志** [启用日志](https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/README-zh.md#启用-libreswan-日志),检查 [VPN 状态](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#检查日志及-vpn-状态),并且添加错误日志以帮助解释该问题(如果适用)。 **服务器信息(请填写以下信息)** - Docker 主机操作系统: [比如 Ubuntu 20.04] - 服务提供商(如果适用): [比如 GCP, AWS] **客户端信息(请填写以下信息)** - 设备: linux - 操作系统: centos8 - VPN 模式: [IPsec/L2TP] **其它信息** 谢谢
kerem closed this issue 2026-03-02 08:00:45 +03:00
Author
Owner

@hwdsl2 commented on GitHub (Oct 28, 2021):

@karmen 你好!这个是因为系统内核缺少 l2tp_ppp 模块导致的。按照以下步骤修复:

sed -i '/^ExecStartPre=\//s/=/=-/' /usr/lib/systemd/system/xl2tpd.service
systemctl daemon-reload

然后即可正常 service xl2tpd restart

<!-- gh-comment-id:953465584 --> @hwdsl2 commented on GitHub (Oct 28, 2021): @karmen 你好!这个是因为系统内核缺少 l2tp_ppp 模块导致的。按照以下步骤修复: ``` sed -i '/^ExecStartPre=\//s/=/=-/' /usr/lib/systemd/system/xl2tpd.service systemctl daemon-reload ``` 然后即可正常 `service xl2tpd restart`。
Author
Owner

@3148397216 commented on GitHub (Jan 23, 2025):

没有找到这个文件

<!-- gh-comment-id:2609001452 --> @3148397216 commented on GitHub (Jan 23, 2025): 没有找到这个文件
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-ipsec-vpn-server#243
No description provided.