Three types of network connection modes in Linux

Source: Internet
Author: User

Several ways to access Linux online under VMware virtual machines
The host is the WindowsXP system, and the Linux operating system is installed in the VMware virtual machine. After VMware is installed, there are two new connections in the host's network connection, the VMware network Adapter VMnet1 and the VMware Network Adapter VMnet8. The system installed in the virtual machine is connected by these two virtual network cards. Similar antiarp firewall on the host must be turned off or the virtual machine cannot surf the internet.

There are several options to follow:
1, bridged (bridge) mode:
If the host is connected via LAN, the virtual machine can use the same settings as the host network segment, Gateway and DNS, and choose a valid LAN IP.

Bridging mode enables virtual machines <---> Host virtual machines <----> Internet communications (Hosts and VMS can be seen as two machines on the same LAN). However, bridging requires a separate IP address that differs from the original machine, which is difficult to do in some cases (IP and Mac bindings, network management does not agree). And the host unplug the network cable, the virtual machine can not communicate with the host over the Internet way. And the latter few do not have this problem. So we don't use bridging.

2. Nat Mode:
Using the NAT and DHCP services provided by VMware, the virtual machine uses the virtual NIC VMnet8 in the host as the gateway, and the TCP/IP settings follow the DHCP and NAT settings for VMNET8 in the program. such as IP must be between its DHCP settings StartIP and ENDIP, the gateway needs to use its NAT settings for the Gateway IP.
Nat means virtual machine <---> host communication, but virtual machine---> Internet is only able to access the Internet by virtual machine, but if you want to use the virtual machine as a server, Internet access is not allowed.
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:
By default, Vmnet1 is used to set the virtual machine IP settings to the same network segment as the VMNET1, the gateway is set to Vmnet1 IP, the rest is the same as the VMNET1, and the DNS settings are the same as the host
For example Vmnet1 ip:192.168.101.1
Virtual machine settings: ip:192.168.101.100 gateway:192.168.101.1
This enables virtual machine <---> host communication, but virtual machines <---> The Internet is still unable to communicate.

4. How to share the Internet connection of the host(If the host is a Win98 system may not be applicable):
Share an Internet connection on the advanced level of the local Area Connection property of the host. If you choose the VMNET1 virtual network card, then the Ethernet settings in VMware need to choose Host-only, if you choose VMnet8, then the Ethernet setting requires NAT. After you share the connection, The selected virtual network card IP will default to be set to 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 as a different network segment IP, such as 192.168.1.1) the virtual machine inside can be the virtual network card as a gateway to the Internet 。 is actually a simple route NAT, so the NAT mode is not discussed, we only take host-only as an example.
Shared host-only mode enables virtual machine <---> host communication, but virtual machine---> Internet is only able to access the Internet by virtual machines, but if you want to use the virtual machine as a server for Internet access, it is not possible.

Summarize:

Share connection mode and NAT mode, can realize virtual machine <---> host, virtual Machine---> Internet communication, Nat mode is easy to set up, and can access multiple physical network card simultaneously.
Bridging mode enables virtual machines <---> Host virtual machines <----> Internet communication, which is only possible if the virtual machine is a server. However, a separate IP is required for the virtual machine, and if the physical network card is disconnected, the virtual machine and the host cannot connect.
The Host-only method only implements virtual machine <---> host communication, which is generally not used alone.

Three types of network connection modes in Linux

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.