VM克隆CentOS后设置IP

Removethekernel’snetworkinginterfacerulesfilesothatitcanberegenerated

#rm-f/etc/udev/rules.d/70-persistent-net.rules

RestarttheVM

#reboot

UPDATEyourinterfaceconfigurationfile

#vi/etc/sysconfig/network-scripts/ifcfg-eth0

RemovetheMACADDRentryorupdateittothenewMACADDRfortheinterface(listedinthisfile:/etc/udev/rules.d/70-persistent-net.rules).

RemovetheUUIDentry

Saveandexitthefile

Restartthenetworkingservice

#servicenetworkrestart

Modifyhostname

#vi/etc/sysconfig/network

#vi/etc/hosts

changethevalueof"localhost.localdomain"