且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

centos网卡错误Device eth0 does not seem to be present

更新时间:2022-03-19 23:24:20

在使用vmware及VirtualBox迁移linux系统过程中,发现部署后的linux系统无法启动网卡

报错为

Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization

centos网卡错误Device eth0 does not seem to be present

错误原因,是因为linux网卡绑定了原mac地址导致

 

解决方法为

1.使用ifcnfig -a 查看当前主机mac地址

centos网卡错误Device eth0 does not seem to be present

2.修改eth0网卡硬件地址为当前地址

vi /etc/sysconfig/network-scripts/ifcfg-eth0

centos网卡错误Device eth0 does not seem to be present

保存退出

其实在network-scripts下查看是没有eth1网卡的

 centos网卡错误Device eth0 does not seem to be present

3.删除70-persistent-net.rules文件

rm -rf /etc/udev/rules.d/70-persistent-net.rules

4.重启系统

reboot -h now

一切OK

 

实践发现:其实可以在eth文件里不设置mac地址,直接删除70-persistent-net.rules文件重启就可以了。


DEVICE="eth2"
TYPE="Ethernet"
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO="dhcp"
#HWADDR="08:00:27:2f:c7:ff"