Three modes of VMware virtual Internet--bridged, host-only, NAT mode

Source: Internet
Author: User
Tags virtual environment

I'm afraid this is the last blog in Shanghai this year, colleagues are not working at work, and I have nothing to do. Why write this blog, because I go home to bring my own notebook, which contains a virtual machine. Usually their own study and work are carried out in the virtual machine. Home without the LAN, you can not connect the virtual machine. After looking for information, to supplement the network knowledge, nearly a day of tossing, finally found on the Internet, reliable information, completed the single-machine mode access to virtual machines needs. This article is from http://www.iknowing.com/iknowing/note/950518713330/iframe.html, this blog is very thorough.

Host device: Windows 7 64-bit

Virtual Appliance: Vmware®workstation version (11.0.0 build-2305329)

Virtual system: CentOS 6.4 Mini Installation version

VMWare offers three modes of operation, which are bridged (bridge mode), NAT (network address translation mode), Host-only (host mode).

1, bridged (bridge mode)

In this mode, VMware virtual operating system is a separate host in the LAN, it can access any device 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 can configure its TCP/IP configuration information manually to realize the Internet through the LAN gateway or routing.

The relationship between a virtual system that uses bridging mode and a host machine, like two computers connected to the same hub ( what is the hub) and you want them to 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.

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 DHCP ( What is a DHCP) server with a VMnet8 (NAT) virtual network and cannot be modified manually. Therefore, the virtual system will not be able to communicate with other real hosts in this LAN.

The biggest advantage of using NAT mode is that virtual system access to the Internet is particularly simple, you do not need to make other settings, only the host machine can access the Internet.

3, Host-only (host mode)

in some special network debugging environment, it is required to separate the real network environment from the virtual environment. For example, home, home without a network, and want to access the virtual machine this situation. You can use the Host-only mode at this time.

In host-only mode, the virtual system and the host machine can communicate with each other, which is equivalent to the two machines connected by twisted pair.

  

Referring to VMware people think of virtual machine technology, virtual machine technology in the recent years has been widely developed, some large network service providers have started to adopt virtual machine technology, not only saves the investment cost, but also saves energy consumption.

We know that there are several versions of VMware, and the common user is workstation, but regardless of which version we use, we can see that we choose the network mode during the installation process. Bridge mode is selected by default, but users will ask what other modes are used for? Sometimes you can't surf the internet after choosing another mode. Today, we will discuss with you the features and communication rules of VMware 3 network modes.

Network mode

Let's start by talking about several VMware virtual devices

VMNET0: Virtual Switch for virtual bridging network

VMNET1: Virtual Switch for Virtual Host-only network

VMNET8: Virtual Switch for virtual NAT network

VMware Network adepter vmnet1:host Virtual network card for communication with host-only virtual networks

VMware Network adepter vmnet8:host Virtual network card for communication with NAT virtual networks

When a VMware virtual machine is installed, two more virtual network cards are created in the Network Connections dialog box.

I. Bridging network (bridged Networking)

Bridging network refers to the local physical network card and the virtual network card through the VMNET0 Virtual switch for bridging, physical network cards and virtual network cards on the topological map on the same status (virtual network card is neither Adepter VMnet1 nor Adepter VMnet8).

Bridge network topology diagram

Then the physical network card and the virtual network card are equivalent to the same network segment, the virtual switch is the equivalent of a real-world switch. Therefore, the IP address of the two network card should also be set to the same network segment.

Physical network card IP address

Virtual network card IP address

We see that the IP address of the physical network card and the virtual network card are in the same network segment, the subnet mask, gateway, DNS and other parameters are the same. Two network cards are relatively independent in the topology.

Ping results

We ping192.168.15.96 on the 192.168.15.111 and the results show that two NICs can communicate with each other. If a DHCP server exists in the network, the virtual network card can also obtain an IP address from the DHCP server. So bridging network mode is the simplest and most straightforward mode in VMware virtual machines. It is the default option when you install a virtual machine.

Two. Nat mode

The VMware Network adepter VMnet8 Virtual network card is used in the NAT networks, and the VMware network adepter VMnet8 virtual network card on the host is connected directly to the VMNET8 virtual Switch to communicate with the virtual network card.

NAT Network mode

The VMware network adepter VMnet8 Virtual network card is limited to communicating with the VMNET8 segment, and it does not provide routing capabilities to the VMNET8 segment, so the virtual machine is virtual to a NAT server so that the virtual network card can connect to the Internet. In this case, we can use the port mapping feature to map the requests that access the host 80 port to the 80 port on the virtual machine.

The IP address of the VMware network adepter VMnet8 Virtual network card is specified by the system when installing VMware, we do not modify this value, otherwise the host and the virtual machine will not be able to communicate.

NAT Virtual network card IP address

Physical network card IP address

Virtual network segment and NAT mode virtual network card network segment is the same, both 192.168.111.X, including the NAT server IP address is also this network segment. A virtual DHCP server is also generated after VMware is installed, assigning an IP address to the NAT server.

The VMware Network adepter VMnet8 Virtual network card is called when the host and the virtual machine are communicating, because they are in a network segment, so communication is not a problem.

In fact, the role of the VMware network adepter VMnet8 Virtual network card is to provide an interface for the communication between the host and the virtual machine, even if the host's physical network card is turned off, the virtual machine can still connect to the Internet, but the host and the virtual machine cannot exchange visits.

Three. Host-only mode

In host-only mode, the virtual network is a fully enclosed network, and the only access to it is the host. In fact, Host-only Network and NAT network is very similar, the difference is that the Host-only network does not have NAT service, so the virtual network can not connect to the Internet. Communication between the host and the virtual machine is achieved through the VMware Network adepter VMnet1 virtual network card.

Host-only mode

As with NAT, the IP address of the VMware network adepter VMNET1 Virtual network card is also specified by the VMware system, and the IP address of the virtual DHCP server and virtual network card generated is located in the same segment, but the IP address of the physical network card is not the same network segment.

Host-only Virtual network card IP address

Physical network card IP address

Host-only's aim is to create an internal network that is isolated from the outside world to improve the security of the intranet. This feature may not make much sense to ordinary users, but large service chambers often take advantage of this feature. If you want to provide routing for the VMnet1 network segment, you will need to use RRAS instead of XP or 2000 ICS, because ICS will change the IP address of the intranet to 192.168.0.1, but the virtual machine will not assign this address to the VMNET1 virtual network card. Then there is no communication between the host and the virtual machine.

Review

In the VMware 3 network mode, the NAT mode is the simplest, basically do not need to manually configure the IP address and other related parameters. As for the bridge mode requires an additional IP address, if it is in the intranet environment is still very easy, if ADSL broadband is more troublesome, ISP is generally not generous to provide a public network IP.

Three modes of VMware virtual Internet--bridged, host-only, NAT mode

Related Article

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.