VMware Several networking ways, how to achieve virtual machine online

Source: Internet
Author: User
Tags switches

My PC has an IP address that can access the network, so how to allow the VM to share my IP address, also can surf the internet. Today in the exploration of the implementation of the specific configuration as follows:

1, first enable the VM's NIC Net8:

2, and then set the VM's NIC to VMnet8 (NAT):

3, the PC can be used to share the Internet network card:

To check to allow other network users to connect through the Intenet connection of this computer and select VMnet8.

4, set the default gateway for the VMNET8 network card is the IP address of the network card that the local PC can access:

I can surf the Internet the IP address of the network card is 172.18.216.77,VMNET8 address for 192.168.0.1

5, set the address of the network card in the VM as 192.168.0.* network segment, the default gateway is 192.168.0.1, and the DNS is configured well.

So even if the settings are complete, when you access the network in the VM, First, according to the default gateway 192.168.0.1, found the VMNET8 network card, and then according to the VMNET8 network card's default gateway 172.18.216.77 found the network card can be online, and the network card has been sharing the Internet, so the VM shared host IP address Internet.

Noun explanation VM: The virtual machine is now embodied in a product called Vm/esa, which is widely installed in IBM's host operating system, including the MVS and Session Monitoring System (CMS), so each operating system looks like it has its own complete software and hardware resource system (data storage, communications, processors, etc.). This means that the VM gives each operating system a "virtual machine" of its own. VMS and CMS are popular in many large companies as a system that allows a large number of interactive users to communicate or develop and run programs at the same time. Many companies use MVS as a commercial application, using VMS as a program development and user communications environment.

The fundamental difference between VMware three network models

Virtual machine technology has been widely developed in recent years, some large network service providers have started to adopt virtual machine technology, not only save investment costs, but also save energy consumption. Now many friends use VMware to solve the 32-bit XP memory access problem, and today we discuss the VMware 3 network mode of functional and communication rules.

We know that VMware is divided into several versions, the most common user is workstation, but no matter which version we use, we can find in the installation process to choose the network mode. Bridge mode is selected by default, but some users ask what other patterns are for. Sometimes when you choose another mode, you can't surf the internet.

Network mode

Let's start by talking about several VMware virtual devices

VMNET0: Virtual switches for virtual bridging networks

VMNET1: Virtual switches for Virtual host-only networks

VMNET8: Virtual switches for Virtual NAT networks

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

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

After you install the VMware virtual machine, you will have two more virtual NICs in the Network Connection dialog box, as shown in the figure:

Network Connections

I. Bridging network (bridged networking)

Bridging network refers to the local physical network card and virtual network card through the VMnet0 Virtual Switch bridge, the physical network card and the virtual network card in the topological map on the same status (virtual network card is neither Adepter VMnet1 nor Adepter VMnet8).

Bridge Network topology Map

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

Physical network card IP address

Virtual network card IP address

We see that the physical network card and the virtual network card IP address in the same network segment, 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, the result shows that two network cards can communicate with each other. If a DHCP server exists on the network, the virtual NIC can also obtain an IP address from the DHCP server. So bridging network mode is the simplest and most straightforward pattern in VMware virtual machines. It is the default option when installing virtual machines.

two. Nat Mode

In a NAT network, the VMware Network adepter VMNET8 Virtual network adapter is used, and the VMware network Adepter VMnet8 Virtual NIC on the host is directly connected to the VMNET8 virtual Switch to communicate with the virtual network card.

NAT Network mode

VMware Network adepter VMNET8 Virtual network card is limited to communication with VMNET8 network segment, it does not provide routing function to VMnet8 network segment, so virtual machine virtual 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 requests to host port 80 to the virtual machine on port 80.

The IP address of the VMware network adepter VMNET8 Virtual network adapter is generated by the system when you install VMware, and 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 of network segment is the same, all 192.168.111.X, including the NAT server IP address is the network segment. After you install VMware, you will also generate a virtual DHCP server that assigns IP addresses to the NAT server.

The VMware network Adepter VMnet8 Virtual NIC is invoked when the host communicates with the virtual machine, because they are all in one 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 completely closed network, it is the only access to the host. In fact, Host-only Network and NAT network is very similar, different place is host-only network without NAT service, so the virtual network cannot 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

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

Host-only Virtual network card IP address

Physical network card IP address

The purpose of Host-only is to establish an internal network which is isolated from the outside world to improve the security of intranet. This feature may not make much sense to average users, but large service chambers often take advantage of this feature. If you want to provide routing functionality for VMNET1 segments, you 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 does not assign this address to the VMNET1 virtual network card, then the host and the virtual machine cannot communicate.

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.