3

So I've a PureVPN connection working great in Windows. But when I try to use it in latest Ubuntu 14.04.1 LTS, it

  1. Using PPTP, connects for a minute, offers no internet service, and then disconnects
  2. Using OpenVPN, connects but is EXTREMELY slow
  3. Using SSTP, connects but is EXTREMELY slow

I tried contacting PureVPN support and all they offered me to toggle different settings, switch servers, try TCP or UDP in OpenVPN and see if things get better; which all sound like not-so-great tech support of a VPN company. They seemed like just trying to get through the chat session.

I've tried numerous solutions found online but none worked. I've tried command line configuration and GUI cofiguration, none worked. The only thing holding me back from completely switching to Ubuntu is this VPN issue. I hope it'll get it resolved using stackexchange's amazing communities help :) I know this is not an active site like stackoverflow but I'm still asking (which shows the level of desperation I'm having LOL)

P.S. I'm not a regular Linux user (trying to switch from windows)

4

I use PureVPN too. Just don`t touch MTU-parameter or smth...

I recommend you to use OpenVPN.

And here is my solution: For some reason firewall is filtering your TUN/TAP interface by default even without any rules.

So you need to exclude your virtual TUN or TAP interface from Linux firewall. You can exclude your TUN/TAP just by running these commands in terminal -

sudo iptables -A INPUT -i tun0 -j ACCEPT
sudo iptables -A FORWARD -i tun0 -j ACCEPT
sudo iptables -A INPUT -i tap0 -j ACCEPT
sudo iptables -A FORWARD -i tap0 -j ACCEPT

Or by adding these rules in Ubuntu (g)ufw (best practice). Edit this file -

sudo gedit /etc/ufw/before.rules

And add this lines at the bottom of the file before line with word COMMIT

 # allow all on loopback (!check if you already have this!) 
-A ufw-before-input -i lo -j ACCEPT
-A ufw-before-output -o lo -j ACCEPT

 # allow all traffic via our OpenVPN TUN/TAP interfaces
-A ufw-before-input -i tun0 -j ACCEPT
-A ufw-before-input -i tap0 -j ACCEPT
-A ufw-before-forward -i tun0 -j ACCEPT
-A ufw-before-forward -i tap0 -j ACCEPT
-A ufw-before-forward -o tun0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-forward -o tap0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-forward -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-forward -o tap0 -m state --state RELATED,ESTABLISHED -j ACCEPT

Save and exit.

And last thing - we need to enable IP-forwarding feature. Open in terminal file sysctl.conf -

sudo gedit /etc/sysctl.conf 

And add this line in the bottom -

# Enable IP forwarding
net.ipv4.ip_forward = 1 

Save and exit. After that apply the changes by running that command in terminal -

sudo sysctl -p

That`s it!

Now reboot, connect to your VPN-server and check youtube or P2P-sharing.

| improve this answer | |
  • Ok, I'm back now with Ubuntu 16.04 LTS an guess what, this solution works perfectly! Thanks a ton. I'm using PureVPN OpenVPN and getting great speed. – Ejaz Aug 18 '16 at 21:39
1

If you can’t laod your email and/or web pages get stuck when you’re connected to VPN server, that usually means you have an MTU issue. Each internet connection has a property called the Maximum Transmission Unit, or MTU. The MTU specifies the size of the largest chunk of data that can flow over that connection.

Most of the time the operating systems automatically detect the MTU of the connection and adjust themselves appropriately. However, some locations have routers that confuse the MTU discovery algorithms. To the best of my knowledge, Ubuntu has fixed MTU settings for VPN connections, which causes problems with some routers.

Here is the easy way to adjust the mtu size manually:

sudo nano /etc/ppp/ip-up

Add this line to the end of the file:

ifconfig $1 mtu 1492

Hope it could solve the problem

| improve this answer | |
  • rose thank you for your solution. I really appreciate it. But I did not notice any speed increase of VPN connection. It's just same. I can browse internet and email using SSTP and OpenVPN but like I said, it is extremely slow (with reference to what speed I get on Windows) – Ejaz Aug 30 '14 at 21:08
  • Actually now that I've tested the VPN connection for a some hours, it seems to have gotten better after the fix you suggested. It is not as perfect as it should be (and is in Windows) but it is not completely useless either. Thanks for the solution once again :) – Ejaz Sep 1 '14 at 11:58
0

I add a similar problem with Astrill VPN.

  • Very slow login (at least 10mn)
  • Impossible to share VPN connection with StealthVPN

Then it turns out that few days ago i used to download a script AdZHosts to block advertisements which i add to my /etc/hosts file and it was this script which was blocking all the machines of my LAN using the VPN and slowing down the login process as well.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.