Change default network name (ens33) to “eth0” in Centos7/RHEL7

Windows Articles

How to install Oracle Java 15 on Ubuntu 20.04 / 18.04?

Hello, friends. We know that Java is one of the most popular programming languages and now it's version 15. So in this...

How to run the Linux Tail command in Windows 10.

Hi! The title of this post may seem incongruous, but it's not. In fact, for some time Microsoft has approached positions with...

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...

How to get Google Opinion Rewards in any Country

Greetings! Google Opinion Rewards is a cool app, which will allow you to earn credit, to spend it on the Google Play...

How to change the hostname on Ubuntu?

This simple tutorial will teach you how to change the hostname on Ubuntu. The steps we will tell you here will work...
Avatar
Mel Khamlichi
Webmaster and technical Director at Osradar.com Linux/Unix Guru Technology and hardware addicted Location : Amsterdam Netherlands

RHEL 7 came with new feature called “consistent network device naming“.This feature change the name of network interfaces on a system in order to make locating and differentiating the interfaces easier.

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. This affects both network adapters embedded on the motherboard (Lan-on-Motherboard, or LOM) and add-in (single and multiport) adapters.
Let show you how to  Change default network name (ens33) to “eth0” in Centos7 or RHEL7

The below procedure disables “consistent network device naming” and renames interfaces.

The default config is like this :

and  Should be changed to: add the string bellow the the config

net.ifnames=0 biosdevname=0

 

test the new configuration to see if no mistake has been made:

Run first : grub2-mkconfig to see if no mistake has been made

[root@osradar-com ~]# grub2-mkconfig

Then

[root@osradar-com ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-5a816247fa35410a9ee4234442a188c0
Found initrd image: /boot/initramfs-0-rescue-5a816247fa35410a9ee4234442a188c0.img
done

Copy the old  configuraton

cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-eth0

edit /etc/sysconfig/network-scripts/ifcfg-eth0  to

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="eth0"
UUID="84cad80a-0c42-4540-90c6-9209735e8ea8"
DEVICE="eth0"
ONBOOT="yes"

save  and  exit

Reboot the machine

shutdown -r now

Ping form Another  machione

#:\>ping 192.168.65.132

Pinging 192.168.65.132 with 32 bytes of data:
Reply from 192.168.65.132: bytes=32 time=1ms TTL=64
Reply from 192.168.65.132: bytes=32 time=4ms TTL=64
Reply from 192.168.65.132: bytes=32 time=4ms TTL=64
Ping statistics for 192.168.65.132:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 4ms, Average = 3ms

Enjoy

More articles

3 COMMENTS

  1. In the RHEL official page says: “Do not disable consistent network device naming because it allows the system using ethX style names, where X is a unique number corresponding to a specific interface and may have different names of network interfaces during the boot process.”

    Are you sure about your tutorial? Please your help.
    Thanks in advance.
    Regards
    Jose Cruz

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install Oracle Java 15 on Ubuntu 20.04 / 18.04?

Hello, friends. We know that Java is one of the most popular programming languages and now it's version 15. So in this...

How to run the Linux Tail command in Windows 10.

Hi! The title of this post may seem incongruous, but it's not. In fact, for some time Microsoft has approached positions with...

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...

How to get Google Opinion Rewards in any Country

Greetings! Google Opinion Rewards is a cool app, which will allow you to earn credit, to spend it on the Google Play...

How to change the hostname on Ubuntu?

This simple tutorial will teach you how to change the hostname on Ubuntu. The steps we will tell you here will work...
x