Xl2tpd + pppd 隧道持续错误

Xl2tpd + pppd 隧道持续错误

我遇到的问题与从 Raspberry pi3 到我们的 radius 服务器的 l2tp 隧道有关。如果服务器超过一分钟没有响应,则 xl2tpd 创建的“ppp0”接口将被删除。当我在 /etc/ppp/options.l2tpd.client 中输入“persist”选项时,它应该尝试保持接口打开或在断开连接后重新连接隧道。相反,我收到错误 @failed to open /dev/pts/1",如下所示,它无法再找到伪终端。一旦发生此错误,它就会无限地发送垃圾邮件并且不会重新连接隧道。

如果守护进程重新启动或设备重新启动,xl2tpd 的系统日志连接成功并正常工作

Feb 22 12:08:16 raspbx xl2tpd[3270]: Call established with (my server IP), Local: 34997, Remote: 472, Serial: 1 (ref=0/0)
Feb 22 12:08:16 raspbx xl2tpd[3270]: start_pppd: I'm running:
Feb 22 12:08:16 raspbx xl2tpd[3270]: "/usr/sbin/pppd"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "passive"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "nodetach"
Feb 22 12:08:16 raspbx xl2tpd[3270]: ":"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "auth"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "require-chap"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "name"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "(my username)"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "debug"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "file"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "/etc/ppp/options.l2tpd.client"
Feb 22 12:08:16 raspbx xl2tpd[3270]: "/dev/pts/1"
Feb 22 12:08:16 raspbx xl2tpd[3270]: network_thread: recv packet from (my server IP), size = 25, tunnel = 30600, call = 34997 ref=0 refhim=0
Feb 22 12:08:16 raspbx xl2tpd[3270]: network_thread: recv packet from (my server IP), size = 12, tunnel = 30600, call = 0 ref=0 refhim=0
Feb 22 12:08:16 raspbx pppd[3271]: pppd 2.4.6 started by root, uid 0
Feb 22 12:08:16 raspbx pppd[3271]: using channel 2
Feb 22 12:08:16 raspbx pppd[3271]: Using interface ppp0
Feb 22 12:08:16 raspbx pppd[3271]: Connect: ppp0 <--> /dev/pts/1

断开连接时系统日志显示错误“无法打开 /dev/pts/1”

Feb 22 12:08:57 raspbx xl2tpd[3270]: network_thread: recv packet from (my server IP), size = 18, tunnel = 30600, call = 34997 ref=0 refhim=0
Feb 22 12:08:57 raspbx pppd[3271]: rcvd [LCP EchoReq id=0x25 magic=0x7b1f8a41]
Feb 22 12:08:57 raspbx pppd[3271]: sent [LCP EchoRep id=0x25 magic=0x35a02f8e]
Feb 22 12:09:01 raspbx CRON[3340]: (root) CMD (  [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean)
Feb 22 12:09:01 raspbx CRON[3341]: (asterisk) CMD ([ -x /var/www/html/admin/modules/dashboard/scheduler.php ] && /var/www/html/admin/modules/dashboard/scheduler.php)
Feb 22 12:09:16 raspbx xl2tpd[3270]: network_thread: select timeout
Feb 22 12:09:17 raspbx xl2tpd[3270]: network_thread: select timeout
Feb 22 12:09:18 raspbx xl2tpd[3270]: network_thread: select timeout
Feb 22 12:09:19 raspbx xl2tpd[3270]: network_thread: select timeout
Feb 22 12:09:20 raspbx xl2tpd[3270]: network_thread: select timeout
Feb 22 12:09:21 raspbx xl2tpd[3270]: network_thread: select timeout
Feb 22 12:09:21 raspbx xl2tpd[3270]: Maximum retries exceeded for tunnel 30600.  Closing.
Feb 22 12:09:21 raspbx pppd[3271]: Modem hangup
Feb 22 12:09:21 raspbx pppd[3271]: Connect time 1.1 minutes.
Feb 22 12:09:21 raspbx pppd[3271]: Sent 7777 bytes, received 1199 bytes.
Feb 22 12:09:21 raspbx pppd[3271]: Script /etc/ppp/ip-down started (pid 3419)
Feb 22 12:09:21 raspbx pppd[3271]: Connection terminated.
Feb 22 12:09:21 raspbx avahi-daemon[455]: Withdrawing workstation service for ppp0.
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory
Feb 22 12:09:21 raspbx pppd[3271]: Failed to open /dev/pts/1: No such file or directory

这是我的 xl2tpd 和 pppd 的配置文件。/etc/xl2tpd/xl2tpd.conf

[global]
access control = no
auth file = /etc/ppp/chap-secrets
debug avp = yes
debug network = yes
debug packet = yes
debug state = yes
debug tunnel = yes

[lac MY_LNS]
lns = (my server IP)
redial = yes
redial timeout = 5
require chap = yes
require authentication = yes
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd.client
require pap = no
autodial = yes
name = (my username)

/etc/ppp/options.lt2pd.client

ipcp-accept-local
ipcp-accept-remote
refuse-eap
require-mschap-v2
persist
noccp
noauth
mtu 1410
mru 1410
usepeerdns
debug
lock
connect-delay 5000
name (my username)
password (my password)

我需要隧道自动以相同的接口名称重新启动,以维护我的防火墙参数和路由。我目前可以使用名为 monit 的守护程序来监视 PID 文件并重新启动 xl2tpd 守护程序来实现这一点,但这并不理想,我只想修复手头的问题。raspberry Pi3 正在运行 Debian(jessie)。

软件包的版本如下所示

xl2tpd   1.3.6+dfsg-2               armhf  
ppp     2.4.6-3.1                   armhf
ntp     1:4.2.6.p5+dfsg-7+deb8u     armhf     

如果您有任何其他要求请告诉我,我对此还很陌生,并且不太熟悉 Linux 如何处理大量后台操作,所以请慢慢来。

提前感谢你的帮助:)

相关内容