GNOME Bugzilla – Bug 705329
[nm] do not up my netdevs!
Last modified: 2016-09-01 23:37:00 UTC
test1:~$ cat /etc/NetworkManager/NetworkManager.conf [main] plugins=ifcfg-rh no-auto-default=* unmanaged-devices=* test1:~$ ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth0x: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 52:54:00:b2:a7:f1 brd ff:ff:ff:ff:ff:ff 3: e1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 52:54:00:3d:c7:6d brd ff:ff:ff:ff:ff:ff 4: e2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 52:54:00:73:15:c2 brd ff:ff:ff:ff:ff:ff 5: e3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 00:07:e9:11:22:33 brd ff:ff:ff:ff:ff:ff 6: e6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 52:54:00:28:34:7b brd ff:ff:ff:ff:ff:ff 7: e4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 52:54:00:e7:60:55 brd ff:ff:ff:ff:ff:ff 8: dovtapu: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 52:54:00:74:78:db brd ff:ff:ff:ff:ff:ff 9: e5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 52:54:00:b8:30:0b brd ff:ff:ff:ff:ff:ff test1:~$ sudo nmcli con NAME UUID TYPE TIMESTAMP-REAL System eth0x 5445eaf0-db79-ee09-647b-f4835548b263 802-3-ethernet Fri 02 Aug 2013 10:02:24 AM CEST test1:~$ I would expect NM do not touch netdevs at all when "unmanaged-devices=*" is set in config.
+ when I do "systemctl stop NetworkManager.service", it will put all netdevs DOWN, only eth0x stays UP
Which exact NetworkManager version and distro is this about?
(In reply to comment #2) > Which exact NetworkManager version and distro is this about? git master
After code study, looks like "unmanaged-devices" config option is ignored for other plugins than keyfile. I'll try to fix this up.
Ah, yeah, unmanaged-devices in NetworkManager.conf was basically just a workaround for the keyfile plugin; unmanagedness is supposed to be declared in individual connection config files (eg, with NM_CONTROLLED=no in the case of ifcfg-rh). But since everything in a keyfile file has to correspond to an NMSettings property, and there's no property for "unmanaged", then that meant that for keyfile we needed to create some other way to declare them unmanaged. Having two different ways to mark devices unmanaged when using ifcfg-rh might be confusing...
I was thinking about this and it would be really nice to have some general option telling NM to do not take care of any unknown (e.g. newly created) devices. I think that adding "no-auto-managed=true" into [main] section would do the trick. This would complete the "unmanaged" setting, because today you have to list exact devices or put NM_CONTROLLED=no into specific cfg files.
"unmanaged-devices=*" is more consistent with other options than "no-auto-managed=true" would be. the danw/disable branch adds the ability to set devices managed/unmanaged via D-Bus. This was originally written as part of a bug that probably isn't going to be fixed at this point, but the idea might still be good...
(In reply to comment #5) > Having two different ways to mark devices unmanaged when using ifcfg-rh might > be confusing... Having keyfile-specific data in NetworkManager.conf is confusing as well. And given that we *always* use keyfile at least as a fallback, it sounds strange to only support it partially (support connection files but not the global configuration). (In reply to comment #7) > "unmanaged-devices=*" is more consistent with other options than > "no-auto-managed=true" would be. How do you specify unmanaged-devices=* when using ifcfg-rh plugin then? (In reply to comment #6) > I was thinking about this and it would be really nice to have some general > option telling NM to do not take care of any unknown (e.g. newly created) > devices. And it would be nice if it was 'unmanaged-devices=*' in all cases, in my opinion. And in case the administrator specifies a list of devices instead of *, the list could be just merged with the list obtained from the ifcfg-rh plugin. I would say if the administrator writes something to /etc/NetworkManager.conf, he usually means it and therefore it should be either honored or refused with an error message. > This would complete the "unmanaged" setting, because today you have to list > exact devices or put NM_CONTROLLED=no into specific cfg files. Exactly.
(In reply to comment #8) > > "unmanaged-devices=*" is more consistent with other options than > > "no-auto-managed=true" would be. > > How do you specify unmanaged-devices=* when using ifcfg-rh plugin then? I meant "if we're going to have a settings-plugin-agnostic NetworkManager.conf variable for unmanaging devices, then..."
Any decision?
Marking this to be considered for 1.0 at the last minute, feel free to remove it once decided.
I don't think we'll change this for 1.0 but it's certainly still something we need to keep talking about.
There are various ways to unmanage a device now: 1) NM_CONTROLLED=no in an ifcfg-rh file 2) keyfile.unmanaged-devices=<spec> in NetworkManager.conf 3) via UDev rule NM_UNMANAGED. 4) at runtime via `nmcli device modify $IF managed no` 5) software devices that are created externally and are down are treated as unmanaged. With bug 746440, this should improve further. 1) and 2) are authoritative, that means a device that is configured to be unmanaged is and stays unmanaged. After improving (not) managing devices with bug 746440, other ways to unmanage a device shall be changeable via D-Bus command at runtime. Regarding comment 1, the feature is implemented. It is not called [main] unmanged-devices but [keyfile] unmanaged-device I think that is ugly and was a mistake. Anyway. It works exactly the same as the keyfile plugin is always present. Also, how would "no-auto-manage" work? Which devices are then actually managed? Note you can already do: [keyfile] unmanged-devices=*,except:interface-name:eth0 Closing as fixed.