I have been running OpenVPN within 16.04 for some time and didn't have
any DNS issues to begin with, even though I wasn't calling any scripts
such as /etc/openvpn/update-resolv-conf via the up/down commands in my
configuration; it just worked.

Something must have changed through updates however, as it stopped
working.  Upon investigation I found this thread and tried the solution
in comment #44, which doesn't seem to work for me.

I have found that commenting out dns=dnsmasq in
/etc/NetworkManager/NetworkManager.conf, as in comment #42 does not
entirely work for me either.  The problem I've found with this solution
is as follows:

The original name servers (x2) as supplied via DHCP for the base network
connection are pushed to /etc/resolv.conf via resolverconf.  I start
OpenVPN and use /etc/openvpn/update-resolv-conf to push the name servers
supplied from the VPN server to /etc/resolv.conf.  After that
/etc/resolv.conf contains 3 nameserver entries.  The first two entries
are those supplied from the VPN server; the last one is a nameserver
entry as supplied by the DHCP server for the base connection.

While you could use the connection in this state, it's clearly not great
because there's the potential for DNS leakage.  Also, it's quite
possible you won't be able to contact the ISP's DNS servers anyway,
because you're no longer sending queries from within their network.

I'm writing what I have found here for the benefit of other OpenVPN
users with DNS issues, although it would appear that what I've found is
a revolvconf issue rather than an OpenVPN one.

I have attached a modified update-resolv-conf file which works for me.
It backs up and then deletes the NetworkManager connection before adding
the OpenVPN supplied DNS information.  Upon disconnection it deletes the
OpenVPN entry and restores the NetworkManager information from the
backup.

I hope this might be useful to some folk.


** Attachment added: "Modified update-resolv-conf for OpenVPN"
   
https://bugs.launchpad.net/ubuntu/+source/network-manager-openvpn/+bug/1169437/+attachment/4945796/+files/update-resolv-conf

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager-openvpn in Ubuntu.
https://bugs.launchpad.net/bugs/1169437

Title:
  network-manager does not configure local resolver or dnsmasq to use
  the nameserver addresses received from the VPN server

Status in network-manager-openvpn package in Ubuntu:
  Fix Released

Bug description:
  NetworkManager/dnsmasq does not set the DNS servers given by the
  OpenVPN server when I connect. I can see in my syslog that I do
  receive the name server addresses correctly along with all the routes:

  Apr 16 08:14:09 homer NetworkManager[4014]: <info>   Internal DNS: 
192.168.11.90
  Apr 16 08:14:09 homer NetworkManager[4014]: <info>   Internal DNS: 
192.168.11.190

  However, they are not used:

  oscar@homer:~$ nmcli -f IP4 dev list | grep DNS
  IP4.DNS[1]:                             192.168.0.1
  oscar@homer:~$

  (That is my default DNS/Gateway and it should still be queried for all
  DNS queries outside of VPN network)

  If I comment out dns=dnsmasq in
  /etc/NetworkManager/NetworkManager.conf and restart NetworkManager
  then DNS starts to work properly again, VPN nameservers are used for
  domain names on the VPN network and others through my default
  nameserver. Let me know if I kan provide further info about this
  issue.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.10
  Package: network-manager 0.9.6.0-0ubuntu7
  ProcVersionSignature: Ubuntu 3.5.0-28.47-generic 3.5.7.9
  Uname: Linux 3.5.0-28-generic x86_64
  NonfreeKernelModules: wl
  ApportVersion: 2.6.1-0ubuntu10
  Architecture: amd64
  CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 
not found.
  Date: Tue Apr 16 08:16:42 2013
  EcryptfsInUse: Yes
  IfupdownConfig:
   # interfaces(5) file used by ifup(8) and ifdown(8)
   auto lo
   iface lo inet loopback
  InstallationDate: Installed on 2012-11-22 (144 days ago)
  InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
  IpRoute:
   default via 192.168.0.1 dev eth1  proto static
   192.168.0.0/24 dev eth1  proto kernel  scope link  src 192.168.0.44  metric 9
  MarkForUpload: True
  NetworkManager.state:
   [main]
   NetworkingEnabled=true
   WirelessEnabled=true
   WWANEnabled=true
   WimaxEnabled=true
  SourcePackage: network-manager
  UpgradeStatus: No upgrade log present (probably fresh install)
  mtime.conffile..etc.NetworkManager.NetworkManager.conf: 
2013-04-16T08:12:17.691993
  nmcli-con:
   NAME                      UUID                                   TYPE        
      TIMESTAMP    TIMESTAMP-REAL                     AUTOCONNECT   READONLY   
DBUS-PATH
   Wired connection 1        179bc6d7-cd13-4cfb-b73f-e8da8362a511   
802-3-ethernet    1364485020   tor 28 mar 2013 16:37:00           yes           
no         /org/freedesktop/NetworkManager/Settings/2
   Wiggum                    2a818c4e-494c-4b91-be56-630636608f07   
802-11-wireless   1366092808   tis 16 apr 2013 08:13:28           yes           
no         /org/freedesktop/NetworkManager/Settings/1
                     81e14bde-0b0b-42be-8b56-3bfda6ca60fc   vpn               
1366092850   tis 16 apr 2013 08:14:10           yes           no         
/org/freedesktop/NetworkManager/Settings/0
                  aad98317-a8e1-4ff7-b3b5-7c43c1bcfd32   802-11-wireless   
1358879064   tis 22 jan 2013 19:24:24           yes           no         
/org/freedesktop/NetworkManager/Settings/3
  nmcli-dev:
   DEVICE     TYPE              STATE         DBUS-PATH
   eth1       802-11-wireless   connected     
/org/freedesktop/NetworkManager/Devices/1
   eth0       802-3-ethernet    unavailable   
/org/freedesktop/NetworkManager/Devices/0
  nmcli-nm:
   RUNNING         VERSION    STATE           NET-ENABLED   WIFI-HARDWARE   
WIFI       WWAN-HARDWARE   WWAN
   running         0.9.6.0    connected       enabled       enabled         
enabled    enabled         disabled

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager-openvpn/+bug/1169437/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to