Three methods and principles of vmwarevm networking, vmwarevm

Source: Internet
Author: User

Three methods and principles of vmwarevm networking, vmwarevm

Three methods and principles of vmwarevm networking

Brigde-bridging: VMnet0 is used by default.

Principle :###

Bridge is a host. This machine has two NICs, which are located in two local networks and run programs on the Bridge, let all data packets in Lan A flow into B intact, and vice versa. In this way, lan A and lan B are connected seamlessly at the link layer. When bridging, the VMWare NIC AND THE PHYSICAL Nic should be in the same IP segment, of course, there must be no conflicting IP addresses in the two LAN.

The same is true for VMWare's bridge, except that, as a hardware Nic, it is now virtualized by VMWare software!When bridging is used, VMWare virtualizes a network card and a real physical network card.In this way, all the packets sent to the physical NIC are sent to the vmwarevm, And the packets sent by VMWare are also sent from the physical Nic through the bridge.

Therefore, if the physical network card can access the Internet, there is no problem with the soft network card that is bridging the Internet. This is the principle of bridging the internet.

Networking method :###

This is the easiest way to connect to the Internet. In the LAN, how is your host connected to the Internet and how is it connected to a virtual machine. Think of a virtual machine as another computer in the LAN!

Tip: the host Nic is in a LAN that can access the Internet, and the VM can access the Internet through the Bridge.

NAT-Network Address Translation: VMnet8 is used by default.

Principle:

NAT is short for Network address translate. NAT technology is applied to internet gateways and routers. For example, if the IP address 192.168.0.123 is used to access the internet, its data packets must be transmitted through a gateway or vro, And the gateway or vro has an IP address that can access the internet, such a gateway and router must modify the IP protocol layer (NAT) of the data packet when sending and receiving data packets so that the host in the private network segment can access the internet smoothly. This technology solves the problem of scarcity of IP addresses. The same private IP address can be used by the gateway to access the Internet through NAT.

VMWare also uses NAT to access the Internet. It uses software to forge a network card between the host and the virtual machine. The ip address of this network card and the virtual machine is in an address segment. At the same time, the network interface between this Nic and the host is NAT. Each packet sent by the Virtual Machine passes through the virtual network card, and then NAT is sent by the host interface.

The virtual network card and virtual machine are in the same address segment. The virtual machine and the host have different address segments. The host is equivalent to the gateway of the virtual machine.The virtual machine can ping the IP address of the host, but the host cannot ping the IP address of the virtual machine..

Networking method :###

Method 1: Dynamic IP Address

It doesn't matter if the host is a static IP address or dynamic IP address. Set the VM to use DHCP to access the Internet, select "automatically obtain IP Address" in Windows, and enable the DHCP service in linux. (This method is the simplest and does not require too many settings, but you need to "Edit> Virtual Network Settings" in VMware to enable both NAT and DHCP. Generally, NAT is enabled by default, and DHCP is disabled by default)

Method 2: static IP Address

If you do not want to use DHCP, you can also set it manually:

The IP address is set to the same network segment as vmnet1, And the Gateway is set to the Gateway of vmnet8 (the Gateway can be found on the Net tab in "Virtual Network Settings") is usually xxx. xxx. xxx.2.

The subnet mask is set to the same as that of VMnet8 (after the IP address is set, the subnet mask is automatically generated)

The DNS settings are the same as those of the host.

For example, if the host IP address is 10.70.54.31 and the virtual machine IP address is 10.70.54.22. Netmask, Gateway, and DNS are all the same as the host.Virtual Machine-host   Virtual Machine <--> InternetCommunication.

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

Host-Only-shared private network Host: VMnet1 is used by default.

Principle:

Provides network mutual access between hosts and virtual machines. This setting is required if you only want to allow data exchange between the VM and the host, but do not want the VM to access the Internet.

With Host-only, VMWare creates a soft Nic In a real Windows system. This network card can be seen in the network connection, generally VMNET1, the role of this network card is to make Windows see the virtual machine IP.

Networking method :###

Method 1: Dynamic IP address.

After DHCP is enabled as above, the virtual machine automatically obtains the IP address and DNS. You can connect to the host. Of course, some local area network sharing operations are required.

Method 2: static IP Address

You can also manually set the Virtual Machine IP address to the same network segment as vmnet1. the gateway is set to the same gateway as vmnet1. other settings are the same as vmnet1. the DNS settings are the same as those of the host.

Example: VMnet1 IP: 172.16.249.1 Gateway 172.16.249.2

Then the Virtual Machine IP address is 172.16.249.100 Gateway: 172.16.249.2

This wayVirtual Machine <-> host        Communication available

HoweverVirtual Machine <-> Internet        Unable to communicate

Tip: the Host-only technology is only used for mutual access between hosts and virtual machines.

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.