Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm suffering random disconnections with OpenVPN. I don't know much about the subject, maybe you can point me in the right direction? Here is the tail for /var/log/messages, it contains a <warn> and other relevant-looking lines:

Jul 15 21:27:58 notebook NetworkManager[907]: <info> Tunnel Device: tun0
Jul 15 21:27:58 notebook NetworkManager[907]: <info> IPv4 configuration:
Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal Gateway: 10.8.0.65
Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal Address: 10.8.0.66
Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal Prefix: 32
Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal Point-to-Point Address: 10.8.0.65
Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Maximum Segment Size (MSS): 0
Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Static Route: 10.8.0.1/32   Next Hop: 10.8.0.1
Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Forbid Default Route: no
Jul 15 21:27:58 notebook NetworkManager[907]: <info>   Internal DNS: 10.8.0.1
Jul 15 21:27:58 notebook nm-openvpn[5675]: Initialization Sequence Completed
Jul 15 21:27:58 notebook NetworkManager[907]: <info>   DNS Domain: '(none)'
Jul 15 21:27:58 notebook NetworkManager[907]: <info> No IPv6 configuration
Jul 15 21:27:59 notebook NetworkManager[907]: <info> VPN connection 'Some VPN' (IP Config Get) complete.
Jul 15 21:27:59 notebook NetworkManager[907]: <info> Policy set 'Some VPN' (tun0) as default for IPv4 routing and DNS.
Jul 15 21:27:59 notebook NetworkManager[907]: <warn> /sys/devices/virtual/net/tun0: couldn't determine device driver; ignoring...
Jul 15 21:27:59 notebook NetworkManager[907]: <info> VPN plugin state changed: started (4)
Jul 15 21:28:44 notebook NetworkManager[907]: <info> VPN plugin state changed: stopping (5)
Jul 15 21:28:44 notebook NetworkManager[907]: <info> VPN plugin state changed: stopped (6)
Jul 15 21:28:44 notebook NetworkManager[907]: <info> VPN plugin state change reason: 0
Jul 15 21:28:44 notebook avahi-daemon[910]: Withdrawing workstation service for tun0.
Jul 15 21:28:44 notebook avahi-daemon[910]: Withdrawing address record for 192.168.0.5 on em1.
Jul 15 21:28:44 notebook avahi-daemon[910]: Leaving mDNS multicast group on interface em1.IPv4 with address 192.168.0.5.
Jul 15 21:28:44 notebook avahi-daemon[910]: Interface em1.IPv4 no longer relevant for mDNS.
Jul 15 21:28:44 notebook avahi-daemon[910]: Joining mDNS multicast group on interface em1.IPv4 with address 192.168.0.5.
Jul 15 21:28:44 notebook avahi-daemon[910]: New relevant interface em1.IPv4 for mDNS.
Jul 15 21:28:44 notebook avahi-daemon[910]: Registering new address record for 192.168.0.5 on em1.IPv4.
Jul 15 21:28:44 notebook nm-openvpn[5675]: SIGTERM[hard,] received, process exiting
Jul 15 21:28:45 notebook NetworkManager[907]: <info> Policy set 'System em1' (em1) as default for IPv4 routing and DNS.
Jul 15 21:28:45 notebook NetworkManager[907]: <warn> error disconnecting VPN: Could not process the request because no VPN connection was active.
Jul 15 21:28:45 notebook NetworkManager[907]: <warn> (5) failed to find interface name for index
Jul 15 21:28:45 notebook NetworkManager[907]: nm_system_iface_flush_routes: assertion `iface != NULL' failed
Jul 15 21:28:45 notebook NetworkManager[907]: <warn> (5) failed to find interface name for index
Jul 15 21:28:49 notebook NetworkManager[907]: <info> VPN service 'openvpn' disappeared
share|improve this question
    
I've had the same problem with this for over a year. I've yet to figure out why it keeps disconnecting. I'm on Fedora 14 (which is dated) but a co-worker has Ubuntu 12.10 and it suffers the same behavior too. We've wondered if it's the server that's the issue but it's difficult to debug this issue. –  slm Jul 16 '13 at 2:15
    
@slm I've read reducing the MTU might help. Wanna try that? I'll do it too. –  ChocoDeveloper Jul 16 '13 at 2:17
    
Yeah I tried that already. You should try it still, but it didn't change anything for me. Our behavior is that the connection will stay up for a few minutes and then disconnect. –  slm Jul 16 '13 at 2:18
    
What is the output of grep openvpn /var/log/syslog |tail -n 100 ? –  rubo77 Jul 23 at 21:34

1 Answer 1

As a workaround create a script that checks if openvpn is still running:

if ! pgrep "openvpn" > /dev/null; then 
  /usr/sbin/service openvpn restart
  echo "["$(date "+%Y-%m-%d %H:%M:%S")"] openvpn restarted">> /var/log/openvpn.log
fi

and call chat script minutely in your crontab

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.