reproduced in: https://www.linuxidc.com/Linux/2016-09/135521p2.htm
NAT (address translation mode)
We just said that if your network IP resources are scarce, but you want your virtual machines to be networked, Nat mode is the best choice. Nat mode enables virtual machines to be networked with virtual NAT devices and virtual DHCP servers. Its network structure is as follows:
In NAT mode, the host network card is connected directly to the virtual NAT device, and then the virtual NAT device is connected to the virtual Switch VMnet8 with the virtual DHCP server, thus enabling virtual machine networking. Then we will find it very strange, why do we need virtual network card vmware network Adapter VMnet8? Our VMware network Adapter VMNET8 virtual network card is primarily designed to enable communication between the host and the virtual machine. We can verify this later in the setup steps.
First, set the options for NAT mode in the virtual machine, open VMware, and click on "Edit" under "Virtual Network Editor" to set NAT parameters and DHCP parameters.
Change the network connection mode of the virtual machine to NAT mode and click "Edit Virtual machine settings".
Click on "Network adapter" and select "Nat Mode"
Then boot the system, edit the NIC configuration file, command for Vi/etc/sysconfig/network-scripts/ifcfg-eth0
The specific configuration is as follows:
Edit complete, save exit, then restart the virtual Machine network card, dynamically obtain the IP address, ping the external IP with the ping command, test whether the network.
Before we talked about the role of the VMware network Adapter VMnet8 virtual network card, let's test it now.
So it seems that the virtual function of the extranet, really not through the VMware Network Adapter VMnet8 virtual network card, then why should have this virtual network card?
We said before that the role of the VMware Network Adapter VMnet8 is the communication between the host and the virtual machine, and then we use the Remote Connection tool to test it.
Then, when you enable VMware Network Adapter VMnet8, you discover that the remote tools can connect to the virtual machine.
So, this is NAT mode, which uses virtual NAT devices and virtual DHCP servers to connect the virtual machines to the extranet, while the VMware network Adapter VMnet8 Virtual network card is used to communicate with the virtual machine.
VMware Virtual machine nat (address translation mode)