第一步修改网卡名称
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# mv ifcfg-ens33 ifcfg-eth0
第2步
vi ifcfg-eth0 改掉这2个名称
第三步 注意CentOS7中网卡驱动读取的配置文件是/usr/lib/udev/rules.d/60-net.rules
;CentOS6中则为/etc/udev/rules.d/70-persistent-net.rules
vi /usr/lib/udev/rules.d/60-net.rules
添加
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="1", ATTR{address}=="00:0c:29:ab:d9:72", NAME="eth0"
注ATTR{address}=="00:0c:29:ab:d9:72", 网卡mac NAME="eth0" 实际改后的名字
重启网卡
[root@byte-edu-lab2 ~]# modprobe -r e1000 ;modprobe e1000;systemctl restart network