2

The issue I am experiencing is based around a l2tp tunnel from a Raspberry pi3 to our radius server. If there is no response from the server for over a minuet the ‘ppp0’ interface made by xl2tpd gets deleted. When the ‘persist’ option is entered in my /etc/ppp/options.l2tpd.client it should try to keep the interface open or reconnect the tunnel once disconnected. Instead I get the error @failed to open /dev/pts/1" as shown below where it can no longer find the pseudo terminal. Once this error occurs it spams it infinity and does not reconnect the tunnel.

Syslog of xl2tpd connecting successfully and works fine if daemon is restarted or device rebooted

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

Syslog upon disconnect with the error “Failed to open /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

Here is my configuration files for xl2tpd and 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)

I need the tunnel to automatically come back up under the same interface name to maintain my firewall parameters and routing. I can currently do this by using a daemon called monit to monitor the PID file and restart the xl2tpd daemon, however this is not ideal and I would like to just fix the issue at hand. The raspberry Pi3 is running Debian(jessie).

Versions of the package shown below

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

If you require anything else let me know, I am new to this and am not super familiar with how linux handles alot of background operations, so go gentle.

Thanks for any help in advance :)

Sam Hester
  • 21
  • 3

0 Answers0