Browsing fails periodically when connected to VPN.
Hi!
I created a script in linux that tests the wget command on www.google.at and www.github.com. This is to test when browsing fails and when it's working. I ran the script every 30s and this is the result I got:
Fre Nov 3 22:26:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:27:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:27:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:28:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:28:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:29:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:29:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:30:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:30:31 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:31:01 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:31:31 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:32:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:32:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:33:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:33:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:34:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:34:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:35:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:35:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:36:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:36:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:37:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:37:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:38:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:38:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:39:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:39:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:40:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:40:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:41:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:41:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:42:01 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:42:31 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:43:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:43:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:44:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:44:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:45:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:45:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:46:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:46:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:47:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:47:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:48:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:48:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:49:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:49:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:50:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:50:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:51:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:51:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:52:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:52:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:53:01 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:53:31 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:54:01 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:54:31 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:55:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:55:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:56:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:56:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:57:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 22:57:31 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:58:01 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:58:31 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:59:01 CET 2017 www.google.at FAIL www.github.com FAIL
Fre Nov 3 22:59:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 23:00:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 23:00:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 23:01:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 23:01:31 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 23:02:01 CET 2017 www.google.at OK www.github.com OK
Fre Nov 3 23:02:31 CET 2017 www.google.at OK www.github.com OK
FAIL indicates that wget has failed (which means browsing to that website fails too; meaning the webpage tries to load all the time).
OK indicates that wget works.
When I'm not connected to the vpn, browsing works fine.
OK indicates that wget works.
When I'm not connected to the vpn, browsing works fine.
The above result indicates that wget fails periodically and I don't know why. I tried it with the "UK London.ovpn" config and the "Netherlands.ovpn" config. Same results. The weird thing is, that some other random websites sometimes work but the above don't, and after some time, every website works.
I'm hoping that you guys could help me. It's pretty frustrating when the internet just breaks in the middle of browsing. By the way, I'm using this command to connect to the VPN:
openvpn --mtu-test --script-security 2 --up /etc/openvpn/update-resolv-conf.sh \ --down /etc/openvpn/update-resolv-conf.sh --cd /etc/openvpn/ --config "UK London.ovpn" --daemon
Here is the script which produces the above output:
#!/bin/bash
gett () {
cd /tmp && wget -q --timeout=5 --tries=1 $1
if [ $? == 0 ]
then
echo -en "$1 OK\t\t" >> /var/log/wget.log
else
echo -en "$1 FAIL\t\t" >> /var/log/wget.log
fi
}
echo -en "$(date)\t" >> /var/log/wget.log
gett www.google.at
gett www.github.com
echo -en "\r\n" >> /var/log/wget.log
The resolv.conf file looks as follows (gets updated each time openvpn starts):
# Generated by resolvconf
nameserver 209.222.18.222
nameserver 209.222.18.218
I suspect this is a DNS issue or something. Tried to put nameserver 8.8.8.8 in /etc/resolv.conf but the issue persists.
This has been going on for a few weeks now and it's getting really annoying. I'm grateful for any help.
Comments
I would also like to point out that 5 seconds is relatively short for the timeout, as if you have any packet loss that means it won't have enough time to retry the connection. The VPN in itself doesn't account or attempt to recover any loss, it only encrypts and forwards.
Tue Nov 7 19:48:02 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 19:49:01 CET 2017 www.google.at OK www.github.com FAIL 192.30.253.113 FAIL
Tue Nov 7 19:50:01 CET 2017 www.google.at OK www.github.com FAIL 192.30.253.113 FAIL
Tue Nov 7 19:51:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 19:52:02 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 19:53:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 19:54:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 19:55:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 19:56:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 19:57:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 19:58:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 19:59:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 20:00:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 20:01:02 CET 2017 www.google.at OK www.github.com FAIL 192.30.253.113 FAIL
Tue Nov 7 20:02:01 CET 2017 www.google.at OK www.github.com FAIL 192.30.253.113 FAIL
Tue Nov 7 20:03:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 20:04:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
Tue Nov 7 20:05:01 CET 2017 www.google.at OK www.github.com OK 192.30.253.113 OK
I'm out of ideas of what to try to make sense of the problem
if FAIL, then traceroute -n -w 2 192.30.253.113
how many active network interfaces do you have there? and how many of them route offsite?
By the way, I only have these network interfaces:
would you please provide an excerpt from the openvpn log matching the timeframe of one of the OK -> FAIL transitions and then again on the subsequent FAIL -> OK transition?
yes, "replay window backtrack" indicates out-of-order or delayed packets arriving. a bit of that from time to time is not concerning.
Unless, I have to increase the verbosity to 6, but then it shows me only this after initialization, which I don't think is useful (for example):
...
...
But I will try to capture this log during the FAIL -> OK and OK -> FAIL transition if it helps. Maybe there is something interesting there.
the snippet above might indicate a hiccup at your end of the tunnel. hmm
This is what I get from lsof. I don't really understand what this means though:
(it was 18379 in the log you provided), then sudo lsof -p PID
the output is the listing of every file the process has open. program binary, shared libraries, sockets, and (hopefully) the location of the log file.
to dig down to the ongoing issue, it may be necessary to use just openvpn itself and one of the PIA-prepared ovpn files, in order to give you complete control over the logging verbosity.
thanks for running lsof again. i now have complete confidence you captured every scrap of info available from it. I/O handle #1 (stdout) in the first lsof dump is going to /dev/pts/1 which presumably is one end of a pipe or the terminal where openvpn was executed.
in the second lsof dump, it clearly shows stdout going to your openvpn.log file but stderr (I/O handle #2) is still going to /dev/pts/1 which means any stderr messages aren't being captured in the log file.
try
you should be able to confirm with lsof that both stdout and stderr are going to the log file
<fingerscrossed>new data may be captured</fingerscrossed>
the VPN can put up with network switch cable changing and other random brief interruptions and recover without the link being 'broken'. i don't recall exactly what the timeout is on that, but it's more than a few seconds.
ps: dear readers -- the post above by "muza25" looks spammy. don't click the link, okay? the link expands to https://gclub^snbbet^com/gclub-download^html ^=.
I am interested in your ideas though. I really don't want to cancel my PIA subscription but with this problem present, it's really annoying to keep using it. Most of the time, I turn it off because it's incredibly inconvenient. Might as well not have it...
I would be thankful for any comment you might have. Thanks!