1. Modify the network card configuration file
Enter the network card configuration file directory:
cd /etc/sysconfig/network-scripts/
Modify the name of the network card configuration file, it is recommended to back it up first
cp ifcfg-ens33 ifcfg-ens33.bak
nv ifcfg-ens33 ifcfg-eth0
Edit the ifcfg-ens33 file
vim ifcfg-ens33
Modify the NAME field and the DEVICE field
NAME=ens33
change toNAME=eth0
DEVICE=ens33
change toDEVICE=eth0
The operation of the network card ens34 is the same as above.
2. Modify the bootloader grub and reload
Add the following information to the GRUB_CMDLINE_LINUX item:
net.ifnames=0 biosdevname=0 net.ifnames=1 biosdevname=1 net.ifnames=2 biosdevname=2
After the addition is completed, it is as follows:
GRUB_TERMINAL_OUTPUT="console"GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet"
Reload:
grub2-mkconfig -o /boot/grub2/grub.cfg
3. Restart the system
reboot
After restarting, execute the ip addr
command to find that the network card names have been changed to eth0 and eth1