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