← Back to team overview

desktop-packages team mailing list archive

[Bug 1211110] Re: network manager openvpn dns push data not updating system DNS addresses

 

I have found a work-around for 14.04 LTS. It's not the prettiest one but it works. When I started a vpn connection and then ran
ps -efwww | grep vpn
I could see that the openvpn is already called with flags "--script-security 2 --up /usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper". So the following can be performed.

sudo cp /usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper
/usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper.orig

sudo nano /usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper
--- Add the following 3 lines to the file. --- 
#!/bin/bash 
/etc/openvpn/update-resolv-conf $@
/usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper.orig $@
--- End---

sudo chmod +x /usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper

Now here is the really ugly part. Since openvpn was not called with the --down flag, you should run the following command every single time the vpn connection is closed.
Change the device name according to your connection settings.

sudo script_type=down dev=tun0 /etc/openvpn/update-resolv-conf

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

Title:
  network manager openvpn dns push data not updating system DNS
  addresses

Status in network-manager package in Ubuntu:
  Confirmed
Status in openvpn package in Ubuntu:
  Confirmed

Bug description:
  When IPv4 Method is set to Automatic VPN, DNS address recieved from
  OpenVPN server do not update resolv.conf.

  This can be achieved when using a standard openvpn config file by
  adding the lines:

  script-security 2
  up /etc/openvpn/update-resolv-conf
  down /etc/openvpn/update-resolv-conf

  In Network-manager there seems to be no option to run connection
  specific scripts and the DNS data from the server is ignored.

  Ubuntu 13.04
  Network-manager 0.9.8.0-0ubuntu6

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