Centos7更改网卡名称Eth0,centos7网卡eth01、先编辑网卡的配置
Centos7更改网卡名称Eth0,centos7网卡eth01、先编辑网卡的配置
安装完Centos7系统,网卡命名跟之前发生了变化,例如:eno16777736
就是看着不爽,也不会影响使用,只是个网卡名称而已。
1、先编辑网卡的配置文件将里面的NAME和DEVICE项修改为eth0
[plain]view plaincopy
print?
vim/etc/sysconfig/network-scripts/ifcfg-eno16777736
2、重命名该配置文件。
[plain]view plaincopy
print?
[root@localhostyum.repos.d]#cd/etc/sysconfig/network-scripts/
[root@localhostnetwork-scripts]#mvifcfg-eno16777736ifcfg-eth0
3、禁用该可预测命名规则。
对于这一点,你可以在启动时传递“net.ifnames=0 biosdevname=0 ”的内核参数。这是通过编辑/etc/default/grub并加入“net.ifnames=0 biosdevname=0 ”到GRUBCMDLINELINUX变量来实现的。
[plain]view plaincopy
print?
[root@localhostnetwork-scripts]#vim/etc/default/grub
4、运行命令grub2-mkconfig -o /boot/grub2/grub.cfg来重新生成GRUB配置并更新内核参数。
[plain]view plaincopy
print?
[root@localhostnetwork-scripts]#grub2-mkconfig-o/boot/grub2/grub.cfg
5、重新启动机器,启动完之后网卡名称就变成了Eth0
[plain]view plaincopy
print?
[root@localhostnetwork-scripts]#init6
6、重启完之后,验证!
评论暂时关闭