Differences between VMware bridging net

Source: Internet
Author: User

Fundamental differences between the three network modes of VMware bridged Nat host-only Vmware

When talking about VMWare, we think of virtual machine technology. In recent years, virtual machine technology has been widely developed. Some large network service providers have begun to adopt virtual machine technology, which not only saves investment costs, this reduces energy consumption.

We know that there are several versions of VMware, which are most commonly used by common users: workstation. However, no matter which version is used, we can choose either of them during the installation process.Network Mode. The bridge mode is selected by default, but some users will ask what other modes are used? Sometimes you cannot access the Internet after you select another mode. Today, I will discuss with you the functions and communication rules of the vmware3 network model.

Network Mode

Let's talk about several VMware Virtual Devices.

Vmnet0: used for Virtual Switches in a virtual bridge network

Vmnet1: used for Virtual Switches under the virtual host-only Network

Vmnet8: used for vswitches in a virtual Nat Network

VMware networkadepter vmnet1: Virtual Network Card used by the host to communicate with the host-only virtual network

VMware networkadepter vmnet8: Virtual Network Card used by the host to communicate with the NAT Virtual Network

After the vmwarevm is installed, two more virtual NICS will be displayed in the network connection dialog box,

Network Connection

1. bridged networking)

Bridging network refersLocal physical Nic and virtual NIC are bridging through vmnet0 vswitchThe physical and virtual NICs are in the same position on the topology (the virtual Nic is neither adepter vmnet1 nor adepter vmnet8 ).

Bridging Network Topology

The physical and virtual network interfaces are in the same network segment.A vswitch is equivalent to a switch in a real network. Therefore, the IP addresses of the two NICs must be set to the same network segment.

Physical Nic IP Address

Virtual Nic IP Address

We can see that the IP addresses of physical and virtual NICs are in the same network segment, and the subnet mask, gateway, DNS, and other parameters are the same. The two NICs are relatively independent in the topology.

Ping result

On 192.168.15.111, ping192.168.15.96 is displayed. The two NICs can communicate with each other. If a DHCP server exists in the network, the virtual Nic can also obtain the IP address from the DHCP server. Therefore, the bridge network mode is the simplest and most direct mode in the vmwarevm. It is the default option when you install a virtual machine.

Ii. Nat Mode

The VMware network adeptervmnet8 virtual Nic is used in the NAT network, and the VMware network adeptervmnet8 on the host is used.The virtual network card is directly connected to the vmnet8 vswitch to communicate with the virtual network card.

Nat Network Mode

VMware networkadepter vmnet8 virtual network card is only used to communicate with the vmnet8 network segment.It does not provide routing for the vmnet8 CIDR block. Therefore, the virtual machine virtualizes a NAT server and enables the virtual Nic to connect to the Internet. In this case, we can use the port ing function to map requests that access port 80 of the host to port 80 of the VM.

The IP address of the VMware network adepter vmnet8 virtual ENI is generated by the system when VMware is installed. Do not modify this value. Otherwise, the host and virtual machine cannot communicate.

Nat virtual Nic IP Address

Physical Nic IP Address

The CIDR block is the same as that of the NAT network adapter. The CIDR block is 192.168.111.x, And the IP address of the NAT server is the same as that of the NAT server. After VMware is installed, a virtual DHCP server is generated to assign an IP address to the NAT server.

When the host communicates with the virtual machine, it will call the vmwarenetwork adepter vmnet8 virtual network card, because they are all in a network segment, so the communication is not a problem.

Actually,The role of the VMware network adepter vmnet8 virtual Nic is to provide an interface for communication between hosts and virtual machines.Even if the host's physical Nic is disabled, the virtual machine can still connect to the Internet, but the host and virtual machine cannot access each other.

Iii. Host-only mode

In host-only mode, the virtual network is a fully closed network, and the only access to the virtual network is the host. In fact, the host-only network is similar to the NAT network. The difference is that the host-only network does not have a NAT service, so the virtual network cannot connect to the Internet. The communication between the host and the virtual machine is achieved through the VMware networkadepter vmnet1 virtual network card.

Host-only mode

Like Nat, the IP address of the VMware network adeptervmnet1 virtual Nic is also specified by the VMware system. the IP address of the virtual DHCP server and the virtual NIC are located in the same network segment, but it is not in the same CIDR block as the IP address of the physical ENI.

Host-only virtual Nic IP Address

Physical Nic IP Address

The purpose of host-only is to establish an internal network isolated from the outside to improve the security of the Intranet. This feature may be of little significance to common users, but it is often used by large service providers. If you want to provide the routing function for the vmnet1 CIDR block, you need to use RRAS instead of XP or 2000 ICS, because ICS will change the Intranet IP address to 192.168.0.1, but the virtual machine does not allocate this address to the vmnet1 virtual Nic, so the host and virtual machine cannot communicate.

Summary

In VMware 3, the NAT mode is the simplest, and you do not need to manually configure IP addresses and other related parameters. For the bridge mode, additional IP addresses are required. If it is easy to use in the Intranet environment,If it is ADSL Broadband, it is quite troublesome. ISP generally does not offer a public IP more generously.

I. brigde -- bridging: vmnet0 is used by default.

1. Principle:

Bridge "is a host. This machine has two NICs, which are located in two local networks and run programs on the bridge, 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.

2. Networking:

This is the easiest way to connect to the Internet. In the LAN, how is your host connected to the Internet and how is it connected to 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 translate. 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 NAT Gateway
Internet access.

VMware also uses Nat to access the Internet. 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 an 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 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 <---->.

Tip: using NAT technology, the host can access the Internet, and 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:

Provides network mutual access between hosts and virtual machines. 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 the Virtual Machine IP address to the same network segment as vmnet1 and the gateway to the IP address of vmnet1. the other settings are the same as vmnet1. the DNS settings are the same as those of the host.

Example: vmnet1 IP: 172.16.249.1 Gateway: 172.16.249.2

Then the Virtual Machine IP address is 172.16.249.100 Gateway: 172.16.249.2

In this way, the VM <---> can communicate with the host.

But the Virtual Machine <---> cannot communicate with the Internet

Tip: the host-only technology is only used for mutual access between hosts and virtual machines.

In addition, the Bridge Mode host and the virtual machine are in the same network segment, while Nat is in two different network segments.

 

 

 

 

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.