当前位置:   article > 正文

如何在Debug模式下运行xl2tpd_ipsec saref does not work with l2tp kernel mode ye

ipsec saref does not work with l2tp kernel mode yet, enabling force userspac

如果你已经在你的Linux上安装了xl2tpd(关于如何安装请参考文档如何在Ubuntu18.04上安装与配置l2tp server),那么只需要运行

$xl2tpd -D

运行时会报如下错误:

 open_controlfd: Unable to open /var/run/xl2tpd/l2tp-control for reading

提示缺少某控制文件。解决方法很简单,创建一个空的该名字的文件。但是要用root权限

 $sudo touch /var/run/xl2tpd/l2tp-control

这时候再运行$xl2tpd -D 就会以Debug模式运行xl2tpd应用了。当然在运行这个之前先要把该服务停了(如果该服务已经起来了的话) ,命令是$sudo service xl2tpd stop,运行成功后可以通过命令$sudo service xl2tpd status来查看是否该服务已经停止。

在Debug模式下,可以在运行的终端(或窗口)上直接看到xl2tpd进程的运行状态,如下:

xl2tpd[1460]: IPsec SAref does not work with L2TP kernel mode yet, enabling force userspace=yes
xl2tpd[1460]: Not looking for kernel SAref support.
xl2tpd[1460]: Not looking for kernel support.
xl2tpd[1460]: xl2tpd version xl2tpd-1.3.12 started on minipc-H81U PID:1460
xl2tpd[1460]: Written by Mark Spencer, Copyright (C) 1998, Adtran, Inc.
xl2tpd[1460]: Forked by Scott Balmos and David Stipp, (C) 2001
xl2tpd[1460]: Inherited by Jeff McAdams, (C) 2002
xl2tpd[1460]: Forked again by Xelerance (www.xelerance.com) (C) 2006-2016
xl2tpd[1460]: Listening on IP address 0.0.0.0, port 1701

如果需要更多的Debug信息,需要修改/etc/xl2tpd/xl2tpd.conf文件,

[global]
ipsec saref = no
debug tunnel = yes
debug avp = yes
debug network = yes
debug state = yes
access control = no
port = 1701
auth file = /etc/ppp/chap-secrets
 
[lns default]
ip range = 192.168.18.1 - 192.168.18.254
local ip = 192.168.18.162
name = l2tp
pass peer = yes
refuse pap = yes
refuse chap = yes
require authentication = yes
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
 

把需要提供debug信息的内容选项改为yes。这时候再运行$xl2tpd -D可以看到更多相关调试信息输出在终端(窗体)。但是如果消息太多刷屏,也无法找到我们需要的信息。这时候可以把输出消息全部写入某文件。如:

 $ xl2tpd -D &>xl2tpd.txt

这时候,调试信息全部写到xl2tpd.txt文件里了。通过这些调试信息,我们可以知道为什么ppp信道建立失败,如何调整信道吞吐量等。 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/188919
推荐阅读
相关标签
  

闽ICP备14008679号