raspilaspi
Posts: 4
Joined: Thu Apr 25, 2019 11:29 am

PiVPN - Connects, But Very Slow Internet

Thu Apr 25, 2019 11:42 am

Recently decided to give PiVPN a try. My issue isn't connecting to my Pi, but the speed. It crawls at less than 1Mbps. Since I use Pihole as the DNS servers, I can see the DNS requests; and if I wait long enough, pages do load up eventually (at least the ones that don't timeout); but surely this isn't how it's suppose to work, right? I've also tried other DNS servers, like Cloudflare's 1.1.1.1 or Google's 8.8.8.8.

My PiVPN (3B+) is connected via ethernet. My Pihole install is on a 2nd Pi, so it's not an overloading issue -- also connected via ethernet. My home bandwidth speeds are 150/150 Mbps.

Any help would be nice.

User avatar
DarkPlatinum
Posts: 872
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: YouTube

Re: PiVPN - Connects, But Very Slow Internet

Thu Apr 25, 2019 12:53 pm

The Pi has 100mega bit ethernet. Is your router configured properly?
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3, 1 * Raspberry Pi 3B+, 1 * Raspberry Pi 4B :mrgreen:

raspilaspi
Posts: 4
Joined: Thu Apr 25, 2019 11:29 am

Re: PiVPN - Connects, But Very Slow Internet

Thu Apr 25, 2019 9:57 pm

Yes. Forgot to mention port forwarding is setup on my router. No fancy setup at the moment -- just a Netgear router; if I disable port forwarding on my router, there's no connection at all -- so I'd say it's working correctly. Also, I chose the default recommended settings on PiVPN, which I assume the 3B+ can handle easily?

Only thing I can think of is that my cellular ISP is throttling port 1194? Doubt it, but worth a shot I guess to change the default port.

User avatar
default_user8
Posts: 680
Joined: Mon Nov 18, 2013 3:11 am

Re: PiVPN - Connects, But Very Slow Internet

Fri Apr 26, 2019 1:14 am

It's probably your isp, the 3b+ is more than capable of handling both pihole and pivpn. I run pihole, pivpn, and rpi-monitor on my 3B, and find my pivpn connection more than adequate for my needs.
Two heads are better than one, unless one's a goat head.

raspilaspi
Posts: 4
Joined: Thu Apr 25, 2019 11:29 am

Re: PiVPN - Connects, But Very Slow Internet

Fri Apr 26, 2019 2:09 am

So I changed the default port. It had no effect. I noticed the VPN works (err worked) perfectly fine on wifi, but if I switch over to 4G data only, data crawls again. My cell carrier assigns me a IPv6 address; assuming I use default DNS servers (no pihole DNS), would I have to configure the setup differently?

Also noticed my router was logging my VPN connection attempts as a possible DoS attack, so I disabled DoS protection on my router, and even DMZ'd my PiVPN -- something I don't plan to keep, I just wanted to see if it helped.

Currently back to step 1, as I changed some settings and now I'm locked out (unable to connect). Reinstalled PiVPN using TCP instead of UDP, but I'm still out of luck.

I'm close to giving up, but open to ideas. Surprisingly, I think my pfSense VPN setup was easier.

User avatar
default_user8
Posts: 680
Joined: Mon Nov 18, 2013 3:11 am

Re: PiVPN - Connects, But Very Slow Internet

Fri Apr 26, 2019 3:10 am

raspilaspi wrote:
Fri Apr 26, 2019 2:09 am
So I changed the default port. It had no effect. I noticed the VPN works (err worked) perfectly fine on wifi, but if I switch over to 4G data only, data crawls again. My cell carrier assigns me a IPv6 address; assuming I use default DNS servers (no pihole DNS), would I have to configure the setup differently?

The incoming ip shouldn't matter to pivpn since it just takes the incoming connection and assigns a local ip in the defined range. I'm guessing your ISP is throttling your incoming connection, I don't know where you are, but I know that my cellular provider will not allow port forwarding, so it effectively blocks all inbound traffic.


Also noticed my router was logging my VPN connection attempts as a possible DoS attack, so I disabled DoS protection on my router, and even DMZ'd my PiVPN -- something I don't plan to keep, I just wanted to see if it helped.

You will want to undo this asap as you are exposing your entire network to outside traffic. Read more about that here: http://www.grc.com/sn/sn-003.htm

Currently back to step 1, as I changed some settings and now I'm locked out (unable to connect). Reinstalled PiVPN using TCP instead of UDP, but I'm still out of luck.

I'm close to giving up, but open to ideas. Surprisingly, I think my pfSense VPN setup was easier.
Two heads are better than one, unless one's a goat head.

raspilaspi
Posts: 4
Joined: Thu Apr 25, 2019 11:29 am

Re: PiVPN - Connects, But Very Slow Internet

Fri Apr 26, 2019 3:50 am

I did a UFW reload, and BAM! Connected. I can keep connecting, but upon restart I have to reload UFW to connect to PiVPN again. I'm guessing it allows the connection when I reload, and once the firewall is loaded again, it doesn't terminate the already open connections. Also guessing it's an iptables issue, though I wouldn't know how to fix it. The default PiVPN rules are set.

443/tcp ALLOW Anywhere
Anywhere ALLOW 10.8.0.0/24
443/tcp (v6) ALLOW Anywhere (v6)

Speeds are good -- up to 30Mbps down; uploads speeds not so great, topping out at 3-5Mbps, but it's fine.
default_user8 wrote:
Fri Apr 26, 2019 3:10 am
The incoming ip shouldn't matter to pivpn since it just takes the incoming connection and assigns a local ip in the defined range. I'm guessing your ISP is throttling your incoming connection, I don't know where you are, but I know that my cellular provider will not allow port forwarding, so it effectively blocks all inbound traffic.
Think you're right. It would explain why I can see the DNS requests on my pihole, but my data slows down to the point of it being useless. I have PiVPN installed on 2 Raspberries ATM, and the one on TCP/443 works perfectly aside from the firewall issue. The UDP VPN still doesn't work, but I can live with TCP over UDP. Hmm. I should have tried UDP on 443.

Aside from the UFW firewall issue, this issue is solved. Thanks for the help everyone.

BeauSlim
Posts: 125
Joined: Mon Jul 31, 2017 10:02 am

Re: PiVPN - Connects, But Very Slow Internet

Fri Apr 26, 2019 9:34 pm

I think it really depends on what you consider acceptable throughput. A Pi 3B+ has no hardware crypto acceleration, and will do something like 30-40Mbit.
An old PC box with an Intel core chip that has AES-NI (mostly 2011 or later) has no problem doing 250+ Mbit over OpenVPN/IPSec and is a much better choice if speed matters to you.

redlinejohn
Posts: 1
Joined: Sun Jul 19, 2020 12:35 am

Re: PiVPN - Connects, But Very Slow Internet

Sun Jul 19, 2020 12:52 am

Okay, not sure if this will help but I was having severe issues of slow down to the point of pages/apps just not loading at all. This happened on my Android phone, laptops both Apple and PC. I couldn't go more than an hour without rebooting the pi itself and logging out/in to the vpn produced only marginal results that did not last for more than 30 minutes.

This morning I moved files openvpn-status.log, openvpn.log and openvpn.log.1 to the same file name with .bak appended. I just used the mv command. Then power cycled the pi. I have been running for about 8 hours now without an issue.

My openvpn.log file was around 5mb, not sure why it just continued to grow, while the openvpn.log.1 file was stopped at 4.4mb. So hopefully my issues are behind me and it appears that the issue isn't disk space on the SD card because I still have the files.

Hope this helps, good luck.

Return to “General discussion”