What's new

OPENVPN reconnection-script ?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

garry13

Occasional Visitor
Hello guys,

basicly the operation of an openvpn-tunnel using the RT-N66U router with the MERLIN-Firmware is working very good.
The only problem I have is, that my VPN-Provider seems to disconnect after a certain time of no traffic and is not reconnecting in case of connecting to the internet again. I included an "keep 10 60" in the "custom configuration" but this does not seem wo work.
I have to manually set the "service state" in the GUI to "off" and than to set it to "on" again (do a manual reconnect) and than the connection is reestablished and it works again.

Is there any way to do this automatically ?

Thanks Garry
 
Consider switching VPN providers.

Besides uptime you might see improvements in throughput.

I use StrongVPN run on my router. I have only lost my connection once from their end when they were doing announced system maintenance. The difference from most VPN providers is they assign you a static IP.

From my end I only have to restart the VPN if I reboot the router and I seldom need to do that and the router is plugged into a UPS so power glitches don't inadvertently force restarts.
 
I did some reserarch and I think that the problem is not that the VPN-Provider is disconnecting. I think the problem is, that my Internet-Provider is disconneting between 3 and 4 in the night to give out a new dynamic IP-adress (I do not have a fixed IP). After that the attempts of the openvpn-client to reconnect is failing.
Is there any way, that this problem can be fixed ? For example setting up a cron-job at 4:30 to shutdown and restart the openvpn-client to renew the tunnel ?

Any ideas ? Thanks

Garry
 
I did some reserarch and I think that the problem is not that the VPN-Provider is disconnecting. I think the problem is, that my Internet-Provider is disconneting between 3 and 4 in the night to give out a new dynamic IP-adress (I do not have a fixed IP). After that the attempts of the openvpn-client to reconnect is failing.
Is there any way, that this problem can be fixed ? For example setting up a cron-job at 4:30 to shutdown and restart the openvpn-client to renew the tunnel ?

Any ideas ? Thanks

Garry

A cron job could do the job.

Code:
service restart_vpnclient1
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top