VM中的linux虚拟机重启后网卡起不来
[root@localhost ~]# service network restart
Shutting down loopback insterface: [ OK ]
Bringing up loopback insterface: [ OK ]
Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization. [FAILED]
[root@localhost ~]# cat /etc/udev/rules.d/70-persistent-net.rules
[root@localhost ~]# ll /etc/sysconfig/network-scripts
发现70-persistent-net.rules网卡名字是eth1,mac地址是00:0c:29:c9:61:ec
而网卡的配置文件只有ifcfg-eth0的,
解决办法:
把网卡配置文件ifcfg-eth0改为ifcfg-eth1,mv ifcfg-eth0 ifcfg-eth1
把ifcfg-eth1中的网卡名eth0替换为eth1,mac地址替换为00:0c:29:c9:61:ec
重启网络服务service network restart
另外虚拟克隆后需要删除克隆后网卡配置文件中的UUID和文件/etc/udev/rules.d/70-persistent-net.rules