Bug 1650221 - [RFE] add a mode "device.no-auto-manage" to mark devices as unmanaged until we have a profile for it
Summary: [RFE] add a mode "device.no-auto-manage" to mark devices as unmanaged until w...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: NetworkManager
Version: 8.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.0
Assignee: Thomas Haller
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-15 15:40 UTC by Thomas Haller
Modified: 2020-01-23 22:11 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description Thomas Haller 2018-11-15 15:40:18 UTC
When a user wants to configure a device outside of NetworkManager (iproute2), then the best way is to explicitly configure the device as unmanaged in NetworkManager. This can be done via permanent configuration (NetworkManager.conf, udev, etc) or ad-hoc via `nmcli device set "$DEVICE" managed no`.


Of course, often the user doesn't do that. So, when NM notices that the device is externally configured, then it generates an in-memory profile and goes into pretend-only mode. See https://bugzilla.redhat.com/show_bug.cgi?id=1616363#c3
This "externally-managed" behaviour is complex, confusing and buggy.


Another problem is, when the user does not intend NM to handle the device, NM still touches and interferes. It does so when moving the devices into "disconnected" state. At the very least NM will:
 - set the device as IFF_UP (it does so, because NM wants to receive the state of carrier/cable)
 - it will set IPv6 addr-gen-mode none and accept_ra 0 (because while IFF_UP, the device must be logically disconnected and have no IP configuration. See also bug 1628900).

If the user then wants to configure the device manually, NM already disables IPv6 on the device and otherwise interfered.




This is ultimately because

 - NetworkManager wants to manage devices by default. It assumes that if you run NM, then you want to use it. Also, it currently really wants to get the carrier state and set the device IFF_UP (and interfering with it already).

 - by default (unless "main.no-auto-default" is on), NM will even go so far and generate a default profile that can autoactivate on the device. It really wants to manage this device.



I think we could improve this easily. Add a new option "device.no-auto-manage". This option is per-device (or of course, for every device).

"device.no-auto-manage=1" means, that NM will automatically mark the device as unmanaged until a connection profile for the device exits.


"device.no-auto-manage" implies "main.no-auto-default".


This is more like what systemd-networkd does: the device is unmanaged by default, unless there is a profile for it.



A package like NetworkManager-config-server could install such a configuration snippet. For example /usr/lib/NetworkManager/conf.d/00-server.conf with

  [device-00-server-no-auto-managed]
  # only do this for certain device types:
  match-device=type:ethernet,type:bond,type:bridge
  no-auto-managed=1

an expicit `nmcli device connect` shold still overrule this (including generating a profile, as it currently would).

Comment 1 sushil kulkarni 2019-10-15 16:01:48 UTC
Parking for 8.3 for now.

-Sushil


Note You need to log in before you can comment on or make changes to this bug.