HOWTO force logical nic order ?

Matt Domsch Matt_Domsch at dell.com
Fri Dec 2 08:19:58 CST 2005


On Fri, Dec 02, 2005 at 10:02:57AM +0100, Florent Gilain wrote:
> Hi all,
> 
> I have many PE1850 with dual onboard card and another PCI dual ethernet
> network card in.
> 
> Now, when i install my RHEL3.0ES, my logic would like that :
> 
> Eth0 = onboardA
> Eth1 = onboardB
> Eth2 = pci card nic1
> Eth3 = pci card nic2
> 
> My question is finally : how can i force this order for detection ? Because
> for the moment, eth0 = pci card nic1....
> 
> Thanks a lot
> 
> Florent - Linux beginner....

This question came up internally just a few days ago again.
Fundamentally, Linux doesn't know which NICs are onboardA or
onboardB.  There are some heuristics you can apply to guess, but
there's no mapping provided by the BIOS that the OS can rely upon.

You'll need to configure the OS to name devices according to the
ethernet MAC address, which is unique per NIC.  Files
/etc/sysconfig/network-scripts/ifcfg-ethN have a line:
HWADDR="xx:xx:xx:xx:xx:xx"

which you set to match the HWaddr values reported by ifconfig.

Then on network restart the NICs will get named according to what the
config files have for their MAC address.

May I also suggest that rather than using names like eth0, eth1, eth2,
eth3, that you name them according to their function?  Such as public,
backup, wired-lan, and wireless-lan ?  Then the exact ordering doesn't
matter, as you're using functional names rather than some abstract
logical ordering which is subject to change.


I wrote a script to try to automate naming them in order.  Feel free
to try it, but be sure to back up your
/etc/sysconfig/network-scripts/ifcfg-eth* and /etc/modprobe.conf files
first. :-)

http://linux.dell.com/files/name_eths/name_eths-0.1.tar.gz
http://linux.dell.com/files/name_eths/name_eths-0.1.tar.gz.sign

Extract and run ./name_eths, and it'll reconfigure your
/etc/sysconfig/network-scripts/ifcfg-eth* and /etc/modprobe.conf file
(if you've got older RHEL3, modify it to change /etc/modules.conf
instead).  It tries to put the first and second onboard
NICs as eth0 and eth1, and then orders the remaining NICs in ascending
PCI slot order.  Please let me know if it guesses wrong.

Thanks,
Matt

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com



More information about the Linux-PowerEdge mailing list