1、编辑/etc/default/grub配置文件
GRUB_CMDLINE_LINUX='net.ifnames=0 biosdevname=0'
sed -i.bak '/GRUB_CMDLINE_LINUX=/s#''$# net.ifnames=0"#' /etc/default/grub
2、为grub2生成其配置文件
grub2-mkconfig -o /etc/grub2.cfg
3、重启系统
reboot
[root@y_zilong ~]# cat /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="net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"
[root@y_zilong ~]# grub2-mkconfig -o /etc/grub2.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-5a52678c10f54caab52cd7dec1183eb5
Found initrd image: /boot/initramfs-0-rescue-5a52678c10f54caab52cd7dec1183eb5.img
done
[root@y_zilong ~]# reboot