1. 程式人生 > >解決Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.

解決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”

2) ifconfig –a 確認當前網絡卡和mac地址

[[email protected] ~]$ 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-eth1

[[email protected] ~]$ mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1

[[email protected] ~]$ vim /etc/sysconfig/network-scripts/ifcfg-eth0

[[email protected]
~]$ 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

4) 修改[[email protected] ~]$ vim /etc/udev/rules.d/70-persistent-net.rules

註釋掉(刪除)eth0的記錄,開啟eth1的記錄

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

[[email protected] ~]$ 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"

5) 重啟網路服務

會讀取剛才修改過的配置檔案,如果配置檔案不生效的話,使用source命令使得配置檔案生效即可。

service network restart