Configure Linux Internet access in VMware

Source: Internet
Author: User

As we all know, Linux systems under virtual machines have three ways to access the Internet: Host-only, bridged, and Nat. Here I will only introduce the two Internet access methods host-only and bridged, that is, their network model:

We can see that the bridged virtual machine is the same as the physical Windows machine. The white computer on the right of the figure represents another computer (LAN or Internet PC ), therefore, to allow the virtual machine to access other machines, its IP address must be set to the same network segment as the physical machine. For example, if the IP address of the Windows machine on which the virtual machine is installed is 10.10.10.4, the subnet mask is 255.255.255.0 and the gateway is 192.168.0.1. Therefore, the IP address of the VM must be set to 10.10.10.xx (XX represents any number in 0-255). The subnet mask and gateway are the same as those of the physical machine.

However, there is a drawback in the bridged connection mode: if the network of a Windows physical machine is interrupted (for example, the network cable is not connected), it is certain that the virtual machine cannot access other physical computers, but what is even more incredible here is that virtual machines cannot access the Windows physical machines. Simply put, if one is disconnected (marked with red forks ), it is equivalent to two disconnections (marked with red forks ).

Therefore, if you need to access other machines on the LAN, we recommend that you use bridged to access the Internet.

Next, we will focus on the host-only method for accessing the Internet, as shown in its networking model. Host-only is equivalent to a virtual network card. You can view the virtual network card on a Windows machine, as shown in the following figure: Network neighbors-> View network connection interface:

We can see that the two virtual NICs vmnet1 and vmnet8 appear above. Host-only is used for vmnet1 Internet access, and vmnet8 is a NAT network connection.

To use host-only to access the Internet, you need to make the following settings: Right-click Local Connection> Properties> advanced, and set to allow other network computers to connect to this network. If set, OK:


In addition, the setting rule of the virtual system IP address must be set to 192.168.0.xx (XX represents any number in 0-), and The subnet mask is set to the same as that of the Windows physical machine, the gateway of the virtual system is 192.168.0.1, And the DNS of the virtual system is the same as that of the Windows physical machine.

The last step is to set the virtual network Editor (the VMware software opens the virtual network editor under the Program). The settings are as follows:

 

OK, the host-only method can be used to access the Internet through the above settings. However, whether the host-only method is connected or not, it cannot access other computers in the LAN, if you want to use the virtual Linux System for separate development, you can use host-only to meet the requirements. However, if you want to communicate with local networks or other Internet computers, host-only is not feasible, in this way, you must use the bridged method.

Now let's talk about this. We will not introduce the NAT method. You can try it out. The time is in a rush. It is inevitable that there will be errors in the article. I hope you can point it out.

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.