I have two servers with identical hardware ... TYAN i3210w system
boards with dual intel gigabit interfaces, and a PCI intel gigabit
nic. I'm running Centos 5.4, x86_64, 2.6.18-164.6.1.el5
Every other time I reboot, the nics initialize in a different order.
anaconda had setup /etc/modprobe.conf with alias lines for the cards:
alias eth0 e1000
alias eth1 e1000e
alias eth2 e1000e
However, introducing the bonding driver into the mix seems to have
thrown a wrench in the works.
alias bond0 bonding
options bond0 miimon=80 mode=5 #or something like that, can't get to
the machine right now - no console and the network is down
So, I read about the ifcfg options and try assigning each config
script an HWADDR line.
after rebooting, /var/log/messages announces that hardware address for
eth1 does not match, skipping ... same for eth2
Reading the archives seems to indicate modprobe.conf doesn't do much
and is made obsolete by udev, and that hwaddr is discouraged because
it's a band-aid. The archives seem to suggest fiddling with udev to
be the answer. So I modify /etc/udev/rules.d/60-net (or something)
and add a few rules found in an ancient example (those aren't my mac
addresses):
KERNEL=="eth?", SYSFS{address}=="00:37:e9:17:64:af",
NAME="eth0" #
MAC of first NIC in lowercase
KERNEL=="eth?", SYSFS{address}=="00:21:e9:17:64:b5",
NAME="eth1" #
MAC of second NIC in lowercase
Now, all three network cards get assigned as eth0! eth1 and eth2 are
no longer found. The pci-express nics (onboard) get detected first,
and the pci nic is last, so it ends up "owning" the eth0 alias.
I don't really care which alias gets assigned to which nic, but I want
that assignment to be constant.
All suggestions are appreciated!
Gordon
On Mon, Nov 23, 2009 at 2:38 AM, Gordon McLellan <gordonthree at gmail.com> wrote:> The archives seem to suggest fiddling with udev to > be the answer. ?So I modify /etc/udev/rules.d/60-net (or something) > and add a few rules found in an ancient example (those aren't my mac > addresses): > KERNEL=="eth?", SYSFS{address}=="00:37:e9:17:64:af", NAME="eth0" ?# > MAC of first NIC in lowercase > KERNEL=="eth?", SYSFS{address}=="00:21:e9:17:64:b5", NAME="eth1" ?# > MAC of second NIC in lowercase > > Now, all three network cards get assigned as eth0! eth1 and eth2 are > no longer found.?The pci-express nics (onboard) get detected first, > and the pci nic is last, so it ends up "owning" the eth0 alias.Changing SYSFS to ATTR should do it.
On 11/22/2009 8:38 PM, Gordon McLellan wrote:> I have two servers with identical hardware ... TYAN i3210w system > boards with dual intel gigabit interfaces, and a PCI intel gigabit > nic. I'm running Centos 5.4, x86_64, 2.6.18-164.6.1.el5 > > Every other time I reboot, the nics initialize in a different order.On the servers where I'm currently using bonding... (this is what Ross Walker said on the 23rd). Here's an example for a server w/ 4 total NICs, bonded into a pair of pairs. /etc/modprobe.conf alias eth0 tg3 alias eth1 tg3 alias eth2 forcedeth alias eth3 forcedeth alias scsi_hostadapter sata_nv # BONDING # Set general bonding options (allows multiple bonds) options bonding max_bonds=2 # Define the two bonds alias bond0 bonding alias bond1 bonding /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=none HWADDR=00:16:36:##:##:## ONBOOT=yes MASTER=bond0 SLAVE=yes USERCTL=no TYPE=Ethernet /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 BOOTPROTO=none ONBOOT=yes USERCTL=no TYPE=Ethernet BONDING_OPTS="mode=1 miimon=100" NETWORK=nnn.nnn.nnn.nnn NETMASK=nnn.nnn.nnn.nnn IPADDR=nnn.nnn.nnn.nnn GATEWAY=nnn.nnn.nnn.nnn Basically, we create (1) file for each ethernet interface under /etc/sysconfig/network-scripts (ifcfg-eth0, ifcfg-eth1, ifcfg-eth2, ifcfg-eth3), then we create (1) file for each bonded interface there as well (ifcfg-bond0, ifcfg-bond1). Bond membership is defined in the ifcfg-eth# files, while the bond options are defined in the ifcfg-bond# file. You can find out MACs by looking /etc/sysconfig/hwconf.