Auto Reconnect

474 views
Skip to first unread message

rammjet

unread,
May 18, 2011, 6:43:33 AM5/18/11
to tunnelblick-discuss
So many times I have checked my server and found that my VPN
connection is down. It would be nice if Tunnelblick would initiate an
automatic reconnection when the connection gets dropped when I haven't
requested a disconnect.

jkbull...gmail.com

unread,
May 18, 2011, 7:30:00 AM5/18/11
to tunnelbli...@googlegroups.com
Thanks for the suggestion. Whether automatic reconnecting is done is sometimes a function of your OpenVPN server and client configurations -- OpenVPN has some specific options with that in mind, for example the "--ping" option.

That said, your suggestion is a good one and you now have me thinking about it. Tunnelblick could cause the connection process to be initiated again from the beginning if it detects that a connection has been dropped unexpectedly and OpenVPN itself isn't trying to reconnect.

The latest Tunnelblick beta includes a "connection window" that can be set to pop up whenever a connection is disconnected. That doesn't automatically reconnect, but at least lets you know right away when an unexpected disconnection occurs. To set it to show when a connection is disconnected (not the default), set the "Connection window" appearance preference to "Show when configuration status changes".

Friedrich Romstedt

unread,
May 18, 2011, 11:57:38 AM5/18/11
to tunnelbli...@googlegroups.com
2011/5/18 jkbull...gmail.com <jkbu...@gmail.com>:

> Thanks for the suggestion. Whether automatic reconnecting is done is
> sometimes a function of your OpenVPN server and client configurations --
> OpenVPN has some specific options with that in mind, for example the
> "--ping" option.

What helps me with this issue is the section in the appendix in my
config files on server and client side.

For all options used, [1] is my reference.

With the settings, I can keep the connection alive with server's NAT
machine IP floating around in IP space for days without any problem.
It'll reconnect on ISP interrupt.

> That said, your suggestion is a good one and you now have me thinking about
> it.

Although it can be solved on the OpenVPN layer directly, I see that
this might be too complicated for unexperienced users in the
beginning.

Would it be possible to put the OpenVPN layer remedy, maybe
additionally, on http://code.google.com/p/tunnelblick/wiki/wConfigO?

The --ping option is IMO neither necessary nor sufficient to trigger a
restart. In fact, it only triggers ping packets.

To the developer: How are you planning to implement the restart
mechanism? (Maybe one could place the necessary OpenVPN options on
the command line starting OpenVPN?)

Friedrich

[1] http://www.openvpn.net/index.php/open-source/documentation/manuals/69-openvpn-21.html

Appendix:

On client side:

# Allow changes in remote IP address
float

# Retry to resolve the --remote infinitely
resolv-retry infinite

# Useful if dropping privileges (what might
# cause trouble if routing is desired)
persist-tun
persist-key

On server side I specify:

# 10 second interval pings and push a
# --ping-restart of 120 s (the 120 s timeout
# is the default, too). See also the --keepalive
# key in [1].
keepalive 10 120

jkbull...gmail.com

unread,
May 18, 2011, 12:25:35 PM5/18/11
to tunnelbli...@googlegroups.com
(I'm the developer.)

Thanks for this very informative post -- it may help others to fix this if they have a similar situation.

If I implement "automatic reconnection" in Tunnelblick, I will do it without changing any of the OpenVPN settings -- either in the configuration file or with the command line that Tunnelblick uses to start a connection. That is very tricky to do, and would break some user's configurations. The solution you used will not work for everyone.

I would do it by, effectively, clicking the "Connect" button if a connection has disconnected and the disconnection wasn't expected. (That is, the user didn't click "Disconnect", the computer isn't going to sleep, the user hasn't quit Tunnelblick, etc.) With some configurations, however, that reconnection attempt will fail, because some setups don't restore the network completely after a connection is closed. So I would also need to provide an option to completely reset the network connection before such a reconnection attempt.

I will post to this thread if/when I implement this automatic reconnection feature.

Jonathan K. Bullard

unread,
Feb 15, 2013, 11:05:20 PM2/15/13
to tunnelbli...@googlegroups.com
No progress by me, sorry.

On Fri, Feb 15, 2013 at 7:56 PM, Roberto Aguilar <roberto....@gmail.com> wrote:
Hi there,

Was there any progress on implementing auto-reconnect.  It'd be immensely useful.

Thank you.

--
You received this message because you are subscribed to the Google Groups "tunnelblick-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tunnelblick-dis...@googlegroups.com.

To post to this group, send email to tunnelbli...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages