修改/etc/default/grub文件,加入以下配置:
6 GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/root crashkernel=auto net.ifnames=0 biosdevname=0 rd.lvm.lv=rhel/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=us rhgb quiet"
执行以下命令,使配置生效:
[root@linuxidc ~]# grub2-mkconfig /boot/grub2/grub.cfg
重启系统可以看到网卡的名称已变回跟RHEL6一样:
[root@linuxidc Desktop]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
[root@linuxidc Desktop]# nmcli connection
NAME UUID TYPE DEVICE
eth1 f39a4246-6a46-45f7-b9ac-b29890a9814e 802-3-ethernet eth1
eth0 ff48aa6b-d1b2-4df8-adeb-dc469d1e0716 802-3-ethernet eth0