虚拟机克隆之后网络重启失败
CentOS6:
修改克隆出来的机器
1、vim /etc/udev/rules.d/70-persistent-net.rules(1) 将原NAME="eth0"行内容注释
(2) 将NAME="eth1"行内容中的"eth1"修改成"eth0"
修改完成后内容如下:
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:5e:35:00", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:3a:f2:8e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
2、修改ifcfg-eth0文件中的ip地址和HWADDR值(与70-persistent-net.rules文件中ATTR{address}相同的地址)
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"HWADDR="00:0C:29:3a:f2:8e"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR=192.168.1.133
NETWORK=192.168.1.0
NETMAST=255.255.255.0
TYPE="Ethernet"
UUID="b1b9ac33-19ad-4bb3-ac6c-06d5a3fa7c5b"
3、重启操作系统生效
4、验证
ifconfig
service network restart
参考地址:http://blog.csdn.net/ljunjie82/article/details/41599085
CentOS7:
修改克隆出来的机器:
vim /etc/sysconfig/network-scripts/ifcfg-ens32 修改HWADDR和UUID,当然还有ip地址
uuid获取:用命令 nmcli con show 获取
mac地址获取:从虚拟机的属性里获取
重启
参考地址:http://blog.csdn.net/langsim/article/details/44888437