Opened 8 years ago

Last modified 6 years ago

#672 new Bug / Defect

OpenVPN does not recognize network change

Reported by: thhart Owned by:
Priority: minor Milestone:
Component: Networking Version: OpenVPN 2.3.8 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords:


From time to time my Ubuntu client changes network from WiFi? to LAN and vice versa or simply suspends and resumes. Since half a year I have occasionally to force a OpenVPN restart to get the connection back. It looks like OpenVPN is not detecting the network and connectivity loss. My Ubuntu is running in a VM.

openvpn 2.3.7-1ubuntu1
Linux version 4.2.0-34-generic (buildd@lgw01-54) (gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) ) #39-Ubuntu SMP Thu Mar 10 22:13:01 UTC 2016

Attachments (2)

vpn.conf (2.2 KB) - added by thhart 8 years ago.
Simple TCP/IP based client conf.
openvpn-check.log (50.2 KB) - added by thhart 8 years ago.
Logfile of disconnect.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by thhart

Attachment: vpn.conf added

Simple TCP/IP based client conf.

comment:1 Changed 8 years ago by Gert Döring

A log file would be more interesting than the config file...

Generally speaking, OpenVPN isn't responsible for detecting the network change - that's the OS's job. OpenVPN can only detect that the current session is no longer working right, but for that, you need to set the --ping option (otherwise, it cannot see a difference between "VPN broken" and "no traffic"). I see that your config has it disabled - maybe the server is pushing it, maybe not, but generally speaking you really should us it.

If the server is new enough (git master, not 2.3.x series) you also can use TLS floating - that is, the OpenVPN session will just move over to the new connection (wifi<->lan) and the server will take note and move the established session to the new client IP.

Changed 8 years ago by thhart

Attachment: openvpn-check.log added

Logfile of disconnect.

comment:2 Changed 8 years ago by thhart

Ping does not help for me. I added following lines to the config:
ping 5
ping-restart 5

But still no reconnect when network changes.

I have attached a logfile. At 10:17:30 I am changing the network connection. At 10:18:30 I have pushed back the old connection to which the VPN was initialized. But from 10:17:30 there is no connection to the server (I ping to test). It looks like OpenVpn? is still receiving packages, but the VPN is not valid any more (no ping possible).

I know my VM might be very special, (OSX->Parallels->Ubuntu), however I have the impression OpenVPN has a special problem with it.

comment:3 Changed 8 years ago by thhart

Background information to the VM. The NIC is operating in a bridged mode. So it receives its own local IP address. When I change the hosts network connectivity Ubuntu is recognizing it as if a cable was removed. The NIC is always the same in Ubuntu.

comment:4 Changed 6 years ago by Antonio Quartulli

Component: OpenVPN ConnectNetworking
Note: See TracTickets for help on using tickets.