最近参与群里的企业级linux综合实验项目的时候,需要大量的虚拟机来搭建实验环境,便使用了一台闲置的8G内存的hp145,安装了esxi4来部署虚拟机,为了方便,安装好一个RHEL6,制作成了OVF模板,添加了两块网卡。结果利用该OVF模板建立新的虚拟机后,网卡无法使用,ifconfig 只有lo的信息,没有添加的两个网卡的ip信息。经过一番查看,终于找到了原因,及相关的解决办法,记录如下:
具体错误信息,
/etc/init.d/network 后会出现
device eth0 does not seem to be present, delaying intitialization
device eth1 does not seem to be present, delaying intitialization
dmesg | grep eth
发现了如下内容
renamed network interface eth0 to eth2
renamed network interface eth1 to eth3
ls /etc/sysconfig/network-scripts/
发现只有
ifcfg-eth0 ifcfg-eth1 的配置文件
而且检查了eth0的配置文件 如下
并没有任何异常
最后google了一番,出现该问题的时候涉及一个文件
/etc/udev/rules.d/70-persistent-net.rules
看了这个文件以后,发现了问题的所在。也就想到了解决办法。
只要删掉# PCI device 0×8086:0x100f (e1000) 这四段内容,然后重启即可。
转载于:https://blog.51cto.com/devops/666999