"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".)