Three networking methods and principles of VMware virtual machines __ Virtual machines

Source: Internet
Author: User
Tags get ip

First, brigde--bridge: default use VMnet0

1, principle:

Bridges Bridge "is a host, the machine has two network cards, respectively, in two LAN, at the same time on the" bridge ", running the program, so that all packets of LAN A are intact into B, and vice versa. In this way, Lan A and B are seamlessly connected in the link layer, when the bridge, VMware and physical network card should be in the same IP segment of course to ensure that two LAN no conflicting IP.

VMware's bridge is the same, but, as a hardware, the network card is now virtual by VMware software. When bridged, VMware will virtual a network card and a real physical network interface bridge, so that all packets sent to the physical network card to the VMware virtual machine, and the data packets from VMware will be sent through the bridge from the end of the physical network card.

Therefore, if the physical network card can be connected to the Internet, then bridge the soft network card is no problem, this is the principle of bridging the Internet.

2, Networking mode:

This is the simplest way of networking, in the local area network, your host is how to network, you are in the virtual machine how to connect the net. Think of a virtual machine as another computer within a local area network.

Tip: The host network card is located in a local area network that can access the Internet, and virtual machines can access the Internet through bridge.

Second, nat--network address translation: default use VMnet8

1, principle:

NAT is the abbreviation of network address translate. NAT technology is applied to Internet gateways and routers,   For example, 192.168.0.123 this address to access the Internet, its packets will be through a gateway or router, and the gateway or router has a access to the Internet IP address, such gateways and routers to send and receive packets, the packet's IP protocol layer of data changes (i.e. NAT) so that private network segment hosts can access the internet smoothly. This technology solves the problem of the scarcity of IP addresses. The same private IP can gateway NAT to the Internet.

VMware's Nat Internet is also the same reason, it is between the host and virtual machine with software forged a network card, this network card and virtual machine IP in an address

Paragraph At the same time, Nat is performed between the network interface of this NIC and the host. Every packet sent by the virtual machine passes through the virtual network card, and then the NAT, which is then emitted by the host's interface.

Virtual network card and virtual machine in an address segment, Virtual machine and host a different address segment, the host is equivalent to the virtual machine gateway, so the virtual function ping to the host IP, but the host ping not to the virtual machine IP.

2, Networking mode:

Method 1, dynamic IP address.

Host is static IP or dynamic IP, does not matter, the virtual machine is set to use DHCP to access the Internet, Windows Select "Automatically get IP", Linux open DHCP service can be. (This is the easiest way to do this without too many settings, but to do "edit → virtual network settings" in VMware, both NAT and DHCP are turned on.) General NAT enabled by default, DHCP default shutdown)

Method 2, static IP address.

If you do not want to use DHCP, you can also manually set:
IP settings are in the same network segment as VMNET1, gateways set to Vmnet8 (gateways in the Net tab of "virtual network Settings") are usually xxx.xxx.xxx.2.
The subnet mask setting is the same as VMNET8 (the subnet mask is automatically generated when the IP address is set).
The DNS settings are the same as the host.

For example: Host IP is 10.70.54.31, set virtual machine IP to 10.70.54.22. Netmask,gateway,dns is the same as the host to implement virtual machine---host virtual machine <----> Internet communication.

Tip: With NAT technology, a host can access the Internet, and the virtual machine can access the Internet, but the host cannot access the virtual machine.

Third, host-only--private network shared host: default use VMnet1

1, principle:

Provides a network of visits between the host and the virtual machine. Just want to have a data exchange between the virtual machine and the host,
Instead of having a virtual machine access the Internet, this setting is used.

Under host-only conditions, VMware creates a soft network card in a real Windows system. This card can be seen in the network connection, is generally VMNET1, the role of this network card is to enable Windows to see the virtual machine IP.


2, Networking methods:

Method 1, dynamic IP address.
When DHCP is turned on as above, virtual machines automatically obtain IP addresses and DNS directly. Can be connected with the host. Of course, there are some local area network sharing operations, there is no longer to repeat.

Method 2, static IP address.

can also be set manually, the virtual machine IP settings and VMnet1 with the network segment, the gateway set to VMnet1 IP, the rest of the same settings and VMnet1, DNS settings and host the same.

For example: VMnet1 ip:172.16.249.1 gateway:172.16.249.2

So the virtual machine ip:172.16.249.100 gateway:172.16.249.2

This way, the virtual machine <---> host can communicate
However, virtual machines <---> The Internet cannot communicate

Tip: host-only technology is used only for host and virtual machine exchange visits, regardless of access to the Internet.

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.