有时我们通过VMware克隆出来一台linux的虚拟机,由于网卡信息不一致,导致不能上网,这是因为在linux中有唯一标识网卡的UUID,我们是通过克隆过来的,那么他们的UUID、MAC地址和IP地址都相同了,所以导致克隆出来的机子没有办法上网。这时候我们就需要将克隆出来的虚拟机的网卡信息清除掉。
一、进入网卡配置文件目录
cd /etc/sysconfig/network-scripts
二、修改配置网卡的文件
vi ifcfg-eth0
删除或注释HWADDR和UUID两行内容
HWADDR=00:0c:29:58:2:9d
UUID=dec30dbd-6b10-d42d-5d0f-569b6e79b9a0
三、清空或删除“/etc/udev/rules.d/70-persistent-net.rules”文件
删除命令: rm –f /etc/udev/rules.d/70-persistent-net.rules 清空命令: > /etc/udev/rules.d/70-persistent-net.rules
四、重启机器
reboot
重启后你就会发现 他可以上网啦。哎呀!好神奇~~