1. vim /etc/sysconfig/grub 编辑/etc/sysconfig/grub文件
添加 net.ifnames=0 biosname=0
GRUB_TIMEOUT=
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 rhgb quiet net.ifnames=0 biosname=0" #添加
GRUB_DISABLE_RECOVERY="true"
2. grub2-mkconfig -o /boot/grub2/grub.cfg 生成新的grub.cfg文件
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.-957.21..el7.x86_64
Found initrd image: /boot/initramfs-3.10.-957.21..el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.-957.21..el7.x86_64
Found initrd image: /boot/initramfs-3.10.-957.21..el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.-862.14..el7.x86_64
Found initrd image: /boot/initramfs-3.10.-862.14..el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.-862.6..el7.x86_64
Found initrd image: /boot/initramfs-3.10.-862.6..el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.-862.2..el7.x86_64
Found initrd image: /boot/initramfs-3.10.-862.2..el7.x86_64.img
Found linux image: /boot/vmlinuz--rescue-6a40cff497a2412d91bb000f9652139a
Found initrd image: /boot/initramfs--rescue-6a40cff497a2412d91bb000f9652139a.img
done
3.mv ifcfg-enp3s0 ifcfg-eth0 执行命令 并修改 ifcfg-eth0中DEVICE = enp3s0 为 DEVICE = eth0
4.shutdown -r 0 重启服务验证网卡名称是否为eth0