克隆虚拟机后发现网卡名称与配置对不上,原网卡名eth0,ip:192.168.1.122,克隆后网卡名eth1,ip:192.168.1.127

解决如下,

[root@ns1 ~]#sed -i '/eth0/d' /etc/udev/rules.d/70-persistent-net.rules 
[root@ns1 ~]#sed -i 's/eth1/eth0/' /etc/udev/rules.d/70-persistent-net.rules 
[root@ns1 ~]#sed -i '/^HWADDR/d' /etc/sysconfig/network-scripts/ifcfg-eth0 
[root@ns1 ~]#sed -i '/^UUID/d' /etc/sysconfig/network-scripts/ifcfg-eth0
[root@ns1 ~]#sed -i 's/192.168.1.122/192.168.1.127/' /etc/sysconfig/network-scripts/ifcfg-eth0
[root@ns1 ~]#service network restart
[root@ns1 ~]#reboot