logo

Openplatform.xyz

Placeholder for our stuff related to Telecom, IT, Internet of things (IOT), ESP8266, Raspberry Pi

Home IOT Telecom IT stuff About Us Contact Us Site Map

CentOS/RHEL: How to Enable the Old ethX Style Network Interface Scheme

Traditionally, network interfaces in Linux are enumerated as eth[0123…], but these names do not necessarily correspond to actual labels on the chassis. Modern server platforms with multiple network adapters can encounter non-deterministic and counter-intuitive naming of these interfaces.

Newer Linux distributions provides methods for consistent and predictable network device naming for network interfaces. These features change the name of network interfaces on a system in order to make locating and differentiating the interfaces easier. More details of the naming convention are available in the RHEL Networking Guide.

Follow these steps to Enable old style eth0, eth1 network interface names ...

1. Edit Grub to add parameter net.ifnames=0

vi /etc/default/grub
add the red linpart:
GRUB_CMDLINE_LINUX=".... rhgb quiet net.
ifnames=0"

example:

[root@localhost ~]# more /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgbquiet net.
ifnames=0"
GRUB_DISABLE_RECOVERY="true"

2. Backup all files like ifcfg-eno1 (or whatever names you have instead of eno1 like enp2s0 etc.)

[root@localhost ~]# mkdir /home/backup
[root@localhost ~]# cp /etc/sysconfig/network-scripts/ifcfg-* /home/backup

3. Note MAC address of each interface (repeat for all interfaces)

cat /sys/class/net/eno1/address
cat /sys/class/net/eno2/address

4. Note output of “/etc/init.d/network status”

For example “/etc/init.d/network status” shows this output:
Configured devices:
lo bond0 eno0 eno1
Currently active devices:
lo eno0 eno1 bond0

5. Change the ifcfg files name (repeat below for every interface)

cd /etc/sysconfig/network-scripts/
ip link set eno1 down
ip link set eno1 name eth1
ip link set eth1 up
mv ifcfg-eno1 ifcfg-eth1

6. Edit all ifcfg files with new interface names, give MAC addresses noted in step-3 in HWADDR field.

 vi /etc/sysconfig/network-scripts/ifcfg-eth1
     TYPE=Ethernet
     NAME=eth1
     DEVICE=eth1
     ONBOOT=yes
    HWADDR=28:92:4A:37:09:8F

7. Restart Network

systemctl restart network

Now old styled network interface names eth[0123..] are back.

All the best !



Suresh

Suresh Hariramani

I am an IOT enthusiast with more than 20 years of experience in the IT sector. Specializing in telecom service's; follow me for some very innovative and best in class IOT products as I unfold my knowledge and passion for the subject.


Vatsal

Vatsal Hariramani

Just me, myself and I, exploring the universe of uknownment. I have a heart of love and interests in technology, IOT and travel . And I want to share my world with you .