红联Linux门户
Linux帮助

虚拟机克隆之后网络重启失败

发布时间:2017-05-28 09:43:53来源:linux网站作者:fanren224
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文件中的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://www.linuxdiyf.com/linux/31122.html