1

I'm not sure where to start troubleshooting wise I think I lack the networking experience to solve this problem on my own. The other topics with a question similar to mine don't seem to have an answer that solves my problem.

I have a PIA subscription for VPN service and I can connect to the VPN, but my server has no internet connection (can't update or install packages, checking IP times out, etc). In the past I've had this working on the same hardware running Ubuntu 14 server inside a VM running 14 desktop and it worked flawlessly. It was convoluted, but was an easy introductory way to keep my Deluge traffic separate from the rest. I've just freshly installed Ubuntu 16.04 on my headless server (no VM as before but same hardware, not worried about keeping traffic separate at the moment) and have been trying to get this working ever since. Basic server packages, SSH, and OpenVPN are about the only things installed right now. UFW is disabled for troubleshooting.

ifconfig while disconnected from VPN:

enp7s0    Link encap:Ethernet  HWaddr d0:50:99:c0:ab:f6
      inet addr:192.168.0.9  Bcast:192.168.0.255  Mask:255.255.255.0
      inet6 addr: fe80::d250:99ff:fec0:abf6/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:554 errors:0 dropped:0 overruns:0 frame:0
      TX packets:224 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:48143 (48.1 KB)  TX bytes:26820 (26.8 KB)
      Memory:df200000-df27ffff

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:167 errors:0 dropped:0 overruns:0 frame:0
      TX packets:167 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1
      RX bytes:12189 (12.1 KB)  TX bytes:12189 (12.1 KB)

netstat while disconnected from VPN:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 enp7s0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 enp7s0

ifconfig while connected to VPN:

enp7s0    Link encap:Ethernet  HWaddr d0:50:99:c0:ab:f6
      inet addr:192.168.0.9  Bcast:192.168.0.255  Mask:255.255.255.0
      inet6 addr: fe80::d250:99ff:fec0:abf6/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:200 errors:0 dropped:0 overruns:0 frame:0
      TX packets:206 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:27573 (27.5 KB)  TX bytes:27618 (27.6 KB)
      Memory:df200000-df27ffff

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:199 errors:0 dropped:0 overruns:0 frame:0
      TX packets:199 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1
      RX bytes:15165 (15.1 KB)  TX bytes:15165 (15.1 KB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00            
    inet addr:10.14.10.6  P-t-P:10.14.10.5  Mask:255.255.255.255
      UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:100
      RX bytes:0 (0.0 B)  TX bytes:3984 (3.9 KB)

netstat while connected to VPN:

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.14.10.5      128.0.0.0       UG        0 0          0 tun0
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 enp7s0
10.14.10.1      10.14.10.5      255.255.255.255 UGH       0 0          0 tun0
10.14.10.5      0.0.0.0         255.255.255.255 UH        0 0          0 tun0
128.0.0.0       10.14.10.5      128.0.0.0       UG        0 0          0 tun0
178.162.199.35  192.168.0.1     255.255.255.255 UGH       0 0          0 enp7s0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 enp7s0

In other topics I've found on the subject the most asked for info was the ifconfig and netstat outputs when connected/disconnected from the VPN, but I'll provide anything else needed. Any help will be greatly appreciated, I'm sure I'm missing something fundamental. I'm not a complete noob, but my Linux knowledge is limited to what I've learned from forums like these. Right now it's fine if all traffic is run through the VPN tunnel, eventually I will get around to figuring out iptables. My ultimate goal is to have one of my network adapters just for Deluge over VPN and the other network adapter for all other traffic, but right now just getting VPN w/internet would be awesome. (Only 1 network apapter is currently enabled in BIOS anyways right now)

resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 68.105.28.11
nameserver 68.105.29.11
nameserver 68.105.28.11

update-resolv-conf in /etc/openvpn (not sure if this is part of the openVPN package or came from PIA):

#!/bin/bash
#
# Parses DHCP options from openvpn to update resolv.conf
# To use set as 'up' and 'down' script in your openvpn *.conf:
# up /etc/openvpn/update-resolv-conf
# down /etc/openvpn/update-resolv-conf
#
# Used snippets of resolvconf script by Thomas Hood and Chris Hanson.
# Licensed under the GNU GPL.  See /usr/share/common-licenses/GPL.
#
# Example envs set from openvpn:
#
#     foreign_option_1='dhcp-option DNS 193.43.27.132'
#     foreign_option_2='dhcp-option DNS 193.43.27.133'
#     foreign_option_3='dhcp-option DOMAIN be.bnc.ch'
#

[ -x /sbin/resolvconf ] || exit 0
[ "$script_type" ] || exit 0
[ "$dev" ] || exit 0

split_into_parts()
{
    part1="$1"
    part2="$2"
    part3="$3"
}

case "$script_type" in

Steps taken to install/configure so far

sudo apt-get install openvpn

cd /etc/openvpn

sudo wget https://www.privateinternetaccess.com/openvpn/openvpn.zip

sudo unzip openvpn.zip

sudo cp Germany.ovpn pia-de.conf

sudo nano pia-de.conf
    Added login.conf after auth-user-pass

sudo nano login.conf
    Added 
        Username
        Password

sudo chmod 400 login.conf

From there I just added an autostart entry in /etc/default/OpenVPN and rebooted.  
When I run wget -q -O - ipecho.net/plain it returns blank after 30 seconds or so 
and I'm unable to update or install other packages while connected

Edit: I'm realising the update-resolv-conf is part of OpenVPN not from PIA and it has no bearing on overwriting the resolve.conf as I wondered in the comments

  • Missing piece here in my opinion is : Can you ping public ip addresses ? What does your resolv.conf look like ? You mention "server" and "VM on the same hardware". Is this at home or on a remote server ? If the latter, are you running a VM on top of what your server provider offers you ? – albert j Jan 21 '17 at 3:44
  • Pinging Google's DNS servers seems to work ok. I'm putting the resolve.conf in my original post. Sorry for confusion with server and VM. Currently it's just my home server running Ubuntu, no VM. I only mentioned the part about the VM because I was capable (in the past) to run this fine that way. – Adam J Jan 21 '17 at 3:51
  • Okay, that's cool. If you can ping public ip addresses, it means that you do have Internet, but with DNS issues. Can you try adding a DNS server as the first line in /etc/resolv.conf e.g. Google's 8.8.8.8 or one from OpenDNS, and then try to ping a domain name, e.g. ping ping.xs4all.nl (a server which is fine for pinging). – albert j Jan 21 '17 at 3:55
  • I'm confused by this: if you have your own VPN server, why are you paying for VPN service? Does the paid VPN service have any bearing on this problem? – Organic Marble Jan 21 '17 at 4:01
  • I realize that you should be using your VPN provider DNS servers. This page privateinternetaccess.com/pages/client-support shows 209.222.18.222 and 209.222.18.218 as their DNS servers. – albert j Jan 21 '17 at 4:02
0

hmmm, did you try this with "openconnect" ?. what does your VPN/provider require? [example, my vpn advises against openvpn].

  • I've used OpenVPN with this provider with no issues before and it's the preferred method listed for Ubuntu by the prrovider. I have not tried openconnect though. – Adam J Jan 21 '17 at 8:15
  • Thanks for the thought btw, my reply sounded blunt. I'm great at parties lol. – Adam J Jan 21 '17 at 8:53
0

Try lowering the mtu on the vpn port, e.g.
sudo ifconfig tun0 mtu 1300

For more explanation see here and also here. I had a similar problem and could only make things work with mtu 1388 or lower.

  • Consider adding a very brief explanation on why changing the mtu sometimes helps. – user535733 Feb 22 '18 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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