1

I'm using ubuntu 16.04 and I have setup an openvpn connection and a tun0 interface is being created. The vpn connects successfully. At first I could visit some of the URLs through the VPN and but the page took 10-20 seconds with the browser just waiting for a connection. Then after unplugging my computer from the network and a restart the web pages just just stopped working all together. I ran nmcli dev show to compared the results to some on debian linux whose machine is working fine through open vpn and I saw that:

When openvpn is connected but no webpages load I see:

:~$ nmcli dev show
GENERAL.DEVICE:                         tun0
GENERAL.TYPE:                           tun
GENERAL.HWADDR:                         
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     tun0
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/14
IP4.ADDRESS[1]:                         10.146.129.226/32
IP4.GATEWAY:                            10.146.129.225
IP4.DNS[1]:                             127.0.0.1
IP6.ADDRESS[1]:                         fe80::27f8:bc23:5e18:b6ba/64

When openvpn is connected but the webpages take 10-20 seconds to load I see a bunch of IP4.ROUTEs being configured:

:~$ nmcli dev show
GENERAL.DEVICE:                         tun0
GENERAL.TYPE:                           tun
GENERAL.HWADDR:                         
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     tun0
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/0
IP4.ADDRESS[1]:                         10.146.129.226/32
IP4.GATEWAY:                            10.146.129.225
IP4.ROUTE[1]:                           dst = 193.88.68.118/32, nh = 10.146.129.225, mt = 50
IP4.ROUTE[2]:                           dst = 193.88.68.252/32, nh = 10.146.129.225, mt = 50
....
IP4.ROUTE[67]:                          dst = 193.88.68.101/32, nh = 10.146.129.225, mt = 50
IP4.ROUTE[68]:                          dst = 193.88.68.103/32, nh = 10.146.129.225, mt = 50
IP4.DNS[1]:                             127.0.0.1
IP6.ADDRESS[1]:                         fe80::71d2:5709:5536:b3fc/64
IP6.GATEWAY:                            


For the person whose openvpn is working on debian 9.4 IP4.DNS entries are being configured while mine from above only says IP4.DNS[1]: 127.0.0.1: 

:~$ nmcli dev show
GENERAL.DEVICE: tun0
GENERAL.TYPE: tun
GENERAL.HWADDR: (unknown)
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: tun0
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/224
IP4.ADDRESS[1]: 10.146.129.242/32
IP4.GATEWAY: 10.146.129.241
...
IP4.ROUTE[67]: dst = 193.88.68.99/32, nh = 10.146.129.241, mt = 50
IP4.ROUTE[68]: dst = 193.88.68.8/32, nh = 10.146.129.241, mt = 50
IP4.DNS[1]: 10.146.128.8
IP4.DNS[2]: 194.239.134.83
IP4.DNS[3]: 193.162.153.164
IP4.DNS[4]: 1.1.1.1
IP4.DNS[5]: 8.8.4.4
IP4.DNS[6]: 9.9.9.9
IP6.ADDRESS[1]: fe80::35a6:a424:c5b6:bf7f/64
IP6.GATEWAY: --

Their /etc/resolve conf file also has nameserver entries and looks like this:

# Generated by NetworkManager
search teknet int.xxxx.dk dev.xxxx.dk opasia.gkl.xxxx.dk xxx.dk
nameserver 10.146.128.8
nameserver 194.239.134.83
nameserver 193.162.153.164
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 1.1.1.1
nameserver 8.8.4.4
nameserver 9.9.9.9

My /etc/resolve.conf file looks like:

# 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 127.0.0.1
search teknet int.xxx.dk dev.xxx.dk opasia.gkl.xxx.dk dk.eng.xxx.net

I have dnsmasq running and am confused about how ubuntu 16.04 actually updates dns/name server entries. I've tried:

  1. Adding nameserver entries to /etc/resolvconf/resolv.conf.d/base
  2. Adding server entries to /etc/dnsmasq.conf and restarting dnsmasq.
  3. Adding dns-nameservers to /etc/network/interface and doing a resolveconf -u.
  4. Restart network manager after making changes, but nothing seems to add dns nameserver entries to /etc/resolve.conf. Restarting network manager with sudo systemctl restart network-manager.service does clear the manual entries I add to etc/resolve.conf which then seems to be rewritten when my network reconnects to what's shown above.

There's just too many places to update dns entries and I don't know which one is actually being used, is it dnsmasq, resolvconf or the dhcp script from my network or the vpn script? Can anyone point me how I should start debugging and what should be happening?

It seems like I want my nmcli dev show command to show that the tun0 interface has it's IP4.DNS entries set correctly. I just can't seem to get that to happen.

0

Your Answer

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

Browse other questions tagged or ask your own question.