Bug 1650221

Summary: [RFE] add a mode "device.no-auto-manage" to mark devices as unmanaged until we have a profile for it
Product: Red Hat Enterprise Linux 8 Reporter: Thomas Haller <thaller>
Component: NetworkManagerAssignee: Thomas Haller <thaller>
Status: CLOSED WONTFIX QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: acardace, atragler, bgalvani, fgiudici, jmaxwell, lrintel, pasik, rkhan, sukulkar, thaller, till
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-01-22 14:04:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1616363    

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

Comment 6 Antonio Cardace 2021-01-22 14:04:09 UTC
Thank you for reporting this. Unfortunately, we don't have the capacity to fix this in the foreseeable future and therefore I will close this. In case this issue is more important than we estimated, please re-open this or file a new bug.