RedHat /Implicit/default connection(s)

Thomas Haller thaller at redhat.com
Fri Apr 26 10:43:51 UTC 2024


On Fri, 2024-04-26 at 12:30 +0200, Thomas HUMMEL wrote:
> 
> 
> On 4/26/24 12:26, Thomas Haller wrote:
> 
> > I don't think that NM automatically would create such an ifcfg
> > file. It
> > would then be called "ifcf-Wired connection 1".
> 
> Ok, but you confirm that managing a device, Network would try to
> enable 
> a profile for it and for an eth nic, that would mean implicit dhcp 
> request, correct ?

Don't think about DHCP in the first step. What matters, is whether the
device/profile is activated/connect. NM does DHCP, while a device is
activating/activated. That is, when having a DHCP enabled connection
profile connecting/connected for the device. Check `nmcli connection`
and `nmcli device` to see what activated.

Note that for "connected (external)" devices that is not true. Those
are *not* actively controlled by NetworkManager. NetworkManager will
not run DHCP in that case or do anything with the device. All it does
is generating a profile for it and presenting it as "connected
(external)".


If the device is unmanaged (as you see in `nmcli device`), then NM does
nothing with it. Otherwise, it's managed.

If a device is in state "disconnected", then autoconnect of a profile
may happen. That requires that a suitable profile exists. If the device
is already activated, then autoconnect cannot happen.

Usually, a profile can also only be active on one device at a time. So
usually it can only autoconnect on one device. Unless
"connection.multi-connect" is enabled.



If NM starts (e.g. after switch from initrd to real-root, or the first
time in initrd), then NetworkManager does the usual autoconnect thing.
However, it might find state in /run/NetworkManager that indicates that
NetworkManager was managing a device previously (e.g. before `systemctl
restart`). In that case, the specified profile is activated (again).
Otherwise, if the device is already configured externally, it does the
"connected (external)" thing. Otherwise, it searches for a suitable
profile to autoconnect. It might also generate a "Wired connection 1"
and use that. Otherwise, the device stays disconnected, until a
suitable profile appears that can autoconnect or the user manually
activates a profile.


Basically, it should happen the way you would expect(?)

> 
> 
> > Check the syslog/journal. NetworkManager should log when it creates
> > a
> > profile. If the profile exists before NetworkManager starts, then
> > you
> > know something else create it. Possibly enable `level=TRACE`. See
> > DEBUGGING in `man NetworkManager`.
> 
> I'll dig deeper on my own. Thanks again for your help
> 



More information about the Networkmanager mailing list