A detailed explanation of NAT network connection in virtual machines

Source: Internet
Author: User

I personally understand the virtual machine, the virtual machine is the most convenient and most difficult to understand the NAT way to chat with everyone, because it is a liar NAT, so that will be wordy point, but mainly to take care of new people. :)

The old birds quickly fly bar hehe

Let's talk about something else first.

Suppose that now the teacher R with 3 classes of students, respectively, Class A, B, C class. There are now two modes of communication:

The 1th Way of communication:

The exchange in this class, for example a class of students want to communicate with another classmate, you can directly in the class to shout that classmate's name. This is the way to communicate to a computer within the same network segment of the computer-broadcast.

The 2nd Way of communication:

Class and class exchange between students, this time in a class directly shouted class B classmate name does not work, because across the wall, simply can't hear. This computer, which is similar to different network segments, is not able to communicate. This time two classes of students who want to communicate must be through the teacher R to do the messenger. This is similar to the gateway in the network. A class of students to say to tell R teacher, R teacher to pass the words to B class students.

We put this example to the network learning, to facilitate understanding

School = Internet

ben = Network Segment

Student = Computer

Teacher (Messenger) = virtual NAT server

I'm sorry my girlfriend told me to go to the street, first write this, next time to write

What other virtual machine knowledge, want me to boast, please follow the instructions below

I'm sorry, I'm late, and then I wrote it last time.

The way the virtual machine uses NAT to surf the internet is very similar to the 2nd way I communicate in the example.

Bridging is very much in line with the 1th mode of communication.

For example, if you install a virtual system and choose Nat mode, the virtual NAT server is like the role of R teacher. In charge of the virtual machine (students in Class A) and the computer on the Internet (students in Class C) communication.

Draw a small figure 1 to show you

It's more convenient to have a picture.

The features of NAT in the way of internet

1. The host's virtual NIC does not have to be set (automatically obtained by default)

2. The network card in the virtual system does not have to be set (automatically obtained by default)

This two implementation is based on the assumption that the virtual DHCP server is working correctly for everyone Figure 2

Looking at a figure 3 about NAT

After reading this 3 chart, we basically understand. But that's not convincing, so I'll explain it here.

where 192.168.2.2 quite with R teacher status, in Figure 1 is marked with a virtual NAT server

Figure 3 provides the IP address of the NAT.

Ipconfig of the host Figure 4

Ipconfig of the virtual machine Figure 5

Now use a command Trcert to explain that the virtual machine is online via a NAT server 192.168.2.2

The tracert command displays the path through which the packet reaches the target host and displays the time it took to reach each node. The command function is similar to ping, but it gets more detailed information than the ping command, which shows all the paths the packet takes, the IP of the node, and the time it takes. This command is more appropriate for large networks.

We are now on the virtual machine Trcert Baidu look at the virtual machine packet book How to reach Baidu.com

See if there's any 192.168.2.2 (virtual NAT server)

VMware Virtual Network related knowledge

1. Virtual Network Bridge

Through the virtual Network Bridge to the virtual machine's virtual network card connected to the host's physical network card. It allows the virtual machine to be connected to the external network where the host hosts. If more than one physical NIC is used on the host, a custom configuration is created to create additional virtual bridges to connect other physical network cards on the host.

 2. Host Virtual network card

After installing the virtual machine, we right-click the "Network Place"/attribute/See two network cards in the Open Net Connection window, by default "VMware network Adapter VMnet1" for host-only network use; VMware network Adapter VMnet8 "for use by NAT networks. Right button The properties of these two network adapters, we can see the full name of the virtual network card under the regular label. Of course, we can also enter Ipconfig in the host's command prompt to learn more about the host virtual network card

 3.NAT Equipment

NAT is a shorthand for network address translation. When a host computer has only one IP on the outside, with a NAT device that allows a virtual machine to connect to the external network, we open the "services" in the management tool on the host and discover a "VMware NAT service" that has been installed as a system service.

 4.VMware DHCP Service

DHCP is a shorthand for dynamic host configuration protocols. The DHCP service provides IP addresses for virtual machines that do not have bridges to external networks. The virtual machine IP address that uses the Bridging network mode is provided directly by the DHCP server of the host's external network.

Original VMware provides a virtual network card diagram Some beginners to the VMware Virtual Machine Bridge, VMnet1 (host-only), VMnet8 (Nat way), I have VMware the meaning of the network card three map, I hope to help.

The display is not complete, please save the view.

Figure 6

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.