After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705329 - [nm] do not up my netdevs!
[nm] do not up my netdevs!
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal major
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-08-02 08:08 UTC by Jiri Pirko
Modified: 2016-09-01 23:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jiri Pirko 2013-08-02 08:08:07 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.
Comment 1 Jiri Pirko 2013-08-02 08:15:41 UTC
+ when I do "systemctl stop NetworkManager.service", it will put all netdevs DOWN, only eth0x stays UP
Comment 2 André Klapper 2013-08-02 12:20:49 UTC
Which exact NetworkManager version and distro is this about?
Comment 3 Jiri Pirko 2013-08-02 14:07:10 UTC
(In reply to comment #2)
> Which exact NetworkManager version and distro is this about?

git master
Comment 4 Jiri Pirko 2013-08-07 14:16:01 UTC
After code study, looks like "unmanaged-devices" config option is ignored for other plugins than keyfile. I'll try to fix this up.
Comment 5 Dan Winship 2013-08-07 15:34:14 UTC
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...
Comment 6 Jiri Pirko 2013-08-08 11:32:35 UTC
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.
Comment 7 Dan Winship 2013-08-08 15:20:29 UTC
"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...
Comment 8 Pavel Simerda 2013-08-12 14:53:07 UTC
(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.
Comment 9 Dan Winship 2013-08-12 20:52:00 UTC
(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..."
Comment 10 Pavel Simerda 2014-02-02 16:27:21 UTC
Any decision?
Comment 11 Pavel Simerda 2014-11-20 19:34:59 UTC
Marking this to be considered for 1.0 at the last minute, feel free to remove it once decided.
Comment 12 Dan Williams 2014-11-20 22:03:33 UTC
I don't think we'll change this for 1.0 but it's certainly still something we need to keep talking about.
Comment 13 Thomas Haller 2016-09-01 23:37:00 UTC
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.