VMware Virtual Machine network mode and virtual machine and physical machine communication methods

Source: Internet
Author: User

VMware Virtual machine software is a "Virtual PC" software that allows you to run two or more windows, DOS, and Linux systems on a single machine, currently VMware offers the industry's most professional virtual machines, and VMware Virtual Machine network card mode is divided into several, below Kai Technology Small series to share with you the VMware Virtual Machine network mode and what mode to use to complete the virtual machine and physical machine communication?

One, virtual machine network card pattern classification

Virtual Machine network card mode, a total of 5, such as the following, this main explanation of the first three, that is, bridge mode, Nat mode, only host mode.

Second, the virtual machine environment

Physical machine System: Win7 flagship edition

Virtual machine system: RedHat6.5

Virtual machine software: VMware Workstation 10 (click to download)

Three, network card introduction

Let's start by talking about several VMware virtual devices

VMNET0: Virtual Switch for virtual bridging network

VMNET1: Virtual Switch for Virtual Host-only network

VMNET8: Virtual Switch for virtual NAT network

VMware Network adepter vmnet1:host Virtual network card for communication with host-only virtual networks

VMware Network adepter vmnet8:host Virtual network card for communication with NAT virtual networks

Where VMnet0, VMnet1, and VMnet8 are virtual switches of the virtual machine itself.

The VMware network Adepter VMnet1 and VMware network Adepter VMnet8 are virtual network cards that are generated after the virtual machine is installed on the physical machine.

Iv. Introduction to the VMware Virtual Machine network model

1. Bridging mode:

Bridging network refers to the local physical network card and the virtual network card bridge through the VMnet0 Virtual switch, the physical network card and the virtual network card on the topological map on the same status (virtual network card is not VMware network Adepter VMNET1 is not vmware network Adepter VMnet8). Bridge mode must use a switch or router to communicate with the outside world, at this time, the virtual machine itself and the physical machine are independent of each other, in the same position, if the virtual machine and the physical computer network card in the same network segment, is able to communicate with each other.

2.NAT mode:

The VMware Network adepter VMnet8 Virtual network card is used in the NAT networks, and the VMware network adepter VMnet8 virtual network card on the host is connected directly to the VMNET8 virtual Switch to communicate with the virtual network card. The VMware network adepter VMnet8 Virtual network card is limited to communicating with the VMNET8 segment, and it does not provide routing capabilities to the VMNET8 segment, so the virtual machine is virtual to a NAT server so that the virtual network card can connect to the Internet. The IP address of the VMware network adepter VMnet8 virtual network card is generated by the system DHCP designation when installing VMware, and we do not modify this value, otherwise the host and the virtual machine will not be able to communicate.

3. Host mode only:

In host-only mode, the virtual network is a fully enclosed network, and the only access to it is the host. In fact, Host-only Network and NAT network is very similar, the difference is that the Host-only network does not have NAT service, so the virtual network can not connect to the Internet. Communication between the host and the virtual machine is achieved through the VMware Network adepter VMnet1 virtual network card.

V. Use "host-only mode" for virtual and physical machines to communicate with each other

1. First edit the VMware network Adepter VMnet1 NIC information for the physical machine.

2. Suppose we currently use addresses within the 192.168.2.0/24 network segment.

3. Locate the corresponding virtual machine and click "Settings" to edit it.

4. Let the network adapter select "Host mode only" and the device status will be connected.

5. Enter the virtual machine system, check the name of the network card (ETH1), must first check the name of the network card and then edit the network card parameter information.

# Setup//According to the diagram, step by step operation.

Create a new network card device.

Edit the ETH1 network card information, same as the VMware Network Adepter VMNET1 within the 192.168.2.0/24 network segment.

7. After editing is complete, save and step out, then perform a restart of the NIC operation.

# Service Network restart//restart NIC

8. Check the network card parameter information, has been set up.

9. Ping the IP you have just set in the physical machine, it can communicate normally.

10. If the NIC parameter is set and restarted, the IP address cannot be found, as follows.

11. Enter the specific network card configuration file, add or modify parameters.

# vim/etc/sysconfig/network-scripts/ifcfg-eth1

PS1: If you do not want to use the graphical interface can also use the command to knock the network card parameters, but after restarting the machine, the IP is lost, only temporary, not written to the configuration file.

# ifconfig eth1 192.168.2.100 netmask 255.255.255.0//Configure IP and subnet masks

* * Route add default GW 192.168.2.1//Set the Defaults gateway

3# vim/etc/resolv.conf//Add DNS

4 nameserver 8.8.8.8

PS2: Why do we use host-only mode to communicate between virtual machines and physical machines, instead of two different ways?

First, the bridge must have a physical switch or router, this condition is not necessarily completely satisfied;

Secondly, the NAT mode is the IP address obtained by DHCP of the virtual machine's own system, not fixed, do experiment inconvenient;

Therefore, the above small series mainly with everyone's focus on sharing the use of "host mode only" way to let the virtual machine and the physical machine communication, I hope we have a reference.

VMware Virtual Machine network mode and virtual machine and physical machine communication methods

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.