Red Hat Bugzilla – Bug 477832
Interface not brought up properly if no link detected
Last modified: 2013-02-13 21:38:35 EST
I'm running eth0 using dhcp which works fine but I've configured a static IP for eth1 and NM doesn't bring up the interface until it actually has a link.
This is the config:
# nVidia Corporation MCP61 Ethernet
This is what the log has to say about eth1 during bootup:
Dec 24 01:45:20 nexus NetworkManager: <info> (eth1): device state change: 1 -> 2
Dec 24 01:45:20 nexus NetworkManager: <info> (eth1): bringing up device.
Dec 24 01:45:20 nexus NetworkManager: <info> (eth1): preparing device.
Dec 24 01:45:20 nexus NetworkManager: <info> (eth1): deactivating device (reason: 2).
Dec 24 01:45:20 nexus NetworkManager: <info> (eth1): carrier now ON (device state 2)
Dec 24 01:45:20 nexus NetworkManager: <info> (eth1): device state change: 2 -> 3
Dec 24 01:45:20 nexus NetworkManager: <info> (eth1): carrier now OFF (device state 3)
Dec 24 01:45:20 nexus NetworkManager: <info> (eth1): device state change: 3 -> 2
Dec 24 01:45:20 nexus NetworkManager: <info> (eth1): deactivating device (reason: 40).
After that the interface eth1 has no IP address which makes the dhcpd startup fail that I configured to serve IPs to machines connected to that interface.
Once I connect a machine NM reports a link and the IP gets set correctly even after disconnecting the interface.
The correct behavior would be to just bring the interface up properly independent of the link status.
Bringing the interface up is pointless until it has a link, because no traffic can pass through it until there is a link. NetworkManager will not bring up interfaces that cannot be used. When you plug a cable in, the interface will be brought up and configured with whatever method you've selected, either DHCP or static IP.
It's certainly not pointless and a substantial change of behavior of the networking subsystem.
If the interface isn't brought up daemons cannot bind to that address like they could with /etc/init.d/network. That's how I discovered the problem in the first place. Also I don't think it should be optional for NetworkManager to apply my configuration. When I explicitly specify that interface should get an IP than it's pretty rude of NM to simply ignore that.
NM will apply that configure when the device can actually be used; you can't do anything with that interface when there's no cable plugged in. No traffic can flow in or out of that interface when no cable is plugged in.
Services that can't handle network situations changing underneath them need to either (a) be fixed to notice address changes internally like NTP, Avahi, and countless others do already, or (b) be restarted using a dispatcher script when the interface/address they care about gets assigned to an interface.
In some simpler cases you can bind the service to 0.0.0.0 and the problem won't happen.
But this isn't a NetworkManager problem; it's something that's going to get pushed off onto the daemons themselves, or a service like Upstart that automatically starts/stops services when the resources the service requires becomes available.
A dispatcher script gets put into /etc/NetworkManager/dispatcher.d, should be owned by root, be not writable by anyone but root, and gets two arguments: the interface and an action. The action can be "up" or "down" or a few other things. Thus, when an interface comes "up", you can check the IP address of that interface, and if it's the one the service cares about, run "/sbin/service apache restart" for example. When the interface goes "down", you can "/sbin/service apache stop".
Hi all and happy upcoming New Year,
I, too, have been hitting this quite often since switching to NM. While I understand that daemons managing this would be ideal, we are far from this scenario and there are just too many daemons/services affected by this (ATM I'm coping with cobbler on a laptop).
Wouldn't an option to allow ignoring link state make everyone happy? This would allow the rest of the infrastructure to catch up while users would not have to revert to non-NM ways of setting up the network.
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '16'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 16's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 16 is 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" 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:
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.