OpenVPN Client connectivity drop - how to automate restart

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking
Author Message
georgvs
DD-WRT Novice


Joined: 20 Apr 2017
Posts: 10

PostPosted: Thu Apr 20, 2017 9:29    Post subject: OpenVPN Client connectivity drop - how to automate restart Reply with quote
Firmware: DD-WRT v3.0-r31690 std (03/17/17)
Hardware: Dlink DIR890L
OpenVPN Provider: StrongVPN

My symptom:

OpenVPN connectivity starts. Approximately 24 hours after, OpenVPN Status either "Client-Wait" or "TLS-Error"

Workaround:

Reboot router (Administration -> "Reboot Router")
Navigate (Services -> VPN -> "Apply Settings")

Question:

1.) is there any way to automate the workaround?
2.) is there a better way to remedy the symptom? If anyone knows the root cause

Settings:

OpenVPN Config:





Administration -> Management -> Cron

(was enabled by the StrongVPN "installer")

Code:

*/30 * * * * root /tmp/strongvpn.sh


Administration -> Commands -> Startup

(was enabled by the StrongVPN "installer")

Code:

sleep 20
nvram set wan_get_dns=
nvram commit
sleep 3
killall cron
sleep 2
cron
nvram get strongvpn_dns_cr > /tmp/strongvpn.sh
chmod +x /tmp/strongvpn.sh
sh /tmp/strongvpn.sh
Sponsor
georgvs
DD-WRT Novice


Joined: 20 Apr 2017
Posts: 10

PostPosted: Thu Apr 20, 2017 10:17    Post subject: Reply with quote
Thanks for the quick reply eibgrad. Problem when I clear those startup scripts is that the DNS settings will not update from the public DNS settings I receive from the internet provider. The script overrides the IP address and the DNS values.

If I leave that out (which I've tried), then there is no browsing from all the connected devices.

There has got to be a way to Cron a reboot and something that emulates the "Apply Settings" button from the VPN screen.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 7453
Location: Netherlands

PostPosted: Thu Apr 20, 2017 12:59    Post subject: Reply with quote
Follow @Eibgrad's advice, the following might be helpful: https://strongvpn.com/setup-dd-wrt-openvpn-advanced.html

There is a DNS problem (solved in the latest Kong build 31870 but not in the latest BS build) @Eibgrad also has a solution for that: http://svn.dd-wrt.com/ticket/5697#comment:5

And set 8.8.8.8 as Static DNS 1 as adviced in the above mentioned Strong manual.

To test if you have the DNS problem telnet into your router and issue:
touch /tmp/resolv.dnsmasq

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
WireGuard Documents & Guides:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397
OpenVPN Documents & Guides: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327398
IPSET: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327261
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
georgvs
DD-WRT Novice


Joined: 20 Apr 2017
Posts: 10

PostPosted: Fri Apr 21, 2017 5:33    Post subject: Reply with quote
Thanks for the hints. I will give this a try over the weekend.
georgvs
DD-WRT Novice


Joined: 20 Apr 2017
Posts: 10

PostPosted: Wed May 24, 2017 9:00    Post subject: Reply with quote
georgvs wrote:
Thanks for the hints. I will give this a try over the weekend.


OK. Again, thanks for all the input. I continue to face the same issue:

- Once a day (approximately 24 hours after establishing an OpenVPN connection), the OpenVPN Status page will show alternating "Client: WAIT" and "Client: RECONNECTING tls-error". Only solution is to restart the router (Administration - "Restart") and then click "Apply Settings" from the "VPN" config screen

- Whenever the ISP connectivity drops (which is fairly often here in the countryside), I have to do the same as above

- Whenever the power fails (which is also quite common), I have to the same as above

- using the restart code that eibgrad provided, doesn't actually establish the connection. The OpenVPN status page doesn't show anything but the config. Until I navigate to VPN tab and click "Apply Settings".


This is dumbfounding behavior. I can't understand why there isn't a "Connect" / "Disconnect" button on the UI or a corresponding CLI command. I also cannot understand why the client fails to connect at router start time.

Does this maybe have something to do with the build I am using? I just got the WiFi to finally be stable enough with this build in March, so I am a bit apprehensive about yet another upgrade.

Any thoughts anyone?
georgvs
DD-WRT Novice


Joined: 20 Apr 2017
Posts: 10

PostPosted: Wed May 24, 2017 12:34    Post subject: Reply with quote
While I was waiting on a response here, spent close to 3 hours on a support session with the guys from StongVPN. We went through about 15 iterations of configs. In the end, they blame the firmware version and suggest to get onto the "latest stable one or switch to Tomato USB". I've been on 8 different versions (starting with 04-09-2015-r26653) until I landed on this one (03-17-2017-r31690).

Anyone have an idea which version I should use to get the OpenVPN client to behave properly?
hubermania
DD-WRT User


Joined: 24 Aug 2012
Posts: 223

PostPosted: Wed May 24, 2017 15:29    Post subject: Reply with quote
The more recent DD-WRT releases (since about Nov 2016) all use OpenVPN 2.4, which might not play nice with installation scripts written for 2.3. Try downgrading to 30731 which IMHO is the most recent rock-solid OpenVPN 2.3 release of DD-WRT. If you decide to keep OpenVPN 2.4 on your router, you might need to enable IPv6 on the Setup->IPv6 tab.

Ditch the scripts and use the GUI-based setup instructions that StrongVPN themselves posted at here.

My OpenVPN 2.4 Client wouldn't come up after a cold boot until I added "route-delay 20" to the Additional config. I like to think of it as allowing dual stack "peace treaty" negotiations between my cable modem and router.

_________________
[Broadcom] Asus rt-ac66u r35531 ('66 should only be factory reset through the DD UI)
Fix RT-AC66U "wl1 [2.4 GHz TurboQAM]". DD-WRT failsafe UI @ http|https://169.254.255.1/
georgvs
DD-WRT Novice


Joined: 20 Apr 2017
Posts: 10

PostPosted: Wed May 24, 2017 16:49    Post subject: Reply with quote
Thx for the reply. All makes sense. Will try this weekend and post results.
georgvs
DD-WRT Novice


Joined: 20 Apr 2017
Posts: 10

PostPosted: Mon Oct 16, 2017 14:37    Post subject: Solved: DD-WRT DIR-890L OpenVPN stability issue Reply with quote
After months of hacking, troubleshooting, reading forums, posting here and trying a million recommended things:

Upgraded to DD-WRT v3.0-r33435M kongac (10/08/17)

Downloaded from http://desipro.de/ddwrt/K3-AC-Arm/dd-wrt.v24-K3_AC_ARM_R8000.bin - dated 2017-10-08 12:03

Now running stable OpenVPN (reconnecting automatically when connection drops, etc.) - 3 days+

Note: had to run http://desipro.de/ddwrt/K3-AC-Arm/dd-wrt.K3_R8000.chk "update" first. Before that the .bin update got stuck at 2% uploading.

Still not sure what the root cause is, but I am content that this is no longer an issue.
frankmontreal
DD-WRT User


Joined: 05 Jan 2016
Posts: 55

PostPosted: Sat Mar 31, 2018 2:50    Post subject: Re: Solved: DD-WRT DIR-890L OpenVPN stability issue Reply with quote
Hello, im new to setting up open server on my dd-wrt router, i tried to follow the below tutorial but i wasent able to have openserver to start ! when i go to status vpn i find there is nothing in that window ! anyone can help or point me in the right direction ?

here is the link i followe3d for the windows setup to generate the keys and i used the info in those keys to paste them in the appropriate dd-wrt fields !

https://www.comparitech.com/vpn/install-openvpn-dd-wrt-router/
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 7453
Location: Netherlands

PostPosted: Sat Mar 31, 2018 6:19    Post subject: Reply with quote
You are hijacking another thread which has nothing to do with your problem.
Please start a new thread describing your problem as stated in the forum rules

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
WireGuard Documents & Guides:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397
OpenVPN Documents & Guides: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327398
IPSET: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327261
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
frankmontreal
DD-WRT User


Joined: 05 Jan 2016
Posts: 55

PostPosted: Sat Mar 31, 2018 15:27    Post subject: Reply with quote
[quote="egc"]You are hijacking another thread which has nothing to do with your problem.
Please start a new thread describing your problem as stated in the forum rules[/quote]

oh yeah? and who might you be buddy ? the forum police ?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum