当前位置: 移动技术网 > 科技>操作系统>Linux > 虚拟机复制的linux无法联网,解决Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.

虚拟机复制的linux无法联网,解决Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.

2019年08月06日  | 移动技术网科技  | 我要评论

原文地址:

一、问题描述

os:centos

原因是拷贝虚拟机造成的。

使用vmworkstation打开虚拟机的时候,要选择copy而非move。

二、解决描述

网络上解决步骤各异,其实就一句话。只要保证vmwrare virtual machine.vmx配置文件ifconfig –a/etc/sysconfig/network-scripts/ifcfg-eth0/etc/udev/rules.d/70-persistent-net.rules所使用的网卡设备和mac地址一致即可

三、具体操作

1) 确认vmx配置文件的mac地址,vmx文件在linux安装所在的目录,ethernet0和eth0是以太网的意思

ethernet0.generatedaddress = "00:0c:29:f3:fe:4b"

 

2) ifconfig –a 确认当前网卡和mac地址

[root@grace desktop]# ifconfig -a

eth1 link encap:ethernet hwaddr 00:0c:29:f3:fe:4b

broadcast multicast mtu:1500 metric:1

rx packets:0 errors:0 dropped:0 overruns:0 frame:0

tx packets:0 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

rx bytes:0 (0.0 b) tx bytes:0 (0.0 b)

interrupt:19 base address:0x2024

lo link encap:local loopback

………………………………

 

3) 重命名/etc/sysconfig/network-scripts/ifcfg-eth0为ifcfg-eth0

[root@grace desktop]# cd /etc/sysconfig/network-scripts

[root@grace network-scripts]# mv ifcfg-eth0 ifcfg-eth1

vim /etc/sysconfig/network-scripts/ifcfg-eth1

device="eth1"

bootproto="dhcp"

hwaddr="00:0c:29:f3:fe:4b"

…………

 

4) 修改vim /etc/udev/rules.d/70-persistent-net.rules

注释掉eth0的记录,打开eth1的记录

vim /etc/udev/rules.d/70-persistent-net.rules

# pci device 0x1022:0x2000 (vmxnet) (custom name provided by external tool)

#subsystem=="net", action=="add", drivers=="?*", attr{address}=="00:0c:29:f3:fe:4b", attr{type}=="1", kernel=="eth*", name="eth0"

# pci device 0x1022:0x2000 (vmxnet)

subsystem=="net", action=="add", drivers=="?*", attr{address}=="00:0c:29:f3:fe:4b", attr{type}=="1", kernel=="eth*", name="eth1"

 

5) 重启网络服务

会读取刚才修改过的配置文件,如果配置文件不生效的话,使用source命令使得配置文件生效即可。

service network restart

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网