[SOLVED] openvpn with PIA keeps dropping every hour!

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page 1, 2  Next
Author Message
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Tue May 14, 2019 8:09    Post subject: [SOLVED] openvpn with PIA keeps dropping every hour! Reply with quote
Greetings,
I have a Netgear r7800.
Firmware: DD-WRT v3.0-r39715M kongat (05/09/19)
It is now months I am reading all I can to solve the disconnection issue I have with Private Internet Access openvpn connection.
I saw a lot of posts and possible solutions. Mostly from the past. None worked.
I got in touch with PIA tech support, they have me trying all of those already tested possible solution mostly found in this DD-WRT forum. None worked.

I use this setup:
https://www.privateinternetaccess.com/helpdesk/guides/routers/dd-wrt-3/dd-wrt-openvpn-setup-2
Of course I tested also the Tunnel UDP MSS-Fix enabled. And many other additional configuration options without any success.
The PIA tech support assumed my issue would be solved by this solution:
http://yllus.com/2011/03/25/fix-my-dd-wrt-router-drops-all-connections-when-it-renews-a-dhcp-lease/
but I had already tried and no success!

At the end of long mail conversation with PIA, I was dismissed with the following reason:
From PIA:
"
I see the following in the logs:
Mar 21 21:35:52 titio daemon.debug process_monitor[1324]: We need to re-update after 3600 seconds
Mar 21 21:35:52 titio daemon.info process_monitor[1324]: process_monitor : set timer: 3600 seconds, callback: ntp_main()


3600 seconds does equal an hour and the time suddenly mismatching would certainly kill the openvpn connection.

I do not believe this is anything to do with the VPN at this point and it is like an issue with DD-WRT and NTP. I recommend seeking assistance on the DD-WRT forums as this would be outside of our scope of support.

"

Anyone can help me on this issue?
I am totally unstable with openvpn at the moment.
I must say, I had a very similar issue with wrt1900ac v1. This is why I moved to Neatgear but did not solved the problem.
It sounds like a DD-WRT issue.
What do you think?

PS
in all this, I do use whatsch dog to reconnect everytime I loose VPN connection (or I would simply be cut off). But in the process, my network suffers of internet loss and often have issue with all live online communications.
Regards
Bacco


Last edited by bacco on Thu Jul 04, 2019 22:58; edited 1 time in total
Sponsor
msoengineer
DD-WRT Guru


Joined: 21 Jan 2017
Posts: 1783
Location: Illinois Moderator

PostPosted: Tue May 14, 2019 14:30    Post subject: Reply with quote
You can try this

I don't know if the NTP client is still an issue or not, but it would seem so.

More NTP Info

too lazy to read-
try adding this as a cron job:
Code:
50 * * * * root stopservice process_monitor && startservice process_monitor

_________________
FORUM RULES

TIPS/TRICKS: Best QCA Wifi Settings | Latency tricks | QoS Port priority | NEVER USE MU-MIMO |
Why to NOT use MU-MIMO | Max Wifi Pwr by Country | Linux Wifi Pwr | AC MCS & AX MCS | QCA 5Ghz chnls to use | WIFI Freq WIKI | TFTP R7800 | Don't buy AX | IPERF3 How-To

[R9000]52396 nightly (Main Router)
[EA8500]43192 & 45493 (2xOffsite)
[R7800] resting
[WDR3600]BS 44715 (Offsite)
[A7v5]BS 43038 (Offsite+spare napping)


Last edited by msoengineer on Tue May 14, 2019 14:38; edited 2 times in total
foz111
DD-WRT Guru


Joined: 01 Oct 2017
Posts: 707
Location: Earth

PostPosted: Tue May 14, 2019 14:35    Post subject: Reply with quote
have you tried a build from early Feb 19 before all the big dd-wrt updates?
to be honest i had one of these and it never missed a beat running pia.
does it drop internet if you are not running a vpn client? i assume you will have tested this? i only ask as you say you had similar issue with another router maybe modem issue? just a thought.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Tue May 14, 2019 16:09    Post subject: Reply with quote
Below my settings I use for PIA, copy them to the addtitional config and do not use anyting else.

Code:
sndbuf 523216
rcvbuf 523216
reneg-sec 0
keepalive 10 120
remote-cert-tls server
disable-occ



That said disconnects do happen (not with me at the moment) and therefor you can use the watch dog script from @Sploit, this only restarts the VPN so the router itself will keep working, If you do not have the link to the script I will dig it up for you

The frequent disconnects can be very frustrating unfortunately there is often no simple an quick fix as there is no one cause.

Edit: Here is the thread with the watchdog script: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=311060&postdays=0&postorder=asc&start=15
Scroll to the end of the thread, @Sploit is working on a new version, but I have not seen that yet.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: 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
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Tue May 14, 2019 19:09    Post subject: Reply with quote
msoengineer wrote:
You can try this

I don't know if the NTP client is still an issue or not, but it would seem so.

More NTP Info

too lazy to read-
try adding this as a cron job:
Code:
50 * * * * root stopservice process_monitor && startservice process_monitor


Read the link. I dont think the ntp server makes a difference as I have tried many . yet, for the sake of being sure, I will try that too. (I think I did but I do that again)
And eventually I try the cron job as well.
Thanks for your reply and help.
Bacco
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Tue May 14, 2019 19:14    Post subject: Reply with quote
foz111 wrote:
have you tried a build from early Feb 19 before all the big dd-wrt updates?
to be honest i had one of these and it never missed a beat running pia.
does it drop internet if you are not running a vpn client? i assume you will have tested this? i only ask as you say you had similar issue with another router maybe modem issue? just a thought.


Foz111,
I have tried builds from: 28-10-18, 1-2-19, 14-2-19 and 9-5-19.
All starting from a reset up to configuring nat and static leases and SAMBA.. step by step.
I have no internet disconnections without VPN.
Yes, I tried my 2 modems. And I also a TP-Link from a friend also with dd-wrt on it. Same problem.
Thnks for your reply

Regards,
Bacco
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Tue May 14, 2019 19:20    Post subject: Reply with quote
egc wrote:
Below my settings I use for PIA, copy them to the addtitional config and do not use anyting else.

Code:
sndbuf 523216
rcvbuf 523216
reneg-sec 0
keepalive 10 120
remote-cert-tls server
disable-occ



That said disconnects do happen (not with me at the moment) and therefor you can use the watch dog script from @Sploit, this only restarts the VPN so the router itself will keep working, If you do not have the link to the script I will dig it up for you

The frequent disconnects can be very frustrating unfortunately there is often no simple an quick fix as there is no one cause.

Edit: Here is the thread with the watchdog script: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=311060&postdays=0&postorder=asc&start=15
Scroll to the end of the thread, @Sploit is working on a new version, but I have not seen that yet.

Thanks egc,
I will certainly give it a try.
What I found strange is that I have tried 3 different bands routers with same results.
However, about a year ago when I used an older router (not an AC router) I did not have any disconnections.
My problems started when I upgraded to a better router. (or sop I hoped)
Thanks for your reply. Will report after testing.
regards,
Bacco
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Tue May 14, 2019 19:25    Post subject: Reply with quote
One test I habve not done yet is subscribing a different VPN provider to test if it makes a difference.

One test I HAVE done is trying a frien PIA login to check if it was PIA messing around with my account. But that was not the case; I still had the same issue. And my frie d does not have any issue with the same account .

My last test beside all above you suggested, will be to bring my router to a friend and test it with his connection and see if is my ISP that plays a role in all this mess!

First I will try your suggestions above.
Than will try a different ISP if not successful solution.

I think that there must be a way to have stable solution. As it was in with less powerful routers.

Any other suggestion is highly welcome

Bye

Bacco
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Wed May 15, 2019 20:30    Post subject: Reply with quote
egc wrote:
Below my settings I use for PIA, copy them to the addtitional config and do not use anyting else.

Code:
sndbuf 523216
rcvbuf 523216
reneg-sec 0
keepalive 10 120
remote-cert-tls server
disable-occ



That said disconnects do happen (not with me at the moment) and therefor you can use the watch dog script from @Sploit, this only restarts the VPN so the router itself will keep working, If you do not have the link to the script I will dig it up for you

The frequent disconnects can be very frustrating unfortunately there is often no simple an quick fix as there is no one cause.

Edit: Here is the thread with the watchdog script: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=311060&postdays=0&postorder=asc&start=15
Scroll to the end of the thread, @Sploit is working on a new version, but I have not seen that yet.


Hi egc,
since last night I m testing this solution.
At the beginning looked like was working well. All tests did give good results and worked out as expected.
This morning I noticed I was without internet connection. I looked in the log file that the script produces and noticed that the ping lost 100% of the packages. And the connection was cut. The Tun1 is up but nothing go on it.
I tested the commands manually as per instruction on your link, and it keep giving bad results on PID kill:
"Redundancy Checking is ENABLED!!!
Executing VPN Tunnel UP Redundancy check

Starting SploitWorks VPN Tunnel Ping Checker on tun1
ping: bad address 'tun1'
ping: bad address 'tun1'
ping: bad address 'tun1'
ping: bad address 'tun1'
###############################################################
Ohhh No! We were unable to ping 8.8.8.8
Sooo....Executing OpenVPN Forced Restart...
###############################################################
Taking down OpenVPN Client Routes
Shutting Down OpenVPN...
sh: can't kill pid 10383: No such process [Note that the PID changes all the time but is correct]
OpenVPN is restarting...

Waiting 20 seconds for tunnel to open and secure...
Starting Up OpenVPN Client Routes"

And keeps on going forever like that.

(Looks like after 1 hour, something happen. And is not possible to kill and restart anymore. Like if something done and cannot be undone!)

So I start re-testing from beginning...
- rebooted
- started PIA OPENVPN
- than SSH on router and manually tested the script: first kill all openvpn, than run the script
All works perfect.

Than,
- I let openvpn running for hours. left home and back hours later
- no internet connection
Manually run the script. But it simply goes in a loop with no success.
I than looked at the script and tested the commands manually via SSH...
- no success!

Going back to the original question (That I think is the reason of all problems): what can actually cause the router to have EXACTLY one hour of openvpn life?

Anyway... any other suggestion is welcome!

Regards,
Bacco
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Wed May 15, 2019 22:06    Post subject: Reply with quote
msoengineer wrote:
You can try this

I don't know if the NTP client is still an issue or not, but it would seem so.

More NTP Info

too lazy to read-
try adding this as a cron job:
Code:
50 * * * * root stopservice process_monitor && startservice process_monitor


Hi msoengineer,
tried your suggestion.
After 1h, connection lost.
Did not work.
Regards
Bacco
roizby
DD-WRT Novice


Joined: 05 Apr 2018
Posts: 12

PostPosted: Sat May 18, 2019 10:29    Post subject: Reply with quote
Hi,

try adding these settings to your openvpn config

Code:

pull-filter ignore "auth-token"
ping 6
ping-restart 12


this is what solved the constant PIA disconnections for me, you should not need any tunnel watchdogs whatsoever.
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Mon May 20, 2019 20:41    Post subject: Reply with quote
roizby wrote:
Hi,

try adding these settings to your openvpn config

Code:

pull-filter ignore "auth-token"
ping 6
ping-restart 12


this is what solved the constant PIA disconnections for me, you should not need any tunnel watchdogs whatsoever.


I will give it a try and report...
(sorry for late response.. I was away!! Apreciate the input)
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Mon May 20, 2019 21:06    Post subject: Reply with quote
eibgrad wrote:


I'm not so sure tunnel pings would even be all that effective anyway. When you use the ping options (which are more commonly established using the keepalive directive, which is a helper directive for ping + ping-restart), that happens at the client to server connection level. And it's not even a traditional ping, as in the ping command, but something unique and internal to OpenVPN itself.

But there can be another problem in trying to use these directives. If the OpenVPN server pushes these to the client, and the client is using them as well, the server overrides the client! IOW, you're always bound by what the server wants, not what YOU want.

So before bothering w/ such changes, I'd first check to see if these are being pushed by the server to the client by examining the syslog.

There's also a potential problem w/ using reneg-sec 0.

What reneg-sec does is determine the minimum time between having the session rekeyed. A value of zero does NOT reduce that to zero. It disables it! And now there are two possibilities; either the server has done the same, so the time between being rekeyed default to 3600, *or*, the server has pushed its own value, which may be even worse than 3600 (e.g., 86400, or once a day).

This is another example why you have to be careful with some settings, and have a looksee what's being pushed by the server. You can actually aggravate the situation if you don't examine what's being negotiated by both sides, and understand how OpenVPN responds in situations where the client and server are *both* using the same directives. There's a protocol defined in each case, and it's detailed in the OpenVPN documentation.

https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage

These are the finer details that can sometimes lead ppl astray. And why dealing w/ OpenVPN problems can be rather difficult at times.

That's why I can't stress enough, every dd-wrt user should read the OpenVPN documentation before throwing directives at it. Many times things are NOT intuitive, and don't always work as you might expect.


Trying wont hurt.
If it does not work, it costs me 1h of my life. thats ok to me.
What do you suggest to improve my openvpn stability beside reading openvpn documentation?
I am honest... reading that not short documentation and trying to find a solution, is not easier than finding some guru that can suggest out of personal experience.
Your practical input is very welcome.
I still have faith in dd-wrt and pia... so far.
Regards,
Bacco
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Mon May 20, 2019 21:21    Post subject: Reply with quote
eibgrad wrote:


So before bothering w/ such changes, I'd first check to see if these are being pushed by the server to the client by examining the syslog.



PS
Can you help me identify what to look for in the syslog?

Thanks
Bacco
bacco
DD-WRT User


Joined: 20 Jan 2009
Posts: 53

PostPosted: Mon May 20, 2019 22:13    Post subject: Reply with quote
@eibgrad
Thanks for your input.
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware 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