1.3 C
Amsterdam
Saturday, December 5, 2020

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

Must read

How To Install Docker Swarm On Ubuntu 20.04

In this tutorial, you'll learn that how to Install Docker Swarm on Ubuntu 20.04. Docker Swarm is most popular tool that can be used...

How To Install Keeweb Password Manager On Ubuntu 20.04

Today we are going to learn that how to install KeeWeb Passwrod Manager On Ubuntu 20.04. KeeWeb Password Manager provides the best and easy...

How to change the MAC address in Windows 10

Hello! How are you? Today we will see how to change the MAC address on a computer with Windows 10. In fact, it is...

How To Configure Slave BIND DNS Server On Ubuntu 20.04

In our previous guide we covered the setup of Master(Primary) DNS Server. Here we'll learn that how to configure slave bind dns server on...
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 Docker Swarm On Ubuntu 20.04

In this tutorial, you'll learn that how to Install Docker Swarm on Ubuntu 20.04. Docker Swarm is most popular tool that can be used...

How To Install Keeweb Password Manager On Ubuntu 20.04

Today we are going to learn that how to install KeeWeb Passwrod Manager On Ubuntu 20.04. KeeWeb Password Manager provides the best and easy...

How to change the MAC address in Windows 10

Hello! How are you? Today we will see how to change the MAC address on a computer with Windows 10. In fact, it is...

How To Configure Slave BIND DNS Server On Ubuntu 20.04

In our previous guide we covered the setup of Master(Primary) DNS Server. Here we'll learn that how to configure slave bind dns server on...

Install Fossil on Linux – An alternative to Git

Hello, friends. In this post, we will talk about a serious alternative to Git. In a few words, we'll show you how to install...
x