[CentOS] Nic order detection

Thu Jan 10 13:49:16 UTC 2008
Les Mikesell <lesmikesell at gmail.com>

MatsK wrote:
> Les Mikesell wrote:
>> I have a number of machines that have 4 NICs, two of which are 
>> actually in use, running Centos 5.  When they are rebooted, they seem 
>> to change the eth interface names, assigning them in different 
>> orders.  I'm a little fuzzy on the details because they are at a 
>> remote location and I can't access them easily - especially after the 
>> network breaks.  Shouldn't:
>> alias eth0 bnx2
>> alias eth1 bnx2
>> alias eth2 e1000
>> alias eth3 e1000
>> in /etc/modprobe.conf always make the intel cards eth2 and 3?
> 
> Noop, this is done with ifcfg-ethX where X is the if number.
> 
> Create a /etc/sysconfig/network/ifcfg-eth0 that look like this example:
> 
> DEVICE=eth0
> HWADDR=00:01:23:45:67:89
> ONBOOT=yes
> TYPE=Ethernet
> NETMASK=255.255.255.0
> IPADDR=192.168.1.154
> GATEWAY=192.168.1.1
> 
> and then create ifcfg-eth1, ifcfg-eth2, ifcfg-eth3
> 
> then do a "service network restart" to activate the settings.

I do have the ifcfg-ethX files for the 2 interfaces that are currently 
active, but since the machines were built by image copies of a master 
disk, they do not have HWADDR address entries.  A person on-site with 
access to the console adjusted them if they didn't come up right the 
first time, but they seem to shift around on each reboot.  Will adding 
the HWADDR entry nail them down even if it doesn't match the nic type 
specified in modprobe.conf?  Can someone point me to the code where this 
happens?  Until recently the machines were running centos 3.x and this 
seems to be a difference in behavior.

-- 
    Les Mikesell
     lesmikesell at gmail.com