20.6 C
Texas
Melhttp://www.osradar.com
Guru Unix /Linux and GNU supporter

Enable the Old ethX Style Network Interfaces Names on Centos7/8

Because of some reasons u need to back to old eth naming of your network devices . How to do it in easy way. . let me tell you about my invironement.

My system is CentOS 8

My network device enp0s3

1-Disable Consistent Network Device Naming

How to disable Consistent Network Device Naming in Centos 7 of 8 ?

- Advertisement -

Edit etc/default/grub and ppend both the net.ifnames=0 and biosdevname=0 parameter values to the file’s GRUB_CMDLINE_LINUX parameter:

vi /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="resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

2-Rebuild the /boot/grub2/grub.cfg

You can do is with running grub2-mkconfig

[[email protected] rules.d]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
done

If your system booting with UEFI

#grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

3-mv Old device to new device config

mv /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-eth0

Edit the network config file

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Change d

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=”07922c3e-bd5c-414e-99b8-697e137f36a4″
DEVICE=”eth0″
ONBOOT=”yes”
~

4-Reboot the Server

#reboot

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article