Hi,
I'm using OpenVPN on Rpi2 via an internet connection on 4G key. For that i use wvdial.
My problem is this:
Occasionally, wvdial restarts the ppp connection because of LCP terminated by peer.
So wvdial restart the connection.
Some log :
Oct 15 12:14:20 observer-5 pppd[286]: LCP terminated by peer
Oct 15 12:14:20 observer-5 pppd[286]: Connect time 10241.3 minutes.
Oct 15 12:14:20 observer-5 systemd-networkd[244]: ppp0: Lost carrier
Oct 15 12:14:20 observer-5 pppd[286]: Sent 8796578 bytes, received 8307896 bytes.
Oct 15 12:14:20 observer-5 pppd[286]: Modem hangup
Oct 15 12:14:20 observer-5 pppd[286]: Connection terminated.
Oct 15 12:14:21 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:21 observer-5 wvdial[280]: --> Connect time 10241.3 minutes.
Oct 15 12:14:21 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:21 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:21 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:21 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:21 observer-5 pppd[286]: Exit.
Oct 15 12:14:21 observer-5 wvdial[280]: --> Disconnecting at Thu Oct 15 12:14:21 2015
Oct 15 12:14:21 observer-5 wvdial[280]: --> The PPP daemon has died: A modem hung up the phone (exit code = 16)
Oct 15 12:14:21 observer-5 wvdial[280]: --> man pppd explains pppd error codes in more detail.
Oct 15 12:14:21 observer-5 wvdial[280]: --> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
Oct 15 12:14:21 observer-5 wvdial[280]: --> Auto Reconnect will be attempted in 5 seconds
Oct 15 12:14:21 observer-5 wvdial[280]: --> Initializing modem.
Oct 15 12:14:21 observer-5 wvdial[280]: --> Sending: ATZ
Oct 15 12:14:22 observer-5 wvdial[280]: ATZ
Oct 15 12:14:22 observer-5 wvdial[280]: OK
Oct 15 12:14:22 observer-5 wvdial[280]: --> Sending: ATQ0 V1 E1 S0=0
Oct 15 12:14:22 observer-5 wvdial[280]: ATQ0 V1 E1 S0=0
Oct 15 12:14:22 observer-5 wvdial[280]: OK
Oct 15 12:14:22 observer-5 wvdial[280]: --> Sending: AT+CGDCONT=1,"IP","orange.fr"
Oct 15 12:14:22 observer-5 wvdial[280]: AT+CGDCONT=1,"IP","orange.fr"
Oct 15 12:14:22 observer-5 wvdial[280]: OK
Oct 15 12:14:22 observer-5 wvdial[280]: --> Modem initialized.
Oct 15 12:14:22 observer-5 ntpd[254]: Deleting interface #4 ppp0, 10.24.209.46#123, interface stats: received=9, sent=11, dropped=0, active_time=9810 s
Oct 15 12:14:26 observer-5 wvdial[280]: --> Initializing modem.
Oct 15 12:14:26 observer-5 wvdial[280]: --> Sending: ATZ
Oct 15 12:14:26 observer-5 wvdial[280]: ATZ
Oct 15 12:14:26 observer-5 wvdial[280]: OK
Oct 15 12:14:26 observer-5 wvdial[280]: --> Sending: ATQ0 V1 E1 S0=0
Oct 15 12:14:26 observer-5 wvdial[280]: ATQ0 V1 E1 S0=0
Oct 15 12:14:26 observer-5 wvdial[280]: OK
Oct 15 12:14:26 observer-5 wvdial[280]: --> Sending: AT+CGDCONT=1,"IP","orange.fr"
Oct 15 12:14:26 observer-5 wvdial[280]: AT+CGDCONT=1,"IP","orange.fr"
Oct 15 12:14:26 observer-5 wvdial[280]: OK
Oct 15 12:14:26 observer-5 wvdial[280]: --> Modem initialized.
Oct 15 12:14:27 observer-5 wvdial[280]: --> Sending: ATDT*99***#
Oct 15 12:14:27 observer-5 wvdial[280]: --> Waiting for carrier.
Oct 15 12:14:27 observer-5 wvdial[280]: ATDT*99***#
Oct 15 12:14:27 observer-5 wvdial[280]: CONNECT
Oct 15 12:14:27 observer-5 wvdial[280]: --> Carrier detected. Starting PPP immediately.
Oct 15 12:14:27 observer-5 wvdial[280]: --> Starting pppd at Thu Oct 15 12:14:27 2015
Oct 15 12:14:27 observer-5 wvdial[280]: --> Pid of pppd: 474
Oct 15 12:14:27 observer-5 pppd[474]: pppd 2.4.7 started by root, uid 0
Oct 15 12:14:27 observer-5 pppd[474]: Using interface ppp0
Oct 15 12:14:27 observer-5 pppd[474]: Connect: ppp0 <--> /dev/ttyUSB3
Oct 15 12:14:27 observer-5 wvdial[280]: --> Using interface ppp0
Oct 15 12:14:27 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:27 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:27 observer-5 pppd[474]: CHAP authentication succeeded: Welcome!!
Oct 15 12:14:27 observer-5 pppd[474]: CHAP authentication succeeded
Oct 15 12:14:27 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:27 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:30 observer-5 pppd[474]: Could not determine remote IP address: defaulting to 10.64.64.64
Oct 15 12:14:30 observer-5 pppd[474]: Cannot determine ethernet address for proxy ARP
Oct 15 12:14:30 observer-5 systemd-networkd[244]: ppp0: Gained carrier
Oct 15 12:14:30 observer-5 pppd[474]: local IP address 10.219.95.66
Oct 15 12:14:30 observer-5 pppd[474]: remote IP address 10.64.64.64
Oct 15 12:14:30 observer-5 pppd[474]: primary DNS address 192.168.10.110
Oct 15 12:14:30 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:30 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:30 observer-5 wvdial[280]: --> local IP address 10.219.95.66
Oct 15 12:14:30 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:30 observer-5 wvdial[280]: --> remote IP address 10.64.64.64
Oct 15 12:14:30 observer-5 wvdial[280]: --> pppd: `<87>
Oct 15 12:14:30 observer-5 wvdial[280]: --> primary DNS address 192.168.10.110
Oct 15 12:14:30 observer-5 wvdial[280]: --> pppd: `<87>
But, openvpn can't restart :
Oct 15 12:16:16 observer-5 openvpn@client[238]: [server] Inactivity timeout (--ping-restart), restarting
Oct 15 12:16:16 observer-5 openvpn@client[238]: SIGUSR1[soft,ping-restart] received, process restarting
Oct 15 12:16:16 observer-5 openvpn@client[238]: Restart pause, 5 second(s)
Oct 15 12:16:21 observer-5 openvpn@client[238]: WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html
Oct 15 12:16:21 observer-5 openvpn@client[238]: Socket Buffers: R=[87380->131072] S=[16384->131072]
Oct 15 12:16:21 observer-5 openvpn@client[238]: Attempting to establish TCP connection with [AF_INET]***.****.****.****:**** [nonblock]
Oct 15 12:16:31 observer-5 openvpn@client[238]: TCP: connect to [AF_INET]****.****.****.****:**** failed, will try again in 5 seconds: Connection timed out
Oct 15 12:16:39 observer-5 openvpn@client[238]: TCP: connect to [AF_INET]****.****.****.****:**** failed, will try again in 5 seconds: No route to host
As you can see, openvpn says : "No route to host".
Because it doesn't see the new ppp interface ?
If I manualy restart OpenVPN, it works again.
I really need that my Rpis autoreconnect to my openvpn server when wvdial restart.
Do you have ideas to solve this problem?
I'm very happy to provide any details you require.
Regards,
Delgon