当前位置:TranBon博客 > 首页 > 技术 > centos固定网卡、网卡名会变、网卡名错乱,解决方法

centos固定网卡、网卡名会变、网卡名错乱,解决方法

adminis6年前 (2018-06-13)技术34480
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 重启看看

第8条随机版权

扫描二维码推送至手机访问。

版权声明:本文由TranBon博客发布,如需转载请注明出处。

本文链接:https://bk.tranbon.com/?id=137

相关文章

vi编辑器教程

http://blog.sina.com.cn/s/blog_736f1c59010136ry.htmlhttp://blog.csdn.net/lanxinju/article/details/57...

centos7破密时提示Authentication token manipulation error

centos7破密时提示Authentication token manipulation error

需要在passwd 前输入 chattr -i /etc/passwd chattr -i /etc/shadow如下:...

cnetos系统mysql配置my.cnf文件,跳过密码认证登录并设置远程登录(不一定有效)

cnetos系统mysql配置my.cnf文件,跳过密码认证登录并设置远程登录(不一定有效)

cnetos手动安装mysql没有my.cnf配置文件时, 1.可以从其它服务器把my.cnf文件拷贝到需要的服务器上,2.可以touch创建my.cnf文件 这边是直接使用touch命令my.c...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。