Re: NetworkManager, dns= and resolv.conf override



Hello Thomas,

actually I was able to reproduce the thing in a simplier way:

0/ I'm starting from here
##########################

- configuration : no 'dns=' directive :
- an auto profile
- a manual profile (active)
- an empty /etc/resolv.conf

# grep -i dns /etc/NetworkManager/NetworkManager.conf /etc/NetworkManager/conf.d/*
/etc/NetworkManager/conf.d/pasteur.conf:#dns=none

# cat /etc/sysconfig/network-scripts/ifcfg-enp33s0f0
DEVICE=enp33s0f0
BOOTPROTO=dhcp
HWADDR=ac:1f:6b:c8:ee:16
ONBOOT=yes

# cat /etc/sysconfig/network-scripts/ifcfg-xcat-enp33s0f0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=192.168.152.3
PREFIX=20
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=xcat-enp33s0f0
UUID=9b43d5ac-0c92-4dcf-b1b2-113ee146c052
DEVICE=enp33s0f0
ONBOOT=yes
AUTOCONNECT_PRIORITY=9
MTU=1500

# nmcli con show
NAME UUID TYPE DEVICE xcat-enp33s0f0 6830dc55-e121-4c10-8b64-cf692f063505 ethernet enp33s0f0 ib0 2ab4abde-b8a5-6cbc-19b1-2bfb193e4e89 infiniband ib0 System enp33s0f0 03a3d6a6-33d2-bba1-f78c-e1d7861520ba ethernet --

# cat /etc/resolv.conf
# Generated by NetworkManager

1/ deactivate active connection
################################

- auto profile takes over, gets dns params via dhcp

# nmcli con down xcat-enp33s0f0
Connection 'xcat-enp33s0f0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)

# nmcli con show
NAME UUID TYPE DEVICE System enp33s0f0 03a3d6a6-33d2-bba1-f78c-e1d7861520ba ethernet enp33s0f0 ib0 2ab4abde-b8a5-6cbc-19b1-2bfb193e4e89 infiniband ib0
xcat-enp33s0f0    9b43d5ac-0c92-4dcf-b1b2-113ee146c052  ethernet    --

# cat /etc/resolv.conf
# Generated by NetworkManager
search maestro.pasteur.fr
nameserver 192.168.149.101
nameserver 192.168.149.102

2/ reactivate manual connection empties /etc/resolv.conf
#########################################################

- manual profile takes over
- /etc/resolv.conf is emptied

# nmcli con up xcat-enp33s0f0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7)

# nmcli con show
NAME UUID TYPE DEVICE xcat-enp33s0f0 9b43d5ac-0c92-4dcf-b1b2-113ee146c052 ethernet enp33s0f0 ib0 2ab4abde-b8a5-6cbc-19b1-2bfb193e4e89 infiniband ib0 System enp33s0f0 03a3d6a6-33d2-bba1-f78c-e1d7861520ba ethernet --

# cat /etc/resolv.conf
# Generated by NetworkManager

3/ manually write /etc/resolv.conf and reactivate the manual connection
#################################################################

- manual connection is reactivated
- leaves /etc/resolv.conf untouched

# cat <<EOF > /etc/resolv.conf
> search maestro.pasteur.fr
> nameserver 192.168.149.101
> nameserver 192.168.149.102
> EOF

# cat /etc/resolv.conf
search maestro.pasteur.fr
nameserver 192.168.149.101
nameserver 192.168.149.102

# nmcli con show
NAME UUID TYPE DEVICE xcat-enp33s0f0 9b43d5ac-0c92-4dcf-b1b2-113ee146c052 ethernet enp33s0f0 ib0 2ab4abde-b8a5-6cbc-19b1-2bfb193e4e89 infiniband ib0 System enp33s0f0 03a3d6a6-33d2-bba1-f78c-e1d7861520ba ethernet --

# nmcli con up xcat-enp33s0f0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)

# cat /etc/resolv.conf
search maestro.pasteur.fr
nameserver 192.168.149.101
nameserver 192.168.149.102

Can you help me understand what seems to be an inconsistent behavior regarding override of /etc/resolv.conf ?

Thanks

--
Thomas HUMMEL


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]