vim /etc/sysconfig/network-scripts/ifcfg-ethxxx
DEVICE=eth0
HWADDR=00:0C:29:EB:72:FA
TYPE=Ethernet
UUID=af9a3043-12d7-4dd3-9948-9d8de30d8d32
ONBOOT=yes (whether to start after boot,yes)
NM_CONTROLLED=yes
BOOTPROTO=static(Is the ip address dynamically obtained or static, static?)
IPADDR=192.168.5.104(ip address, this ip address must not be set to be the same as the gateway IP)
NETMASK=255.255.255.0(Subnet mask)
GATEWAY=192.168.5.2 (default gateway)
service network restart
ip addr
ping baidu.com
Delete the file bound to the Linux physical address (the file will bind the physical address to the IP after the operating system restarts and generate the physical address). If it is not deleted, the operating system will always be bound to the cloned physical address;
rm -rf /etc/udev/rules.d/70-persistent-net.rules
If it still doesn't work, check whether the mac address is the same as the mac of the cloned machine. If it is the same, change it.
Recommended Posts