克隆虚拟机后解决eth0消失或修改ip地址的问题

1、在命令行中输入:sudo vim vim /etc/udev/rules.d/70-persistent-net.rules

如果不用sudo可以自己切换root用户(比较麻烦),如何设置sudo。

2、将eth0那行删去,下面的eth1改为eth0

3、在命令行中输入:sudo vim /etc/sysconfig/network-scripts/ifcfg-eth0

4、将hwaddr修改为70-persistent-net.rules中的eth1的MAC地址

5、重启网络:sudo service network restart
      如果重启网络无效则重启机器:reboot

猜你喜欢

转载自blog.csdn.net/Betty_betty_betty/article/details/83855400