A simple place to start would be “ls /sys/class/net”… after that heuristics to 
eliminate “lo” and “ib*”,
use ethtool to see which of the rest has link up, and choose the one with the 
lowest number that is lit up.

 — ddj

> On Jun 30, 2016, at 1:17 PM, Andrew Loftus <[email protected]> wrote:
> 
> Does anyone have any experience or ideas how to acquire (ethernet) interface 
> names dynamically?
> 
> For instance, in setting up secondary networks, entries in the "nics" table 
> require both the interface name and associated network information.  However, 
> these interface names aren't known before the OS is installed (unless one 
> node has already been installed and the interface names checked manually).  
> Furthermore, the interface names change based on a combination of OS version, 
> hardware model, and install type combination.  So it's not very robust.
> 
> My thought is to setup secondary networks using a postbootscript.  I'm 
> looking for ideas to scan each ethernet interfaces and discover the network 
> information to setup the secondary networks using that information.
> 
> Cheers,
> --Andy
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape_______________________________________________
> xCAT-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xcat-user


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user

Reply via email to