Operating System - Linux
1825882 Members
2822 Online
109689 Solutions
New Discussion

Re: network configuration

 
dgizaw
Frequent Advisor

network configuration

I am building a number of DL320 G6 servers with the same OS RELH6 and apps. instead of configuring kickstart I took a short cut by taking the built mirrored disk and boot it on another server and mirror it. In that way I built many of them. The only problem I have is there is no nmore eth0 and eth1. On the second server it was eth2 and eth3. On the third server it is eth4 and eth5. It keeps increasing the numbers. Why does the number keep increasing? how can I resolve this problem?
Thank you
Do not undermine a chalnge
2 REPLIES 2
Matti_Kurkela
Honored Contributor

Re: network configuration

When RHEL writes the network configuration, the MAC address of each network interface is stored into HWADDR variable in the respective /etc/sysconfig/network-scripts/ifcfg-eth* file.

On subsequent reboots, if the network interface has a matching HWADDR but a non-matching name, the startup scripts will re-arrange the names to make them match.

If the interface name matches but the MAC address is different, the system assumes it's a completely new network interface and leaves it unconfigured.

The purpose of this is to make the NIC names persistent: once a NIC is configured with a particular name, it gets to keep that name even if other NICs are added or removed.

The flipside is that when a NIC is replaced with another, the old name is kept in reserve in case the old NIC comes back and the new NIC gets a new name. This can be avoided if the sysadmin changes the HWADDR variable in the configuration file to explicitly assign the old configuration to the replaced NIC.

If you're a RHEL sysadmin, you should understand this behavior and act accordingly.

If all the HWADDR= lines are removed from the /etc/sysconfig/network-scripts/ifcfg-eth* files, the system will fall back to the behavior of the old (non-Enterprise) RedHat Linux versions: at reboot, the NIC names are assigned based on currently-detected hardware, in the order the NIC drivers are loaded. If you had done this before the cloning, you would have avoided this problem.

The way to fix this is to remove all but the currently-used ifcfg-eth* files: on the second server, you should remove ifcfg-eth0 and ifcfg-eth1; on the third, remove the files ifcfg-eth[0..3]. Then, rename the remaining files to ifcfg-eth0 and ifcfg-eth1 and make sure their DEVICE= lines also say "eth0" and "eth1". Once you've done all this, reboot. When the system comes back up, your NICs should be named "eth0" and "eth1" again.

NOTE: there is also another optional ifcfg-eth* file parameter named MACADDR=. It is used to assign a custom MAC address to a NIC. Don't confuse MACADDR with HWADDR, and obviously also don't use the two of them together.
(The MACADDR may be useful if you have proprietary software tied to the MAC address of a NIC, and that NIC fails and is replaced by another.)

MK
MK
dgizaw
Frequent Advisor

Re: network configuration

Thank you very much Matty. You made it clear to me.
Do not undermine a chalnge