I am in the process of upgrading a legacy system from RHEL 5.4 to 5.8. There are three NICs installed, each with defined IP addresses and attached wiring.After the upgrade, the cards are on the same PCI addresses but the OS has shuffled the NIC designations:network old  newnet A   eth0 eth1net B   eth1 eth2net C   eth2 eth0The PCI addresses in use are 05.03.0 for Net C and the other two are on 03.03.0 and 03.03.1.There is no /etc/udev/rules.d/70-persistent-net.rules file.Is there a way to specify which PCI addresses are used for each interface?UpdateI have found /etc/sysconfig/hwconf and /etc/sysconfig/network-scripts/ifcfg-eth? files that contain the IP and MAC address values. hwconf also specifies the PCI address, but seems to get re-written on boot.I would prefer to be able to specify the NICs by PCI position as this is effectively what is used to determine the behaviour rather than MAC address which would be changed if a different card was used.
Determining NIC designation from PCI address
networking;rhel;pci
This is generally done by MAC address, not PCI address.If RHEL 5.8 supports the /etc/udev/rules.d/70-persistent-net.rules file, you could create one.Just copy one from another machine and edit it so that the correct device name is assigned based on MAC address.All you really need in that file is 3 lines like this one: (ignore any line-wrapping, this is all one line)SUBSYSTEM==net, ACTION==add, DRIVERS==?*, ATTR{address}==00:23:cd:b0:23:b9, ATTR{type}==1, KERNEL==eth*, NAME=eth0Change the ATTR{addresss} and NAME=eth[012] to suit your NICs and your requirements.I'm not sure if RHEL 5.4 or 5.8 has it, but it might be worthwhile checking to see if you have a script called /lib/udev/write_net_rules - if you have, just run it, it will generate the 70-persistent-net.rules file, so just edit the NAME for each NIC.You can get the MAC addresses with ifconfig | grep 'eth.*HWaddr', then just copy-paste them into the 70-persistent-net.rules file.When that's done, you can either reboot, or down all your interfaces, unload their kernel driver modules, reload the modules (the interfaces will now have their assigned device names), and then bring your interfaces back up.Before udev and the 70-persistent-net.rules file, I used to use a program called ifrename from the wireless-tools package (it works on any NIC, not just wireless).  It uses an /etc/iftab file to rename network interfaces by MAC address.  It mostly worked, but was less reliable than the udev method.I have no idea if it's packaged for RHEL or not but you can find it at http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.htmlI haven't used this method for a NIC myself, but it is also possible to use udev to persistently name devices based on PCI address.  First, delete the /etc/udev/rules/70-persistent-net.rules if it exists.  Then create a new file in /etc/udev/rules - perhaps call it 70-persistent-net-by-pci.rulesAdd lines like the following:ACTION==add, SUBSYSTEM==net, BUS==pci, KERNELS==0000:03:03.0,    NAME=eth0ACTION==add, SUBSYSTEM==net, BUS==pci, KERNELS==0000:03:03.1,    NAME=eth1ACTION==add, SUBSYSTEM==net, BUS==pci, KERNELS==0000:05:03.0,    NAME=eth2On some newer Linuxes (e.g. Ubuntu 13.04 or later) you need to remove the BUS qualifier, so the rule(s) should look like:ACTION==add, SUBSYSTEM==net, KERNELS==0000:03:03.0,    NAME=eth0Then either reboot or unload & reload the driver modules as described above.You can find more details at http://linux-tips.org/article/73/persistent-device-naming-with-udev - but the page is fairly old and refers to the obsolete udevinfo command.  Use udevadm info instead