Several ways of Linux Internet access under VMware virtual machines __linux

Source: Internet
Author: User
Several ways of Linux Internet access under VMware virtual machines
Host installs the Linux operating system for Windows XP, VMware virtual machines. After installing VMware, there are two new connections in the host's network connection, that is, VMware network Adapter VMnet1 and VMware network Adapter VMnet8 as shown. The system that is installed in the virtual machine relies on these two virtual network cards to network. A similar antiarp firewall on the host must be turned off or the virtual machine will not be able to surf the Internet.

There are several options for this:
1, bridged (Network Bridge) way:
If the host is connected through the LAN, the virtual machine can use the same settings as the host network segment, Gateway and DNS, and choose an effective LAN IP.

Bridging way can realize virtual machine <---> Host virtual machine <----> Internet communication (Host and virtual machine can be regarded as two machines of the same LAN). However, bridging requires a different independent IP address from the original computer, which is difficult to do in some cases (IP and Mac bindings, network management Disagree). And after the host unplug the network cable, the virtual machine is unable to communicate with the host over the Internet. And the following few do not have this problem. So the bridging method is not used very much.

2, Nat mode:
Using the NAT and DHCP service provided by VMware, the virtual machine uses the virtual network card VMNET8 in the host as the gateway, and TCP/IP settings follow the DHCP and NAT settings for VMNET8 in the program. If the IP must be between the StartIP and EndIP of its DHCP settings, the gateway needs to use the gateway IP set by its NAT.
NAT can implement virtual machine <---> host communication, but the virtual machine---> Internet is only able to access the Internet virtual machine, but if you want to use the virtual machine as a server, let the Internet access, can not.
However, if you have more than one network card, the virtual machine can access multiple network cards connected to the Internet without changing the settings.

3.host-only Way:
The default use of Vmnet1, the virtual machine IP settings and Vmnet1 with the network segment, gateway set to Vmnet1 IP, the remaining settings and vmnet1 the same, DNS settings and host the same
such as Vmnet1 ip:192.168.101.1
Virtual machine settings: ip:192.168.101.100 gateway:192.168.101.1
This enables the virtual machine <---> host communication, but the virtual machine <---> The Internet is still unable to communicate.

4, the way to share the host's Internet connection(If the host is a Win98 system may not be applicable):
Share an Internet connection in the advanced level of the host's local Area Connection attribute. If the VMNET1 virtual network card is selected, the Ethernet setting for VMware is host-only, and if VMnet8 is selected, NAT is required for Ethernet settings. After sharing the connection, The selected virtual network card IP will be set to the default 192.168.0.1 (if the host is also through the LAN 192.168.0.1 gateway to the Internet, you need to set this virtual network card to different IP, such as 192.168.1.1) at this time the virtual machine can be used as a gateway to the Internet 。 is actually a simple route NAT, so the NAT approach is not discussed, we only take host-only as an example.
Shared Host-only way to implement virtual machine <---> host communication, but the virtual machine---> Internet is only able to access the Internet virtual machine, but if you want to use the virtual machine as a server, so that Internet access, can not.

Summarize:

Shared connection mode and Nat way, can realize virtual machine <---> host, virtual Machine---> Internet communication, Nat way set simple, and can access multiple physical network card simultaneously.
Bridging mode can implement virtual machine <---> Host virtual machine <----> Internet communication, if the virtual machine as a server, only this way feasible. But the independent IP to the virtual machine, and if the physical network card connection disconnect, virtual machine and host can not connect.
Host-only mode only implements the virtual machine <---> host communication, which is not used alone.

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.