Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Three networking methods and principles of VMware virtual machine (summary)

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Brigde-- bridging: VMnet0 is used by default

1. Principle:

"Bridge Bridge" is a host, this machine has two network cards, one in two local area networks, at the same time on the "bridge", running programs, so that all packets in LAN A flow into B intact, and vice versa. In this way, LAN An and B are seamlessly connected in the link layer. When bridging, the VMWare network card and the physical network card should be in the same IP network segment, of course, to ensure that the two Lans are free of conflicting IP.

The same is true of VMWare's bridge, except that a network card originally used as hardware is now virtual by VMWare software! When bridging is used, VMWare will bridge a virtual network card with a real physical network card, so that all packets sent to the physical network card will go to the VMWare virtual machine, and the packets sent by VMWare will be sent from the other end of the physical network card through the bridge.

Therefore, if the physical network card can access the Internet, then there is no problem with the bridged soft network card, which is the principle of bridging the Internet.

2. Networking mode:

This kind of networking is the simplest, in the local area network, how your host is connected to the network, how you connect to the network in the virtual machine. Just think of the virtual machine as another computer in the LAN!

Tip: the host network card is in a local area network that can access Internet, so the virtual machine can access Internet through Bridge.

2. NAT-- network address translation: VMnet8 is used by default

1. Principle:

NAT is the abbreviation of Network address translate. NAT technology is applied to internet gateways and routers. For example, if the address 192.168.0.123 is to access internet, its packets must pass through a gateway or router, and the gateway or router has an ip address that can access internet. When sending and receiving packets, such gateways and routers should change the IP protocol layer data of packets (that is, NAT), so that hosts in private network segments can access internet smoothly. This technology solves the problem of scarcity of IP addresses. The same private IP can access the Internet through the gateway NAT.

The same is true of VMWare's NAT, which forges a network card with software between the host and the virtual machine, which is in the same address range as the ip of the virtual machine. At the same time, NAT is carried out between the network card and the network interface of the host. Every packet sent by the virtual machine passes through the virtual network card, then NAT, and then sent out by the interface of the host.

The virtual network card and the virtual machine are in the same address segment, the virtual machine and the host are in a different address segment, and the host is equivalent to the gateway of the virtual machine, so the virtual function ping to the IP of the host, but the host ping can not reach the IP of the virtual machine.

2. Networking mode:

Method 1. Dynamic IP address.

It doesn't matter whether the host is static IP or dynamic IP. Set the virtual machine to access the Internet in DHCP mode, select "automatically obtain IP" under Windows, and enable DHCP service under linux. (this method is the simplest and does not require too many settings, but to "edit → virtual network settings" in VMware, turn on both NAT and DHCP. General NAT is on by default, DHCP is off by default)

Method 2. Static IP address.

If you do not want to use DHCP, you can also set it manually:

The IP setting is the same as the vmnet1 network segment, and the gateway is set as the vmnet8 gateway (Gateway can be found in the Net tab in "Virtual Network Settings") is usually xxx.xxx.xxx.2.

The subnet mask setting is the same as that of VMnet8 (after setting the IP address, the subnet mask is automatically generated)

The DNS settings are the same as the host.

For example, the host IP is 10.70.54.31 and the virtual machine IP is 10.70.54.22. Netmask,Gateway,DNS is the same as the host to achieve virtual machine-host virtual machine Internet communication.

Tip: using NAT technology, the host can access the Internet, the virtual machine can access the Internet, but the host can not access the virtual machine.

3. Host-Only-- VPC shared host: VMnet1 is used by default

1. Principle:

What is provided is the network exchange between the host and the virtual machine. If you only want to have data exchange between the virtual machine and the host, and do not want the virtual machine to access the Internet, you should use this setting.

Under the condition of Host-only, VMWare establishes a soft network card in the real Windows system. This network card can be seen in the network connection, usually VMNET1. The function of this network card is to make Windows see the IP of the virtual machine.

2. Networking method:

Method 1. Dynamic IP address.

When DHCP is enabled as above, the virtual machine automatically acquires the IP address and DNS directly. You can connect to the mainframe. Of course, there are also some LAN sharing operations, which will not be repeated here.

Method 2. Static IP address.

It can also be set manually to set the virtual machine IP setting to the same network segment as VMnet1, the gateway set to the same gateway as VMnet1, the other settings to be the same as VMnet1, and the DNS setting to be the same as host.

For example: VMnet1 IP:172.16.249.1 Gateway: 172.16.249.2

So virtual machine IP:172.16.249.100 Gateway: 172.16.249.2

In this way, the virtual machine host can communicate

However, the virtual machine Internet cannot communicate

Tip: Host-only technology is only used for the exchange of visits between hosts and virtual machines, and has nothing to do with accessing internet.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report