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

一、问题描述

原因可能是因为克隆虚拟机造成的。在使用vmworkstation打开虚拟机的时候,要选择克隆而非复制。

二、解决描述

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

三、具体操作

  1. 确认vmx配置文件的mac地址

ethernet0.generatedAddress = “00:0c:29:f3:fe:4b”

  1. ifconfig –a 确认当前网卡和mac地址

[root@admin ~]$ 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
  1. 重命名/etc/sysconfig/network-scripts/ifcfg-eth0为ifcfg-eth1

[root@admin ~]$ mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1

[root@admin ~]$ vim /etc/sysconfig/network-scripts/ifcfg-eth0

[root@admin ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth1 
DEVICE=eth1
HWADDR=00:0c:29:80:bf:45
TYPE=Ethernet
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.1.13
NETMASK=255.255.255.0
ONBOOT=true
GATEWAY=192.168.1.1

  1. 修改[root@admin ~]$ vim /etc/udev/rules.d/70-persistent-net.rules

注释掉(删除)eth0的记录,打开eth1的记录

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

[root@admin ~]$ cat /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)

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:80:bf:45", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
  1. 重启网络服务

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

service network restart
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值