Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two HP servers which have a total of 10 Ethernet ports each, both running RHEL 5.7. I need to make sure that Ethernet ports are mapped to the same devices in Linux on both systems (see below) because these servers must be identical (the second box is a drop-in replacement in case the first system fails).

The ethernet ports on the first system are mapped as follows:

Device          Port
eth0            Intel Dual Port Card, Port 1 (Rightmost Port)
eth1            Dual, Port 2
eth2            Intel Quad Port Card, Port 1 (Leftmost Port)
eth3            Quad, Port 2
eth4            Quad, Port 3
eth5            Quad, Port 4
eth6            Onboard, Port 1 (Network is connected here)
eth7            Onboard, Port 2
eth8            Onboard, Port 3
eth9            Onboard, Port 4

But after installing RHEL on the 2nd system I have:

Device          Port
eth0            Onboard, Port 1
eth1            Onboard, Port 2
eth2            Onboard, Port 3
eth3            Onboard, Port 4
eth4            Intel Dual Port Card, Port 1 (Rightmost Port)
eth5            Dual, Port 2
eth6            Intel Quad Port Card, Port 1 (Leftmost Port)
eth7            Quad, Port 2
eth8            Quad, Port 3
eth9            Quad, Port 4
share|improve this question

2 Answers 2

up vote 2 down vote accepted

Have a look in /etc/sysconfig/network-scripts/ where you will see the startup scripts for the network interfaces (ifcfg-ethx files).

Make a backup copy of the files on the second server just in case you need to go back to them:

cd /etc/sysconfig/network-scripts
mkdir original
cp ifcfg-* original

and then look at the contents of the files in your favorite editor where you may see lines referring to the MAC address of the adaptors (HWADDR=xx:xx:xx:xx:xx:xx) - you will have to edit these lines so that the right ifcfg files refer to the adaptors you want.

If the lines are not present you will need to add them in the following format (example for a NIC using DHCP):

 # Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
 DEVICE=eth1
 BOOTPROTO=dhcp
 ONBOOT=yes
 HWADDR=00:11:22:33:44:55

You can find all the MAC addresses of your adaptors with the ifconfig command.

You'll probably also find a set of the ifcfg files in /etc/sysconfig/networking/devices so you should back these up and then copy in a set of your new files.

Once done, reboot the server or try service network restart to see what happens.

Edit: You might want to repeat this exercise on the primary server too to 'lock down' the assignments here - and remember that if any of the network hardware is changed so will the MAC addresses and you will need to re-edit the ifcfg files to reflect this.

share|improve this answer
    
Thank you that did exactly what I needed. –  Lukasz Aug 17 '11 at 18:08
    
You're welcome - feel free to give me a tick if you want! –  Linker3000 Aug 17 '11 at 20:28
    
Oooh, look at that, someone's suddenly at 10k :) (Congrats!) –  slhck Aug 24 '11 at 21:55
    
@slhck Wohoo! Thanks. Now I just wait for the inevitable rep recalc! –  Linker3000 Aug 24 '11 at 21:59
    
@Linker Nah, I think you're good! (I vote a lot, even for the same users, so two really shouldn't matter). –  slhck Aug 24 '11 at 22:02

A somewhat more low level way of "Mapping subchannels and network device names" is to configure them in /etc/udev/rules.d/70-persistent-net.rules.

Here and here is documentation for RHEL6. But according to this source it works for RHEL 5 too.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.