2

I have a raspbian client that is supposed to have an openvpn connection to a remote vpn server. This connection can be successfully establisehd, but after a day or so, it is broken. That is, the client is not able to ping the server anymore and vice-versa. ip addr yields:

6: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none
inet 10.8.0.2/24 brd 10.8.0.255 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::36f2:617b:b304:fd0c/64 scope link flags 800
   valid_lft forever preferred_lft forever

and service openvpn@Thomas status yields:

openvpn@Thomas.service - OpenVPN connection to Thomas
Loaded: loaded (/lib/systemd/system/openvpn@.service; enabled)
Active: active (running) since Fr 2017-08-18 21:48:29 CEST; 2 days ago
Process: 731 ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --config /etc/openvpn/%i.ovpn (code=exited, status=0/SUCCESS)
Main PID: 739 (openvpn)
CGroup: /system.slice/system-openvpn.slice/openvpn@Thomas.service
       └─739 /usr/sbin/openvpn --daemon ovpn-Thomas --status /run/openvpn/Thomas.status 10 --cd /etc/openvpn --config /etc/openvpn/Thomas.ovpn

Aug 21 12:23:48 raspberrypi ovpn-Thomas[739]: Socket Buffers: R=[163840->163840] S=[163840->163840]
Aug 21 12:23:48 raspberrypi ovpn-Thomas[739]: UDPv4 link local: [undef]
Aug 21 12:23:48 raspberrypi ovpn-Thomas[739]: UDPv4 link remote: [AF_INET]91.250.77.10:1194
Aug 21 12:24:48 raspberrypi ovpn-Thomas[739]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Aug 21 12:24:48 raspberrypi ovpn-Thomas[739]: TLS Error: TLS handshake failed
Aug 21 12:24:48 raspberrypi ovpn-Thomas[739]: SIGUSR1[soft,tls-error] received, process restarting
Aug 21 12:24:48 raspberrypi ovpn-Thomas[739]: Restart pause, 2 second(s)
Aug 21 12:24:50 raspberrypi ovpn-Thomas[739]: Socket Buffers: R=[163840->163840] S=[163840->163840]
Aug 21 12:24:50 raspberrypi ovpn-Thomas[739]: UDPv4 link local: [undef]
Aug 21 12:24:50 raspberrypi ovpn-Thomas[739]: UDPv4 link remote: [AF_INET]91.250.77.10:1194

Whenever I restart the openvpn service, the connection will be established again without problems. What could be the reason for the disconnect or better, why can't the openvpn daemon reconnect automatically to the server?

  • Also I had similar problems using UDP with OpenVPN. Probably tuning the keepalive and timeout parameters could have helped it, but it wasn't the case as I could play with it too long. So I simply switched to TCP and it worked. – peterh Aug 21 '17 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.