Hi,On Sun, 2016-09-11 at 15:45 +0300, Edward Haas wrote:
> Hello,
>
> Assuming there are multiple connection defined for an ethernet device
> and only a single one is active, how can I detect which ifcfg file
> was used for the connection?
>
> I cannot use nmcli for this, as NetworkManager is down at the moment
> I need the information.
> I just hope this info is available somewhere (as when starting NM,
> the correct connection is activated).
>
> Thanks,
> Edy.
If NetworkManager is not running, there isn't a concept of "active
connection". What would that be?
When NM starts and the device has IP configuration, NM will pick a
connection that matches to what is currently configured on the
interface. In my opinion, that is a wrong thing, but that is what
currently happens. https://bugzilla.gnome.org/show_bug.cgi?id= is746440
supposed to improve on that, and it also will write a state-file that
contains which connection was active on a device when NetworkManager
stopped.
When the device has no IP configuration at startup, NetworkManager will
autoconnect one of the available connections. Thereby it takes into
account connection.autoconnect-priority and connection.timestamp.
Maybe it would be helpful to explain what you are trying to do as an
end-goal. If NetworkManager is not running, why would you want to know
which connection was active when it stopped?
Thomas