Using "Keep connected" option prevents connecting to VPN when changing WiFi network

580 views
Skip to first unread message

dtom...@gmail.com

unread,
Sep 28, 2015, 6:34:33 AM9/28/15
to tunnelblick-discuss
Hi all,

I've been using Tunnelblick with satisfaction for almost a year now, but I have this little issue I'd like to have resolved:
I use the option in Tunnelblick called "keep connected" which works well: if I make my laptop go sleep and then wake it up while connected to the same WiFi network - VPN connectivity works immediately after opening the laptop (I assume this is the idea behind this option). However if I connect to a different WiFi network Tunnelblick fails to reconnect. I tracked down why - a routing entry gets stuck in the routing table making my connection attempts fail: the VPN server's IP address gets statically mapped to the default GW IP the WLAN AP gives my laptop via DHCP, but of course if I change WiFi networks the old GW will not work. As far as I remember when I didn't have the "Keep connected" option enabled I didn't have this problem, but I'm not sure.
I'll try to test it, but the ultimate solution would be I think to flush the routing rules/change the rule to the new default GW when Tunnelblick recognizes that the connection changed/re-connect is needed.

Thanks a lot!
Domi

jkbull...gmail.com

unread,
Sep 28, 2015, 7:06:22 AM9/28/15
to tunnelblick-discuss, dtom...@gmail.com
"Keep connected" does not do what you think it does. It is designed to reconnect to the VPN when the connection is terminated "unexpectedly", which for practical purposes means when OpenVPN crashes, which happens rarely if ever. The setting may affect your problem, but Tunnelblick has a different mechanisms for dealing with sleep/wake and switching to a different network.

First, please check your "Computer sleep/wake" settings.These settings are on the "Advanced" settings window and should be set to disconnect when the computer goes to sleep and reconnect when the computer wakes up. (Note that settings in the "Advanced" window apply to the configuration(s) that are selected on the left side of the "Configurations" panel of the "VPN Details" window.)

Second, un-check "Keep connected". This setting shouldn't matter, but I want to be absolutely sure it doesn't interfere with the other settings.

Finally, the problem you are describing is most likely to be solved by removing the "persist-tun" option in your configuration. Try removing it and see if that fixes the problem.

If that doesn't fix the problem, or if you don't have the "persist-tun" option in the OpenVPN configuration file, please post the diagnostic info (see Read Before You Post). In your situation, please post two sets of diagnostic info:
  • One set of diagnostic info after connecting and then disconnecting from a single network (that is, successfully connect/disconnect); and

  • Another set of diagnostic info after you connect on network #1, sleep the computer, and wake the computer on network #2. Collect the diagnostic information at that point, when it is not connected to the VPN properly.
Please attach the two sets of diagnostic info as two separate text files (you can use TextEdit; set the format to "Plain Text".)

"Tomcsányi, Domonkos"

unread,
Oct 5, 2015, 5:50:53 AM10/5/15
to jkbull...gmail.com, tunnelblick-discuss
Hi,

Thanks a lot for your detailed answer, removing persist-tun from my config solved the problem.
Sorry for getting back to you so late, but I wanted to do some testing and that took some time.

Cheers,
Domi
Reply all
Reply to author
Forward
0 new messages