安装系统后默认的网卡名称为 enpXX ,修改为熟悉的eth0
1 vi /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"
追加 net.ifnames=0 biosdevname=0
2 mv /etc/sysconfig/network-scripts/ifcfg-enpXX /etc/sysconfig/network-scripts/ifcfg-eth0
及文件里面的 name 、device属性的名称为eth0
3 grub2-mkconfig -o /boot/grub2/grub.cfg
4 reboot
5 ip a 查看