You are not logged in.

#1 2016-04-05 00:21:12

dolfandringa
Member
From: Zamboanguita, The Philippines
Registered: 2016-04-05
Posts: 1
Website

OpenVPN netctl-auto DNS and openresolv/resolvconf conflict

This problem is keeping me occupied for a few days already. I am running netctl-auto on my wireless nick wlan0. In /etc/netctl/hooks/dhcp I have set DHCPClient='dhclient'. Whenever I connect to a wlan, the DNS server gets set in /etc/resolv.conf. If I understand the netctl docs correctly, it should set the DNS server through resolvconf.
I also have an openvpn client on this laptop, which connects through a tap device to an openvpn server. The openvpn server pushes a DHCP option to the client when it connects setting a different DNS server (in the openvpn internal network) with . I have this script (installed through AUR) to update my resolvconf: https://raw.githubusercontent.com/maste … lv-conf.sh and restore it when openvpn connects/disconnects (see https://github.com/masterkorp/openvpn-u … esolv-conf for docs on what I added to my openvpn conf for this).
Here is the catch though, whenever I start openvpn, it doesn't seem to change /etc/resolv.conf at all. If I run the update-resolv-conf script directly as derived from the up script command shown in the openvpn logs, with addition of the necessary environment variables (which are not listed in the log) like this:

sudo dev='tap0' script_type='up' foreign_option_1='dhcp-option DNS <x.x.x.x>' /usr/bin/update-resolv-conf.sh tap0 1500 1573 <x.x.x.y> 255.255.255.0 init

the resolv.conf does get updated. So the script seems to be fine, and does get run by openvpn. But somehow it doesn't result in resolvconf being run. I checked resolvconf with

resolvconf -i

And see nothing for tap0.inet which should contain information for the tap0 interface.

Manually updating resolv.conf doesn't work as with every dhcp renew (every 20min with my wifi unfortunately) the dns server gets set back to the wifi one in /etc/resolv.conf.
My wlan config is a very simple config with IP=dhcp.

EDIT:

I have got dhclient, which is used by netctl, to use resolvconf instead of it directly editing /etc/resolv.conf by saving the script from http://apt-browse.org/browse/debian/whe … resolvconf as /etc/dhclient-enter-hooks (and making it executable).
Now at least resolvconf manages /etc/resolv.conf and any changes made through resolvconf don't get overwritten by dhclient. But the problem remains that the update-resolv-conf.sh script that is called by openvpn doesn't result in extra information for the tap0.inet interface in resolvconf, while when I run the update-resolv-conf.sh script manually, it does work.
Cheers,

Dolf.

Last edited by dolfandringa (2016-04-05 09:08:36)

Offline

Board footer

Powered by FluxBB