centos固定网卡、网卡名会变、网卡名错乱,解决方法
cd /etc/udev/rules.d/
vi /etc/udev/rules.d/70-persistent-net.rules
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$(ifconfig eth0|grep ether|awk '{print $2}')\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth0\"" >/etc/udev/rules.d/70-persistent-net.rules
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$(ifconfig eth1|grep ether|awk '{print $2}')\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth1\"" >>/etc/udev/rules.d/70-persistent-net.rules
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$(ifconfig eth2|grep ether|awk '{print $2}')\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth2\"" >>/etc/udev/rules.d/70-persistent-net.rules
echo "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\",ATTR{address}==\"$(ifconfig eth3|grep ether|awk '{print $2}')\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth3\"" >>/etc/udev/rules.d/70-persistent-net.rules
vi /etc/default/grub
添加 net.ifnames=0 biosdevname=0
后
:%s/eno1/eth1/g
输入 grub2-mkconfig -o /boot/grub2/grub.cfg
更新内核
reboot
重启看看