We have a RHEL 5.5 box with 8 interfaces. And the eth
interface naming is flip flopping. Sometimes eth0
comes up on physical port 7th, and sometimes on another physical port.
We want the naming to be as per the sequence of PCI BUS. I did the research and found that
cat /sys/devices/pci0000\:00/0000\:00\:1e.0/0000\:07\:07.0/net\:eth0/address\
This locations have the mac address of the eth
devices. So If I get "address" in sequence from this pci bus locations and put them in ifconfig-eth0
to ifconfig-eth7
in order of PCI BUS location, my eth
naming will be stable.
I tried:
find /sys/devices/ -name "address"
but it does not bring any results. I don't know why…
Any help here?
Best Answer
Have you tried including the MAC addresses in the different ifcfg-ethX files for the various ethernet devices? Additionally you can control which device get's which ethX handle through udev's
60-net.rules
file.For example
Then in the file
/etc/udev/rules.d/60-net.rules
:I believe this information is used to keep the devices configured consistently from boot to boot.
Configuring more than one ethX device
To deal with more devices simply setup each devices corresponding
/etc/sysconfig/network-scripts/ifcfg-ethX
file, and add another line to the60-net.rules
file.The above is how you do it in CentOS 5.X. The file changes in CentOS 6.x to
70-persistent-net.rules
, and the format is slightly different too:References