0

I am trying to make my Ubuntu Server (16.04) run behind a VPN. I have a subscription to NordVPN and have followed their procedure to connect to the VPN via OpenVPN - it successfully connects.

I then use Screen to continue running OpenVPN in the background, and when I try to check the servers external IP or ping google.com it fails as if there is no connection to the VPN. I have tried multiple VPN servers. What am I doing wrong?

EDIT: ifconfig

enp2s0    Link encap:Ethernet  HWaddr a0:b3:cc:df:31:91
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a2b3:ccff:fedf:3191/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2190765 errors:0 dropped:16 overruns:0 frame:0
          TX packets:2347458 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2100301066 (2.1 GB)  TX bytes:1710956391 (1.7 GB)
          Interrupt:18

> 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:132225 errors:0 dropped:0 overruns:0 frame:0
          TX packets:132225 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:37777958 (37.7 MB)  TX bytes:37777958 (37.7 MB)

> tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.7.7.242  P-t-P:10.7.7.241  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:598 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:21997 (21.9 KB)  TX bytes:62173 (62.1 KB)

Tried to ping google.com - failed to get a response.

downloading a file with wget get:

wget: unable to resolve host address

ping 8.8.8.8:

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=48 time=404 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=48 time=370 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=48 time=369 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=48 time=369 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=48 time=404 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=48 time=369 ms
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 369.680/381.456/404.838/16.344 ms

EDIT 2: dig a google.com @8.8.8.8:

; <<>> DiG 9.10.3-P4-Ubuntu <<>> a google.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15859
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com.            IN      A

;; ANSWER SECTION:
google.com.         203     IN      A       216.58.216.238

;; Query time: 388 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Aug 31 15:00:37 AEST 2016
;; MSG SIZE  rcvd: 55
5
  • For assistance, you will need to provide your network configuration and actual tests. Does ping 8.8.8.8 get replies? If not, show us your routing table (route -n) while connected. – Julie Pelletier Aug 31 '16 at 4:15
  • @JuliePelletier Thanks for the response. I have added ifconfig, wget and the ping 8.8.8.8 – Shady Ady Aug 31 '16 at 4:26
  • Can you show the output of dig a google.com @8.8.8.8? – Julie Pelletier Aug 31 '16 at 4:57
  • By the way, as you can see, multi-line quotes don't show line feeds so you should show them as code. – Julie Pelletier Aug 31 '16 at 5:04
  • @JuliePelletier put settings in code blocks and added the dig a google.com – Shady Ady Aug 31 '16 at 5:10
0

All you need to do to get everything working is to set up your local DNS settings properly.

The simplest way to do it is to put nameserver 8.8.8.8 in /etc/resolv.conf after backing it up (mv /etc/resolv.conf /etc/resolv.conf.bak).

2
  • Thanks so much for your help. If you don't mind, why did that work setting the DNS to Googles? What did the "dig a google.com @8.8.8.8" tell you. – Shady Ady Aug 31 '16 at 5:23
  • It was actually already obvious when you were able to ping 8.8.8.8 that you could use it for your DNS but I wanted to make sure there was nothing blocking it. dig is a DNS query tool. – Julie Pelletier Aug 31 '16 at 5:26

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.