1.编辑grub配置文件
代码语言:javascript
复制[root@localhost ~]$ vim /etc/sysconfig/grub
#在GRUB_CMDLINE_LINUX=行的末尾追加“net.ifnames=0 biosdevname=0”
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="ipv6.disable=1 crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet net.ifnames=0 biosdevname=0 "
GRUB_DISABLE_RECOVERY="true"
2.重新加载grub配置文件
代码语言:javascript
复制[root@localhost ~]$ grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-957.21.3.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-957.21.3.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-693.21.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.21.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-cf604a26bf094f2f94977a8a38132acd
Found initrd image: /boot/initramfs-0-rescue-cf604a26bf094f2f94977a8a38132acd.img
done
3.重启操作系统后查看网卡名称即可
代码语言:javascript
复制[root@localhost ~]$ reboot