VirtualBox加载存在CentOS虚拟机网卡无法加载最可能的原因是:
你的虚拟网卡的Mac地址被更改了,系统保留了eth0,为新mac地址的生成eth1或其他名字的网卡配置.启动报告错误为:
Bringing up interface eth0: Device eth0 does not seem to be
present, delaying initialization. 解决办法是:
步骤I.
修改/etc/udev/rules.d/70-persistent-net.rules 文件
- # PCI device 0x8086:0x100e (e1000) (custom name provided by external tool)
- #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",ATTR{address}=="08:00:27:0e:c0:8d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
-
- # PCI device 0x8086:0x100e (e1000)
- #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",ATTR{address}=="08:00:27:21:5e:05", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
-
- # PCI device 0x8086:0x100e (e1000)
- SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:90:53:88", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
- ~
# PCI device 0x8086:0x100e (e1000) (custom name provided by external tool)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",ATTR{address}=="08:00:27:0e:c0:8d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",ATTR{address}=="08:00:27:21:5e:05", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:90:53:88", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
~
如上面的示例,将eth0行注释,将最后一项的NAME="eth2"修改为NAME="eth0",存盘退出。
步骤II.
修改/etc/sysconfig/network-scripts/ifcfg-eth0
将行HWADDR=08:00:27:0e:c0:8d修改为HWADDR=08:00:27:90:53:88
否则会重启网卡会提示:
Bringing up interface eth0: Device eth0 has
different MAC address than expected. 存盘退出,重新启动网卡:service network
restart就OK了
方法II
前提:克隆时选择Reinitialize the MAC address of all network cards
启动后:
1. 删除
/etc/udev/rules.d/70-persistent-net.rules
2. 删除
/etc/sysconfig/network-scripts/ifcfg-eth0 (最好重改名)
3.
重新启动服务器,然后重建ifcfg-eth0(使用新的mac address)