On Sun, 2016-09-11 at 23:45 +0300, Edward Haas wrote: > On Sun, Sep 11, 2016 at 10:56 PM, Thomas Haller <[email protected]> > wrote: > > > > > 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. > > Hi, > > > > > > If NetworkManager is not running, there isn't a concept of "active > > connection". What would that be? > > > NM is defining multiple connection/ifcfg files, I hoped to have the > last > active one > referenced somewhere. > The fact that NM leaves multiple ifcfg files with autoconnect enabled > is a > problem, > it is not a supported state for initscripts.
AFAIK it is supported just fine by the initscripts. If you have multiple NICs, every ifcfg that can be started (eg, ONBOOT=yes) will be started. You can also "ifup FOO; ifup BAR" and these will be active in parallel. What's less defined is what ifcfg file gets the default route and which nameservers are used, but that's controlled by DEFROUTE=[yes/no] and PEERDNS=[yes/no]... in short, much more manual configuration when using plain initscripts, but multiple autoconnect is definitely there. Dan > > > > > > > > > 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=74644 > > 0 is > > 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. > > > Is this considered for back-porting to centos7/rhel7? > > 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 > > It is related to an oVirt node that is initially setup using Cockpit > (through NM). > Then, VDSM is installed and NM is disabled to avoid collisions. > At this point, VDSM is required to acquire the last active ifcfg file > and > adjust it > for VDSM. > The problem is: There may be multiple such ifcfg files, so which one > should > be > acquired and which should be just removed? > > This is actually an intermediate solution, I would prefer to either > leave > NM running > and work with it, or ask it to 'ignore' devices. > ifcfg is also something we should stop using directly. > But all of these options won't happen in the immediate time frame, > and we > need > something now. > > Thanks, > Edy. > _______________________________________________ > networkmanager-list mailing list > [email protected] > https://mail.gnome.org/mailman/listinfo/networkmanager-list _______________________________________________ networkmanager-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/networkmanager-list
