21
2019
01
13:27:55

Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization.克隆或复制VMw

在VMware里克隆出来的CentOS Linux。。

ifconfig...没有看到eth0.。然后重启网卡又报下面错误。

故障现象:

service network restart
Shutting down loopback insterface:                                                                                                     [  OK  ]
Bringing up loopback insterface:                                                                                                          [  OK  ]
Bringing up interface eth0:  Device eth0 does not seem to be present,delaying initialization.                    [FAILED]

Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization.克隆或复制VMw

解决办法:

首先,打开/etc/udev/rules.d/70-persistent-net.rules内容如下面例子所示:

# vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8f:89:9
7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:bd:1
7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

记录下,eth1网卡的mac地址00:0c:29:50:bd:17

接下来,打开/etc/sysconfig/network-scripts/ifcfg-eth0

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

将 DEVICE="eth0"  改成  DEVICE="eth1"  ,
将 HWADDR="00:0c:29:8f:89:97" 改成上面的mac地址  HWADDR="00:0c:29:50:bd:17"

最后,重启网络

# service network restart
或者

# /etc/init.d/network restart

正常了。

 


其实我不喜欢这个解决方法,改个网卡名,没找到解决还原问题所在。

第一、删除70-persistent-net.rules文件

rm -f /etc/udev/rules.d/70-persistent-net.rule

这里我们无法用SFTP工具了,只能借助命令操作。

第二、编辑ifcfg-eth0文件

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

Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization.克隆或复制VMw

我们将eth0改成eth1,然后保存退出。

第三、重启network

service network restart



虚拟机Vmware上克隆了一个Red Hat Enterprise Linx启动时发现找不到网卡,如下所示,如果你在命令窗口启动网络服务就会遇到”Device eth0 does not seem to be present, delaying initialization“错误

Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization.克隆或复制VMw

关于这个错误,搜索了一下网上的资料,发现还蛮多人遇到过这类错误,了解了一下错误产生的原因和解决方案

 

错误原因:

   

    克隆的Linux系统在新的机器上运行,新服务器网卡物理地址已经改变。而/etc/udev/rules.d/70-persistent-net.rules这个文件确定了网卡和MAC地址的信息之间的绑定,克隆后的网卡的MAC已经发生了变化,所以导致系统认为网络设备不存在,网络不能正常启动。另外一个就是/etc/sysconfig/network-scripts/ifcfg-eth0里面MAC地址也是以前的旧信息。

   关于/etc/udev/rules.d/70-persistent-net.rules这个文件,系统在启动时会自动监测变化,然后由/lib/udev/write_net_rules写入到/etc/udev/rules.d/70-persistent-net.rules中一个新的配置节,网卡的的序号依次递增(如原来为eth0,则修改第一后生成一个eth1,再次修改后生成一个eth2...),且其ATTR{address}的值为当前网卡对应的mac地址。

 

解决方法:

 

1:编辑/etc/sysconfig/network-scripts/ifcfg-eth0配置文件,将ifcfg-eth0的配置文件里里面以前的关于MAC地址这一行删除掉或修改。另外克隆的服务器的IP设置的是静态IP,要么修改为一个其它的IP地址或设置为动态IP,重启网卡服务

 

2:找到/etc/udev/rules.d/70-persistent-net.rules 删除后重启机器,系统会自动生成一个70-persistent-net.rules文件。

因为这个文件绑定了网卡和MAC地址,换了网卡以后MAC地址变了,所以不能正常启动,也可以直接编辑这个配置文件把里面的网卡和MAC地址修改成对应的,不过这样多麻烦,直接删除重启,它会自动生成个一个新的文件。

 

删除前70-persistent-net.rules的内容

Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization.克隆或复制VMw

重新生成的70-persistent-net.rules的内容

Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization.克隆或复制VMw

 

重启过后OK,但是我想将测试服务器设置为动态IP,于是在/etc/sysconfig/network-scripts/ifcfg-eth0配置文件里面修改了一番,但是老是获取不到IP地址,将地址改为静态IP地址又没有问题,折腾了好久,最后悲催的发现需要运行dhclient命令才能获取动态IP地址。




推荐本站淘宝优惠价购买喜欢的宝贝:

Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization.克隆或复制VMw

本文链接:https://hqyman.cn/post/103.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:
打赏





休息一下~~


« 上一篇 下一篇 »

发表评论:

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

请先 登录 再评论,若不是会员请先 注册

您的IP地址是: