Three methods and principles of vmwarevm networking

Source: Internet
Author: User

Three Network methods and principles of vmwarevm I. Brigde -- bridging: by default, VMnet0 is used. 1. Principle: Bridge is a host. This host has two NICs in two local networks, at the same time, on the "bridge", A program is run to 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 will Virtualize a network card and a real physical network card to bridge the network card. In this way, all data packets sent to the physical network card will be sent to the vmwarevm, data packets sent by VMWare are also sent from the physical network card 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. Www.2cto.com 2. Networking: This networking method is the easiest. In the LAN, how is your host connected to the Internet, and how are you connected to the network in 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. 2. NAT-Network address Translation: VMnet8 is used by default. 1. Principle: NAT is short for Network address translation. 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. At www.2cto.com, VMWare's NAT Internet access is the same. 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 the same 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 adapter 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. Therefore, the virtual machine can ping the IP address of the host, but the host cannot ping the IP address of the virtual machine. 2. 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 to implement Internet communication between virtual machines-host virtual machines <---->. Www.2cto.com: if the host can access the Internet, the virtual machine can access the Internet, but the host cannot access the virtual machine. 3. Host-Only -- shared private network Host: VMnet1 is used by default. 1. Principle: Mutual network access between the Host and the virtual machine is provided. 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. 2. 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 www.2cto.com to set the Virtual Machine IP address to the same network segment as VMnet1 and the gateway to the same gateway as VMnet1. The other settings are the same as vmnet1. the DNS settings are the same as those of the host. For example, VMnet1 IP: 172.16.249.1 Gateway: 172.16.249.2, then the Virtual Machine IP Address: 172.16.249.100 Gateway: 172.16.249.2, the virtual machine <---> the host can communicate, but the Virtual Machine <---> the Internet cannot communicate: the Host-only technology is only used for mutual access between hosts and virtual machines. Author HellAngle

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.