Hi Thomas

This answer is exactely what i was looking for.

I found out that the only file modified was 

/var/lib/NetworkManager/timestamps

and i wanted to be certain of NM's behaviour 

Thanks a lot

Pierre / Peter

July 20, 2020 4:25:55 PM CEST Thomas Haller <thal...@redhat.com> wrote:On Mon, 
2020-07-20 at 16:00 +0200, Pierre Saminadin wrote:
> Hi all
> 
> i can't find this information in documentation, maybe i don't know
> exactly where to search
> 
> I want to know where network manager persistently store the "default
> connection profile" information.
> My distribution is CentOS 8
> 
> Example :
> - for the same device (enp0s3)
> - i have two connection profiles : 
>  - enp0s3-static
>  and 
>  - enp0s3-dhcp
> 
> these connection exist on my disk as two files 
> - directory : /etc/sysconfig/network-scripts
> - file 1 : ifcfg-enp0s3-static
> - file 2 : ifcfg-enp0s3-dynamic
> 
> i can't see any difference between these two file that can explain
> why one file is selected at boot and not the other
> 
> can you explain me please ?
> 

Hi,

you are talking about NetworkManager automatically activating one of
the profiles. See "connection.autoconnect" in `nmcli connection show
`$PROFILE"`.

When NetworkManager is in a situation where a device could autoconnect,
then it will try to find a suitable profile. For example, if the device
is not marked as unmanaged, a cable is plugged in or if the Wi-Fi scan
list gets updated, these the device could be ready to autoconnect.

A profile is suitable if it has autoconnect enabled, and if it matches
the device and the circumstances (e.g. for Wi-Fi the wifi.ssid is
visible in the scan list).

If there are multiple candidate profiles, NetworkManager chooses the
one with the better "connection.autoconnect-priority". If there are
still multiple, it chooses the one that connected last -- according to
"connection.timestamp". The timestamps are stored in
/var/lib/NetworkManager/timestamps.

If more than one candidate profile have the same (or no) timestamp,
then the choice is arbitrary. But successfully activating a profile
will update the timestamp, so the next time it won't be arbitrary
anymore.

best,
Thomas
_______________________________________________
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to