Page 1 of 1

DD-WRT OpenVPN - Auto reconnect

Posted: Wed Aug 02, 2017 2:38 pm
by jpny
Im been using OpenVPN on my DD-WRT router for a few days now and the connection has remained stable. Im using policy based routing to only route specific IPs over the VPN (https://charleswilkinson.co.uk/2016/05/ ... nd-openvpn). This morning I noticed that my VPN connection was closed (the VPN status page of the router also showed state - client (blank) and the log was completely empty).

A simple reboot fixed the connection, but I am looking for a way to automate the re-connect. I don't think I can use the routers built in watch dog as I think it monitors the "main" connection not the PBR VPN connection.

as per the VPN companies setup instructions my config file has the following

Code: Select all

remote-cert-tls server
remote-random
nobind
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun
ping-timer-rem
reneg-sec 0
I think I can probably modify the ping-timer-rem command, or add one of the other ping commands, but I'm not really sure which one.

Can someone help me with this?
Also, any idea on how to test for the problem described above (unplugging just the modem doesn't simulate the problem, the router shows state - Client: RECONNECTING init_instance and when the modem come back online the VPN does re-establish itself)

Re: DD-WRT OpenVPN - Auto reconnect

Posted: Wed Aug 02, 2017 3:43 pm
by TinCanTech
jpny wrote:as per the VPN companies setup instructions
The company that runs the server can disconnect you and close your openvpn remotely.

If they do so (and it sounds like they are), there is no option in openvpn to over ride this.

Re: DD-WRT OpenVPN - Auto reconnect

Posted: Wed Aug 02, 2017 3:52 pm
by jpny
is there no way to test if connection is closed and reboot?
or to have ping sent every x hours to keep alive?

Re: DD-WRT OpenVPN - Auto reconnect

Posted: Thu Aug 03, 2017 11:31 am
by jpny
I don't think it is the VPN company. in the past I have been connected for days at time, this morning I was disconnected when I woke up again and the router was rebooted just 7 hours ago.

Re: DD-WRT OpenVPN - Auto reconnect

Posted: Thu Aug 03, 2017 6:01 pm
by TinCanTech
jpny wrote:I don't think it is the VPN company
Your logs will offer information ..

OpenVPN cannot spawn itself so your DD-WRT OS will have to monitor it.

Re: DD-WRT OpenVPN - Auto reconnect

Posted: Thu Aug 03, 2017 9:18 pm
by jpny
thanks. I just enabled the telnet log. the GUI log is empty after the disconnect. let me see what happens on the next disco