Vmwarevm cannot access the Internet.

Source: Internet
Author: User

Bridged (Bridge Mode ),
NAT (network address translation mode)
Host-only (host mode ).
Theoretical Understanding:
1. bridged (Bridging Mode)
In this mode, a virtual machine is equivalent to a physical host in the network. You can manually set an IP address, subnet mask, and DNS. The IP address must be in the same network segment as the host IP address. In this way, the VM and the host are connected to two computers on the same HUB. As long as the host can access the Internet, the VM will also access the Internet in this mode.
2. host-only (host Mode)
In host-only mode, all virtual systems can communicate with each other, but the virtual system and the real network are isolated.
Tip: in host-only mode, the virtual system and the host machine system can communicate with each other, equivalent to the two machines connected through twisted pair wires. The virtual network is interconnected and does not communicate with other non-host computers.
In host-only mode, the TCP/IP configuration information of the virtual system (such as the IP address, gateway address, and DNS server) is) DHCP servers in the virtual network are dynamically allocated. However, if you manually set the virtual machine in the same network segment as the host machine, you can access the Internet.
If you want to use VMWare to create a virtual system isolated from other machines in the network and perform some special network debugging, you can select the host-only mode.
3. NAT (network address translation mode)
The NAT mode enables the virtual system to use the NAT (Network Address Translation) function to access the public network through the network of the host machine. That is to say, you can use the NAT mode to access the Internet in a virtual system. In NAT mode, the TCP/IP configuration information of the virtual system is provided by the DHCP server of the VMnet8 (NAT) Virtual Network and cannot be modified manually, therefore, the virtual system cannot communicate with other real hosts in the local area network. The biggest advantage of using the NAT mode is that it is very easy for the virtual system to access the Internet. You do not need to configure any other configurations, but only need the host machine to access the Internet.
If you want to use VMWare to install a new virtual system, you can directly access the Internet without manual configuration in the virtual system. We recommend that you use the NAT mode.
Tip: The VMnet8 virtual network mentioned above in NAT mode, the VMnet1 Virtual Network in host-only mode, and the VMnet0 Virtual Network in bridged mode, they are all generated based on the automatic configuration of the vmwarevm and do not need to be set by the user. VMnet8 and
VMnet1 provides the DHCP service, while VMnet0 does not.
Practical Understanding:
Three network connection settings for vmware:
1. bridge:
Vmnet0 is used by default.
Set the ip address of the Virtual Machine and the ip address of the host in the same network segment, and the rest are the same as those of the Host:
For example, if the host ip address is 192.168.2.46, set the Virtual Machine ip address to 192.168.2.254. Netmask, broadcast, gateway, and dns are all the same as the host to implement Internet communication between Vm instances.
2. nat:
Vmnet8 is used by default.
DHCP: DHCP is used by default.
As long as the physical function is connected to the network, the virtual machine can be connected.
Manual settings:
(This is very important. You need to open the vmnet8 attribute under the Network attribute of the physical machine and view its default address. But do not change it.) set the IP address to the same network segment as vmnet8. set the gateway to the gateway (xxx. xxx. in xxx.2), you can find the vmnet8 gateway, usually edit-> virtual network setting-> Host Virtual Network Mapping, find VMNET8, click the icon on the left arrow, and select NAT, you can see that Gateway netmask, broadcast is set the same as vmnet8, and dns is set the same as host. (DNS saving is also acceptable. It will automatically make the Gateway Switch resolution)
For example, vmnet8 ip: 192.168.187.1 gw: 192.168.187.1.2 is the default value of the system and cannot be changed.
Virtual Machine Settings: ip: 192.168.187.254 gw: 192.168.187.1.2 dns is empty) or: 202.102.224.68 (in fact,
Think about it. In fact, this setting is the same as DHCP allocation. It makes no difference)
3. host-only:
Vmnet1 is used by default.
DHCP: DHCP is used by default.
Constitute an independent virtual network isolated from the physical network
But one thing is that it can communicate with the host machine.
Of course, you can manually specify the IP address, but you must select the IP address of VMNET1 as the network header.
Details:
The host-only mode is an independent host mode, which means it cannot communicate with the outside world. However, we can understand that this mode uses vmnet1, which is a virtual switch. Cause Analysis of non-Internet access: the virtual machine itself is an IP address allocated based on its own DHCP, and the physical machine itself is not in the same segment. You have to ask, if you manually allocate the IP address in the physical machine segment and the same DNS resolution, isn't it enough ?? But it is impossible to tell everyone that. The sharing and IP address translation modes without bridging or NAT cannot be connected (this is my personal understanding .) Is it impossible to access the Internet?
You can see it.
Internet access:
1. Set the sharing of vmnet1 on the local connection of the physical host (it must be vmnet1. Why don't I say it? ^_^) so that the IP address connected to vmnet1 becomes 192.168.0.1, this is the same as our physical server's shared connections.
2. manually set the IP address in the same segment as the physical machine, and the same DNS resolution (or the IP address of the physical HOST). The Gateway is set to 192.168.0.1 For example: HOST (VMNET1 ): 192.168.0.1 NETMASK 255.255.255.0
GUEST: 192.168.0.2 NETMASK 255.255.255.0 DNS 192.168.0.1
To put it bluntly, we only use virtual machines as physical machines for shared network settings.

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.