1. Brigde——Bridge: VMnet0 is used by default 1. Principle: Bridge is a host machine with two network cards, which are in two LANs respectively. At the same time, a program is running on the "bridge" to allow all data packets in LAN A to flow into B intact, and vice versa. In this way, LAN A and B are seamlessly connected at the link layer. When bridging, the VMWare network card and the physical network card should be in the same IP segment. Of course, it is necessary to ensure that there are no conflicting IPs in the two LANs. The same is true for VMWare's bridge, except that the network card, which was originally a hardware, is now virtualized by VMWare software! When using bridging, VMWare will virtualize a network card and bridge it with the real physical network card. In this way, all data packets sent to the physical network card will reach the VMWare virtual machine, and the data packets sent by VMWare will also 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 will be no problem with the bridged soft network card. This is the principle of bridged Internet access. 2. Networking method: This is the simplest way to connect to the Internet. In a local area network, you can connect to the Internet in the virtual machine in the same way as your host. Just think of the virtual machine as another computer in the local area network! Tip: The host network card is in a local area network that can access the Internet, so that the virtual machine can access the 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 wants to access the Internet, its data packets must pass through a gateway or router. The gateway or router has an IP address that can access the Internet. Such gateways and routers must change the IP protocol layer data of the data packet when sending and receiving data packets (i.e. NAT) to enable hosts in the private network segment to access the Internet smoothly. This technology solves the problem of scarce IP addresses. The same private IP can access the Internet through gateway NAT. The same principle applies to VMWare's NAT Internet access. It uses software to forge a network card between the host and the virtual machine. This network card and the virtual machine's IP are in the same address segment. At the same time, NAT is performed between this network card and the host's network interface. Every data packet sent by the virtual machine will pass through the virtual network card, then NAT, and then be sent out by the host interface. The virtual network card and the virtual machine are in the same address segment, but the virtual machine and the host are in different address segments. The host is equivalent to the gateway of the virtual machine, so the virtual machine can ping the host's IP, but the host cannot ping the virtual machine's IP. 2. Networking method: Method 1: Dynamic IP address. It doesn't matter whether the host has a static IP or a dynamic IP. Set the virtual machine to access the Internet using DHCP. Select "Automatically obtain IP" in Windows and enable the DHCP service in Linux. (This method is the simplest and does not require too much configuration, but you need to go to "Edit → Virtual Network Settings" in VMware and turn on both NAT and DHCP. Generally, NAT is turned on by default and DHCP is turned off by default) Method 2: Static IP address. If you don't want to use DHCP, you can also set it manually: The IP setting is in the same network segment as vmnet1, and the gateway is set to the gateway of vmnet8 (Gateway can be found in the Net tab in "Virtual Network Settings"), usually xxx.xxx.xxx.2. The subnet mask setting is the same as VMnet8 (after setting the IP address, the subnet mask is automatically generated) DNS settings are the same as the host. For example: the host IP is 10.70.54.31, set the virtual machine IP to 10.70.54.22. Netmask, Gateway, and DNS are all the same as those of the host to achieve virtual machine-host virtual machine <----> Internet communication. Tip: Using NAT technology, if the host can access the Internet, the virtual machine can access the Internet, but the host cannot access the virtual machine. 3. Host-Only - Private network shared host: VMnet1 is used by default 1. Principle: It provides network access between the host and virtual machines. This setting is suitable if you only want to allow data exchange between the virtual machine and the host, but do not want the virtual machine to access the Internet. Under the host-only condition, VMWare creates 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 enable Windows to see the IP of the virtual machine. 2. Networking method: Method 1: Dynamic IP address. After turning on DHCP as above, the virtual machine automatically obtains the IP address and DNS. It can be connected to the host. Of course, some LAN sharing operations need to be performed, which will not be repeated here. Method 2: Static IP address. You can also set it manually, set the virtual machine IP to the same network segment as VMnet1, set the gateway to the same as VMnet1's gateway, and the rest of the settings to be the same as VMnet1, and the DNS settings to be the same as the host. For example: VMnet1 IP:172.16.249.1 Gateway:172.16.249.2 Then the virtual machine IP: 172.16.249.100 Gateway: 172.16.249.2 In this way, the virtual machine <---> host can communicate, but the virtual machine <---> Internet cannot communicate. Tip: Host-only technology is only used for mutual access between the host and the virtual machine and has nothing to do with accessing the Internet. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Javascript front-end optimization code
>>: Analysis of Difficulties in Hot Standby of MySQL Database
offset Offset is the offset. Using the offset ser...
Error scenario Use the mysql command in cmd to ad...
Preface Due to the weak typing of JS, loose writi...
Table of contents 1. RegExp object 2. Grammar 2.1...
1. Create the tomcat installation path mkdir /usr...
Table of contents Select Structure Loop Structure...
Download the redis image docker pull yyyyttttwwww...
1. Configuration By default, the first two are no...
Table of contents Preface Core code File shows pa...
How to define complex components (class component...
After I analyzed the Taobao details page last time...
Table of contents 1. Master-slave replication Mas...
I have written such an article before, but I used...
If you want to adjust the size and number of Inno...
Table of contents Preface NULL in MySQL 2 NULL oc...