VMware virtual machine three network mode Detailed --NAT (address translation mode)

Brief introduction       

General virtual machine online, use the bridge mode configuration is simple, but if your network environment is the very lack of resources or ip ip for more stringent management, then the bridge mode is not as useful, but we need networking.

How do we solve it?

We need to use another network mode of vmware: NAT (address translation mode)                                                                                           

1. What is NAT mode?

With NAT NAT mode virtual appliances and virtual DHCP server so that virtual machines can be networked. Network structure as shown below:

blob.png

In NAT mode, the virtual card and the host is directly connected to the NAT device, the NAT device and the virtual connection with a virtual DHCP server on the VMnet8 virtual switch, thus achieving a virtual machine network.

Then we will find it very strange why the virtual network adapter VMware Network Adapter VMnet8 it?

Our original virtual network adapter VMware Network Adapter VMnet8 primarily to enable communication between the host and the virtual machines.

2, how to set up NAT mode.

1) Set option NAT mode virtual machine, open vmware, "Virtual Network Editor," click "Edit" to set the parameters NAT and DHCP parameters.

blob.png

blob.png

blob.png

2) the virtual machine network connection mode modified to NAT mode, click on the "Edit virtual machine settings."

blob.png

Click on "Network adapters", select the "NAT Mode"

blob.png

3) Power on the system card edit configuration files, command vi / etc / sysconfig / network-scripts / ifcfg-eth0

blob.png

Specific configuration is as follows:

blob.png

Editing is complete, save and exit, and then restart the virtual machine network card, obtain the dynamic ip address

Run ifconfig, can not get a dynamic ip

blob.png

If you can not get a dynamic ip address solutions

1, first determine the host ADSL Internet can be normal, the control panel --- ---- service management tool, start "VMware DHCP Service" "VMware NAT Service" (due to the slow down of the VMware service system, I put the service to manual, and restart if needed)

blob.png

2. Run dhclient eth0

3, execute the command ifconfig, discovery can see ip

3, the test

1) Use the ping command to ping outside the network ip, test whether networking.

blob.png

2) connection with the remote communication tool to test the virtual machines and physical machines, communication can be found in

3) We now come to test the role of VMware Network Adapter VMnet8 virtual NIC

Disable VMware Network Adapter VMnet8

blob.png

blob.png

blob.png

Unicom virtual machines outside the network, but the physical machine and the virtual machine can not communicate

After VMware Network Adapter VMnet8 enabled, remote discovery tools can be connected to the virtual machine.

4. Summary:

NAT mode, using the virtual NAT device and the virtual machine virtual DHCP server to connect to external networks, and VMware Network Adapter VMnet8 virtual network adapter is used to communicate with the virtual machine.

5, summary    

Set nat mode Internet and pay attention

1, a gateway parameters and parameter dhcp nat in the network editor

2, nat mode enabled Internet

3, edit the virtual machine's NIC's ip (can be static, dynamic can)

4, restart the network services, testing can be networked communications and virtual and physical machines

Guess you like

Origin www.cnblogs.com/springsnow/p/12214509.html
Recommended