After the use of the CentOS virtual machine, there is no Internet access, the use of the host ping virtual machine address can ping, and the virtual machine ping the host, while the virtual machine can not ping other URLs or IP, display content for the network is unreachable, Later after the search on the Internet to find a solution using NAT mode, to solve the problem, recorded as follows:
1. Open the Service (SERVICES.MSC) to ensure that VMware's DHCP and NAT services are turned on.
2, modify the virtual machine access mode, can be viewed in the "Edit virtual network", as follows:
Open the following interface as follows:
3, click VMnet8, set the relevant information: the general use of the default configuration, if the figure 1 of the subnet IP self-adjustment, the corresponding 2, 3 also need to make corresponding adjustments:
4, in the virtual machine settings to choose the NAT connection mode, if there is no network connection method need to add their own.
5, open the virtual machine to see the virtual Machine network settings. The command is as follows
#vi/etc/sysconfig/network-scripts/ifcfg-eth0
Some of the contents are as follows:
Device=eth0 #设备名称, can be found according to Ifcofnig command.
Bootproto=dhcp #连接方式, DHCP automatically assigns addresses without having to set up IP and gateways below
hwaddr=00:0c:29:ad:66:9f #硬件地址, can be found according to Ifcofnig command.
Onboot=yes #yes表示启动就执行该配置, you need to change Yes
Online there will be some ways to add IP addresses, subnet masks, DNS, and so on, before the installation of these methods have been tested, and the addition of the content has also affected the Internet, so it is not recommended to use those ways to add the content.
You can use the Ifconfig command to obtain relevant information.
After modifying, you need to restart the network settings, you can
# Service Network Restart
Or
#/etc/init.d/network Restart
After the reboot is complete, ping the physical machine or the corresponding website, can successfully ping the pass.
VMware Network Setup after installing CentOS