How VMware virtual machines are connected in a network

Source: Internet
Author: User
Tags virtual environment

VMware offers three modes of operation, which are bridged (bridging mode), NAT (network address translation mode), and host-only (host mode). To properly apply them in network management and maintenance, you should first look at these three modes of work.

   1.bridged (bridging mode)
After selecting the bridge, be sure to restart the host's local area connection, or the bridge cannot be used on the Internet. This problem may arise in most people.
In this mode, the VMware virtual operating system is like a separate host in the LAN, which can access any machine in the network. in bridging mode, you need to manually configure the virtual system with an IP address, subnet mask, and the same network segment as the host machine so that the virtual system can communicate with the host machine。 At the same time, because this virtual system is a separate host system in the LAN, it is possible to manually configure its TCP/IP configuration information to enable access to the Internet through a LAN gateway or router.
The relationship between a virtual system using bridging mode and a host machine is like two computers connected to the same hub. To make them communicate with each other, you need to configure the IP address and subnet mask for the virtual system, or you will not be able to communicate.
If you want to use VMware to create a new virtual server within the LAN, to provide network services for LAN users, you should choose bridging mode.
This is the simplest way to directly bridge the virtual network card to a physical network card, and the Linux next NIC binding two different address similar, in fact, the network card is set to promiscuous mode, so as to achieve the ability to listen to multiple IPs.
In this mode, the inside of the virtual Machine network card (for example, Linux under the eth0) directly connected to the network of physical network card, you can imagine that the virtual machine and host machine in a peer position, the network relationship is equal, no one who is behind the problem.
It's easy to use this approach, provided you get more than 1 addresses. For friends who want to do a variety of network experiments, because you can not control the network of virtual machines, it went directly out.

   2.NAT (network address translation mode)
Using NAT mode, the virtual system uses the NAT (network address translation) function to access the public network through the network where the host machine resides. In other words, the use of NAT mode enables access to the Internet in virtual systems. The TCP/IP configuration information for a virtual system in NAT mode is provided by the DHCP server of the VMNET8 (NAT) virtual network and cannot be modified manually, so the virtual system cannot communicate with other real hosts on the local area network. The biggest advantage of using NAT mode is that virtual system access to the Internet is very simple, you do not need to do any other configuration, only the host machine can access the Internet.
This approach also enables two-way access to the Hostos and guest OS. However, other machines within the network cannot access the Guest os,guest OS can access other machines within the network through Hostos with the NAT protocol. The NAT mode IP address configuration method is assigned an IP in VMware's virtual DHCP server, where the route is already set, which is pointing to 192.168.138.1.
If you want to use VMware to install a new virtual system, you can directly access the Internet without any manual configuration in the virtual system, it is recommended that you use NAT mode.

In this way, there is a virtual network card Vmnet8 (by default), if you have a NAT server experience, the VMNET8 is equivalent to connect to the intranet network card, and the virtual machine itself is the equivalent of running on-line machine, The network card within the virtual machine (eth0) is independent of the vmnet8.
You will find that in this way, VMware's own DHCP is loaded into the Vmnet8 interface by default, so that the virtual machine can use the DHCP service. More importantly, VMware comes with a NAT service that provides address translation from Vmnet8 to extranet, so this is a real NAT server running, but for virtual machines.
Obviously, if you have only one extranet address, this approach is appropriate.

3, host-only (host mode)
In some special network debugging environments, it is required to isolate the real environment from the virtual environment, then you can use the host-only mode. In host-only mode, all virtual systems can communicate with each other, but virtual systems and real networks are isolated.
Note: In host-only mode, the virtual system and the host machine system can communicate with each other, which is equivalent to the two machines connected by twisted pair wires.
In host-only mode, the TCP/IP configuration information (such as IP address, gateway address, DNS server, etc.) of the virtual system is dynamically allocated by the DHCP server of the VMNET1 (host-only) virtual network.
If you want to use VMware to create a virtual system that is isolated from other machines in the network, you can choose Host-only mode for some special network debugging work.
This should be the most flexible way to be interested in a variety of network experiments. Unlike NAT, the only difference is that, in this way, there is no address translation service, so, in the case of modulo, the virtual machine can only be accessed by the host, which is also the meaning of the hostonly name.
By default, a DHCP service is also loaded onto Vmnet1. The virtual machine connected to the VMNET1 can still be set to DHCP, which facilitates the configuration of the system.
Is this the way there is no way to connect to the external network, of course not, in fact, this way more flexible, you can use your own way, so as to achieve the most ideal configuration, for example:
A. Use your own DHCP service: first stop VMware's own DHCP service and make DHCP service more uniform.
B. Use your own NAT to easily join a firewall. Windows host can do a lot of NAT, simple as windowsxp Internet sharing, complex as the NAT service in Windows Server.
C. Use your own firewall. Because you have complete control over the VMNET1, you can join (or experiment) the firewall between the VMNET1 and the extranet's network card.
From the above can be seen, hostonly this model and ordinary natserver with the whole network of the situation similar, so you can easily carry out related experiments, such as fire-resistant settings.
How to work with VMware Host only
In this way of working, the guest is assigned an IP address by the DHCP server. and can maintain communication between the 192.168.222.X. However, it is not possible to ping the address of host 172.16.1.210 on the guest machine. Because the communication is limited to the host (so called hostonly). This looks like a NAT approach, but in this way the guest can only communicate with the host and not communicate with the local area computer unless it is forwarded or routed on the host.
Example: the VMNET8 virtual network in the NAT mode mentioned above, the VMNET1 virtual network in host-only mode, and the VMnet0 virtual network in bridged mode are all generated by the automatic configuration of VMware virtual machine and do not need to be set by the user. VMnet8 and MNET1 provide DHCP services, and VMNET0 virtual networks do not provide
VMware Three Internet connection settings:
1.bridge:
Use Vmnet0 by default
The IP settings of the virtual machine are not used with the host network segment, the rest is the same as the host:
For example, the host IP is 192.168.2.46, and the virtual machine IP is set to 192.168.2.254. Netmask,broadcast,gateway,dns both with the host
The same is true for virtual machines <---> Host virtual machines <----> Internet communications.
2.nat:
Use Vmnet8 by default
DHCP: DHCP is the default state.
As long as the physical function is connected to the network, the virtual machine can be connected.
Manual settings:
(It is important that you view its default address by opening the Vmnet8 property under the network properties of the physical machine.) But do not change OH) IP
Set up with the VMNET8 segment, Gateway Vmnet8 Gateway (XXX.XXX.XXX.2) can be found in the Vmnet8 gateway, usually
Edit->virtual Network Setting->host Virtual networkmapping, locate the VMNET8, click the left arrow icon
, select NAT and you'll see the gateway
The Netmask,broadcast settings are the same as VMNET8, and the DNS settings are the same as the host. (The DNS province can also, he will automatically let the Gateway conversion parsing)
For example Vmnet8 ip:192.168.187.1 gw:192.168.187.1.2 here is the system default, can not change the OH.
Virtual machine settings: ip:192.168.187.254 gw:192.168.187.1.2dns: (empty) or: 202.102.224.68 (in fact,
Let's think about it, the setup is actually the same as the DHCP assignment, nothing special, and it doesn't make any sense.

3.host-only:
Use Vmnet1 by default
DHCP: DHCP is the default
Make up a virtual network isolated from the physical network
But one thing is that you can communicate with the host machine.
Of course you can specify the IP manually, but the network header to select VMNET1 IP OH
Detailed
Host-only This mode is a standalone host mode, meaning is not able to communicate with the outside world. But we can understand that this model
Uses Vmnet1, which is a virtual switch.
Analysis of reasons for not being able to surf the Internet:
The virtual machine itself is assigned an IP based on its own DHCP, and the physical machine is not within a segment. People have to ask if manually assigned with the object
The IP in the machine segment and the same DNS resolution is not OK?? But it's also not possible to tell people that. No bridging with Nat these
The mode of sharing and converting IP is also not connected (this is just my personal understanding.) Isn't it possible to surf the Internet?
I'll see.
Internet:
1, the physical host's local connection settings to the Vmnet1 share (must be Vmnet1 oh, why don't I say it ^_^)
Vmnet1 connected IP becomes 192.168.0.1, which is the same as the shared connection of our normal physical machine.
2, manually set the same IP in the same segment as the physical machine, with the same DNS resolution (or the IP of the physical host), the gateway is set to
192.168.0.1
Example: HOST (VMNET1): 192.168.0.1 NETMASK 255.255.255.0
Guest:192.168.0.2netmask 255.255.255.0 DNS 192.168.0.1
Frankly speaking, we use the virtual machine as a physical machine to carry out the shared network settings, here to ask, then if the agent, think about it, do not ask me oh. I'm learning too.
Here we are mainly to understand the next virtual Machine connection and host connection of a tacit understanding.
Wrong place everyone correct the supplement.

Reprint please specify the original address:http://www.server110.com/vmware/201310/1973.html

Detailed network connectivity for VMware 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.