Bug 699614

Summary: NetworkManager with no active connections overwrites valid resolv.conf
Product: [Fedora] Fedora Reporter: Martin Wilck <martin.wilck>
Component: NetworkManagerAssignee: Dan Williams <dcbw>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dcbw, jklimes
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-16 13:01:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
network configuration
none
messages none

Description Martin Wilck 2011-04-26 07:43:57 UTC
Description of problem:

On my laptop, I need to operate virtual machines, and these VMs need to register with a central service in a way that prevents me from using NAT + routing (VMs need to be in ordinary LAN). Thus I use bridged interfaces, and because Networkmanager doesn't support bridging, I am forced to activate these  interfaces via static networking at boot time (I am connected to the wired network most of the time when I boot my system).

When I am moving (and my wired/bridged interface is down), I need to use NetworkManager for roaming WLAN access nonetheless. Bridging through wireless doesn't work anyway, so using NetworkManager is the first choice for that case.

Unfortunately, this leaves me with a non-functional networking setup after booting, because NetworkManager overwrites the valid /etc/resolv.conf file with an empty one.

Version-Release number of selected component (if applicable):

NetworkManager-0.8.3.998-2.fc14.x86_64
initscripts-9.20.2-1.fc14.1.x86_64

How reproducible:
always

Steps to Reproduce:
1. networking setup as attached, NetworkManager on
2. boot
  
Actual results:
No connectivity because of broken /etc/resolv.conf.

Expected results:
Working network after booting; NetworkManager doesn't overwrite resolv.conf when there is a working static network connection and all NM-controlled connections are down.

Additional info:
I am aware that the NM-generated resolv.conf file hints to use DNS1=... in static network configuration but that is wrong if the connection is controlled by DHCP. Moreover, NetworkManager forces me to add DNS entries which are valid for my wired interface to the NM-controlled wireless interface, which isn't necessarily correct. So while this workaround works somehow, it is certainly not the Right Thing to do.

Comment 1 Martin Wilck 2011-04-26 07:44:35 UTC
Created attachment 494832 [details]
network configuration

Comment 2 Martin Wilck 2011-04-26 07:44:56 UTC
Created attachment 494833 [details]
messages

Comment 3 Martin Wilck 2011-04-26 08:22:13 UTC
I need to correct my statement from the bug description. Although I have DNS1=... entries in ifcfg-files, I get no DNS server entry in resolv.conf.

[root@cooper network-scripts]# egrep DNS1\|NM_CON /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-br0:NM_CONTROLLED=no
/etc/sysconfig/network-scripts/ifcfg-br0:DNS1=172.25.253.253
/etc/sysconfig/network-scripts/ifcfg-eth0:NM_CONTROLLED=no
/etc/sysconfig/network-scripts/ifcfg-wlan0:DNS1=172.25.253.253

[root@cooper network-scripts]# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:a0:d1:c7:22:d3 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:16:44:6f:38:ca brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    link/ether 00:a0:d1:c7:22:d3 brd ff:ff:ff:ff:ff:ff
5: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    link/ether 8a:d3:94:58:bf:f2 brd ff:ff:ff:ff:ff:ff

[root@cooper network-scripts]# cat /etc/resolv.conf 
# Generated by NetworkManager
search psw.pdbps.fsc.net
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com

Comment 4 Martin Wilck 2011-04-26 08:24:27 UTC
The only way I currently see to work around this is to set ONBOOT=no in ifcfg-br0 and start the interface manually after logging in. Not exactly what I'd call user-friendly.

Comment 5 Martin Wilck 2011-09-07 08:39:25 UTC
Needless to say, this hasn't changed in F15.

Comment 6 Jirka Klimes 2011-09-07 16:05:08 UTC
Your wireless connections (both ifcfg-wlan0 and ifcfg-Wireless_connection_1) are not properly configured:
Apr 26 09:09:43 cooper NetworkManager[1634]:    ifcfg-rh: parsing /etc/sysconfig/network-scripts/ifcfg-Wireless_connection_1 ...
Apr 26 09:09:43 cooper NetworkManager[1634]:    ifcfg-rh:     error: Missing IEEE_8021X_PASSWORD for EAP method 'MSCHAPV2'.
Apr 26 09:09:43 cooper NetworkManager[1634]:    ifcfg-rh: parsing /etc/sysconfig/network-scripts/ifcfg-wlan0 ...
Apr 26 09:09:43 cooper NetworkManager[1634]:    ifcfg-rh:     error: Missing SSID

So, because you have unmanaged wired interface with NM_CONTROLLED=no (due to bridging) and WiFi is not properly configured, you don't have any connection to activate and thus no DNSes.

If you configure a WiFi connection (manually or more easily with nm-connection-editor) and activate it, you can specify whatever DNS you want manualy or use dynamic DNS via DHCP (BOOTPROTO=dhcp in ifcfg file).

If you don't want to activate a connection via NetworkManager, and activate it manually (e.g. via network's ifup), the simplest solution is not to run NM at all.

Comment 7 Martin Wilck 2011-09-08 16:30:29 UTC
I think you misunderstand. 

Normally I use a non-nm-controlled bridged LAN interface. Only when I disconnect from the LAN, I would like to use NM to access WLAN (I activate WLAN in NM-applet, and it connects). 

Here I am talking about the *LAN connected* setup. All NM-managed connections are disabled in that state (just waiting to be turned on when I disconnect from LAN). Yet NM, which doesn't have any reasonable connection in this situation, overwrites my perfectly valid resolv.conf file.

The expected behavior would be that (in the presence of NM_CONTROLLED=no interfaces) NM leaves resolv.conf alone until it has at least one valid connection, and when that connection is terminated, restores resolv.conf to the previous state.

> If you don't want to activate a connection via NetworkManager, and activate it
> manually (e.g. via network's ifup), the simplest solution is not to run NM at
> all.

I could do that (only start NM when the LAN/bridge is disconnected), but I wouldn't call that user friendly.

(Btw - I don't think the WLAN settings are wrong here, but it doesn't matter anyway - I'm talking about connections that are disabled).

Comment 8 Fedora End Of Life 2012-08-16 13:01:23 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping