VMware Virtual machine Three ways and principles of networking

Source: Internet
Author: User
Tags get ip

VMware Virtual machine Three ways and principles of networking

Brigde―― Bridging: Default use of VMnet0

Principle:

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

The same is true of VMware's Bridge, except that a piece of NIC, which was originally a hardware, is now virtual by VMware Software! when using bridging, VMware will bridge the virtual piece of network card and the real physical network card , so that all packets sent to the physical network card go to the VMware virtual machine, and the data packets sent by VMware will be sent through the bridge from the physical network card.

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

Network mode:

This kind of networking is the simplest, in the LAN, your host is how to network, you in the virtual machine how to connect the network. Think of the virtual machine as another computer in the LAN!

Tip: The host network card is in a LAN that can access the Internet, and the virtual machine can access the Internet through bridge.

Nat―― Network Address translation: Use VMNET8 by default

Principle:

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

The same is true of VMware's Nat Internet, which uses software to forge a network card between the host and the virtual machine, and the IP of the network card and the virtual machine are in an address segment. At the same time, Nat is performed between this NIC and the host's network interface. Each packet that is emitted by the virtual machine goes through the virtual network card, then NAT, which is then issued by the host's interface.

The virtual network card and the virtual machine are in an address segment, the virtual machine and the host are different one address segment, the host is equivalent to the virtual machine's gateway, so the virtual function ping to the host's IP, but the host ping does not reach the IP of the virtual machine.
    

Network mode:

Method 1, dynamic IP address

Host is static IP or dynamic IP, it does not matter, set the virtual machine to use the DHCP mode of Internet access, under Windows Select "Get IP Automatically", Linux under the DHCP service can be opened. (This method is the simplest, not too many settings, but to make "edit → virtual network settings" in VMware, both NAT and DHCP are turned on.) General Nat is turned on by default, DHCP is off by default)
  
Method 2, static IP address

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

IP settings with VMNET1, Gateway set to VMNET8 Gateway (in the "Virtual network settings" in the Net tab can find gateway) is 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 virtual Machines---host VMS <----> Internet Communications, all with the same host.   

Tip: with NAT technology, the host can surf the Internet, the virtual machine can access the Internet, but the host cannot access the virtual machine .

Host-only―― private network shared host: Default use VMnet1

Principle:

The network visits between the host and the virtual machine are provided. This setting is used only if you want to have data exchange between the virtual machine and the host, and you do not want the virtual machine to access the Internet.

Host-only, VMware builds a soft network card in a real Windows system. This NIC can be seen in the network connection, is generally VMNET1, the function of this network card is to make Windows see the virtual machine's IP.

Networking methods:

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

Method 2, static IP address

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

Example: VMnet1 ip:172.16.249.1 Gateway 172.16.249.2
  
Then the virtual machine ip:172.16.249.100 gateway:172.16.249.2
  
This allows the virtual machine <---> host to communicate        
But virtual machines <---> Internet can't communicate        

Tip: host-only technology is only used for host and virtual machine visits, regardless of internet access.

VMware Virtual machine Three ways and principles of networking

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.