Operating System - Linux
1827858 Members
1743 Online
109969 Solutions
New Discussion

Naming convention for eth# interfaces

 
SOLVED
Go to solution
brian_31
Super Advisor

Naming convention for eth# interfaces

Is there a way to stop the eth# getting re-arranged in RHEL upon reboot and replacing. Any workwounds?

Thanks

Brian
1 REPLY 1
Matti_Kurkela
Honored Contributor
Solution

Re: Naming convention for eth# interfaces

Adjust the HWADDR= lines in each /etc/sysconfig/network-interfaces/ifcfg-eth* file to the way you want the NICs to be.

If you want the NIC with MAC address 11:22:33:44:55:66 to be eth0, then /etc/sysconfig/network-interfaces/ifcfg-eth0 should have this line:

HWADDR=11:22:33:44:55:66

If you need to replace the eth0 NIC, the new NIC will have a different MAC address than the old one. So edit the /etc/sysconfig/network-interfaces/ifcfg-eth0 to match the new situation, and the physical NIC -> eth# name will stay the same: if some hardware change would make it different, the OS will automatically re-arrange the cards to make them stay the way you want them.

If you want to completely disable the re-arrangement system and let the NIC names be assigned in the hardware detection order, then just remove the HWADDR= lines from all ifcfg-eth* files.

NOTE: the HWADDR= line will control the re-arrangement of eth# names; MACADDR= line would be used to assign custom MAC addresses to NICs. Don't confuse the two, and don't use them both on the same NIC.

MK
MK