After the system is started, ping the Internet or other machines in the LAN. If you select the NAT Internet access mode when configuring the virtual machine, you need to configure a fixed IP address later. For more information, see setting static IP addresses in VMwareNAT mode to obtain available IP ranges and gateways. First back up the ifcfg-eth0 to the home directory, do not put it in the same directory, then vim/etc/sysconfig/network-scripts/ifcfg-eth
After the system is started, ping the Internet or other machines in the LAN.
If you select the NAT Internet access mode when configuring the virtual machine, you need to configure a fixed IP address later. For more information, see setting static IP addresses in the VMware NAT mode to obtain available IP ranges and gateways.
First back up the ifcfg-eth0 to the home directory, do not put it in the same directory, and then
Vim/etc/sysconfig/network-scripts/ifcfg-eth0 IPADDR = 192.168.88.201 # specify the IP address NETMASK = 255.255.255.0 # subnet mask GATEWAY = 192.168.88.2 # default GATEWAY DNS1 = 192.168.88.2 # DNS1 server address, it is generally the same as the gateway
Then back up the/etc/sysconfig/network file and vim to modify the gateway.
Restart network service
service network restart
Related Command ifconfig
ifconfig
Displays information about the currently activated network interfaces.
ifconfig -a
Displays information about all network interfaces, whether activated or not.
Disable and activate NIC interfaces
[Root @ localhost ~] # Ifdown eth0 # Disable the network [root @ localhost ~] # Ifup eth0 # Start the network
Error related to cloned VM
When running service network restart
Device eth0 does not seem to be present,delaying initialization. [FAILED]
Ifconfig does not find eth0 and eth1, but eth1 (hardware address: 00: 0C: 29: 45: 41: 1E) is found in ifconfig-)
View/etc/udev/rules. d/70-persistent-net.rules found that there are two hardware addresses, the eth0 is 00: 0C: 29: 22: 4A: 32 (original), and the eth1 is 00: 0C: 29: 45: 41: 1E
View/etc/sysconfig/network-scripts/ifcfg-eth0 found hardware address is 00: 0C: 29: 22: 4A: 32 (original)
The VM before the copy is eth0 and the hardware address is 00: 0C: 29: 22: 4A: 32.
If you still want to use eth0, you can
rm -rf /etc/udev/rules.d/70-persistent-net.rules
Change the hardware address for/etc/sysconfig/network-scripts/ifcfg-eth0 to 00: 0C: 29: 45: 41: 1E, and change the new IP address
Finally, reboot restarts the machine.