CentOS6修改网卡名称
2022-01-18 本文已影响0人
编程永无止境
问题说明
由于对网卡进行了更新,导致centos6没有eth0只有eth1,现在想要修改一下网卡的名称,把eth1修改为eth0。
修改步骤
-
修改/etc/udev/rules.d/70-persistent-net/rules文件
image.png

把第二行eth1的修改为eth0 , 第一行eth0改为 eth1

改完以后如下图

2.修改/etc/sysconfig/network-scripts/ifcfg-eth0
修改文件/etc/sysconfig/network-scripts/ifcfg-eth0 中HWADDR的值为ATTR(address)=XXXXXXXX的内容XXXXXX
vim /etc/sysconfig/network-scripts/ifcfg-eth0

重新启动系统
reboot
重启以后再次查看,发现已经好了

启动网卡
ifconfig eth0 up
service network restart #重启网络服务