1. 修改/etc/default/grub文件
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
改為:
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 rhgb quiet"
2. 修改 /etc/sysconfig/network-scripts/ifcfg-ens33
1. cd /etc/sysconfig/network-scripts/
2. mv ifcfg-ens33 ifcfg-eth0
3. vim ifcfg-eth0
NAME=ens33 --> NAME=eth0
DEVICE=ens33 --> DEVICE=eth0
3. 運(yùn)行命令grub2-mkconfig -o /boot/grub2/grub.cfg 更新環(huán)境參數(shù)
[root@go_dev network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-637210975525494fa2bcd6a1e3330ddb
Found initrd image: /boot/initramfs-0-rescue-637210975525494fa2bcd6a1e3330ddb.img
done
4. 重啟網(wǎng)卡
systemctl restart network
ifconfig 查看
如果重啟網(wǎng)卡失敗 --> 重啟服務(wù)器