Linux hosts and virtual machine network links

Source: Internet
Author: User

Tag: Configure code host-only to start the local virtual fixed window LAN

Linux host and virtual machine network link 1, network link mode
vmware为我们提供了三种网络工作模式,它们分别是:Bridged(桥接模式)、NAT(网络地址转换模式)、Host-Only(仅主机模式),而Vmware对这三种工作方式分别虚拟出三个网卡(也有人也称之为虚拟交换机),分别是VMnet0(桥接模式)、VMnet1(仅主机模式)、VMnet8(NAT模式)。如所示:仅主机模式的虚拟网卡VMnet1、NAT模式下的虚拟网卡VMnet8、真实的有线网卡、真实的无限网卡,这里会有个问题,为何没有Bridged(桥接模式),因为桥接模式的虚拟机是网络中的一台独立的物理机,在windows下面看不到,但是在vmware的虚拟网络编辑器中可以看到。

    • There is a problem: Vmware0 must correspond to bridging, can be set to net mode?
    • A: VMware Virtual network editor can be set up, but do not know what the use, so do not set to other, to ensure that they one by one corresponding.
2, bridged (bridge) 2.1, what is the bridge mode

1, bridge mode is the host network card and virtual network card VMWARE0 using virtual Bridge to communicate.

2, in the role of bridging, similar to the physical host virtual as a switch, the switch is not only connected to the physical host, all the bridge settings of the virtual machine are connected to an interface of the switch;

3, all the bridge network card and network card are switched mode, mutual access without interference.

4, in the bridge mode, the virtual machine IP address needs to be in the same network segment as the host, if networking is required, the gateway and DNS need to be consistent with the host network card. Its network structure is as follows:

2.1, bridge mode host and virtual machine communication

So since it is bridged, then the host this switch or the host this network card must start up, because the host this switch is a real network card, and the real network card needs to start up must be connected to the LAN via the network cable (wired network card) or through the WiFi link to the local area network (wireless network card), At this point the system will have a connection, both to communicate.

As shown in: The host link is the wireless network, then the host this interactive machine is the starting source is the wireless network card, the wired local connection is not connected to the display.

The following are the setup steps for communication between the host and the wireless network card:

Step one: Set the IP address of the host wireless card

Step two: Start the Virtual network editor, which only Vmware0 bridge to the wireless card

Step three: Set up the network adapter for the VMware software for bridging mode

Note: The above wired network card settings are the same.

There is a problem: The bridge mode is not connected to the network cable is not connected to the wireless network, the host and the virtual machine can communicate?
A: You can communicate, you need to install a new local virtual network connection, see more: https://wenku.baidu.com/view/125be1243c1ec5da50e270c1.html

3. NAT (network address translation)
    • IP resources in the network are extremely valuable, if your network IP resources are scarce, but you want your virtual machine to be able to network, the NAT mode is the best choice. Nat mode enables virtual machines to be networked with virtual NAT devices and virtual DHCP servers. Its network structure is as follows:

3.1, Close and net model summary

1, the NAT mode virtual machine can be directly with the virtual NAT device and virtual DHCP server to the Internet, and this only requires the host can be connected to the network, the path is on the map of the Internet access, this path exists virtual machine IP address.

2. Why do I need the virtual network card vmware network Adapter VMnet8? Our VMware network Adapter VMNET8 virtual network card is primarily designed to enable communication between the host and the virtual machine. is the communication path shown, and this communication path is not the same as the IP address that the host uses to surf the Internet.
So the net pattern has a feature:
A, save the network IP resources and access to the Internet,
B, net mode virtual machines can only communicate with the host, and only with the host's virtual Vmware8 IP.

3. The TCP/IP configuration information of the virtual system in NAT mode is provided by the DHCP server of the VMNET8 (NAT) virtual network and cannot be modified manually, so the virtual system cannot communicate with the other real hosts in the LAN. As shown in the VMware Virtual Editor in NAT mode for the configuration of the virtual machine's TCP/IP assignment, it is possible to produce a virtual machine with TCP/IP assigned randomly in a network segment, not a fixed allocation.

The following setup steps for communicating between the two in NAT mode

Step one: Set the host Vmware8 network card IP address and gateway (here the gateway is more important, be sure to set)

Step two: Start the Virtual network editor, set Vmware8 to net, and set the gateway with the steps to set the gateway consistent

Step three: Set the network adapter for VMware software to net

4, Host-only (host mode only)

Host-only mode is actually NAT mode to remove the virtual NAT device, then use the VMware Network Adapter VMNET1 Virtual network adapter to connect VMNET1 Virtual Switch to communicate with the virtual machine, Host-only mode separates the virtual machine from the outside, Makes the virtual machine a standalone system that communicates with the host only.

So since it is a castrated version of Net mode, its host is consistent with the virtual machine's communication steps.

Step one: Set the host Vmware1 network card IP address and gateway (here the gateway is more important, be sure to set)

Step two: Start the Virtual network editor, set the Vmware1 to host only, and set the gateway with the steps to set the gateway consistent

Step three: Set the VMware Software's network adapter to host only

4.1, host-only to the Internet
    • If you want to host-only the virtual function of the network, we need to share the host network card to the VMware Network Adapter VMNET1 network card, so as to achieve the purpose of virtual machine networking.

Linux hosts and virtual machine network links

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.