In the VMware Workstation environment

Source: Internet
Author: User

In the VMware Workstation environment

(Reproduced From: http://blog.chinaunix.net/uid-20846214-id-3202081.html)

First, we will introduce the network connection mode of VMware. Our host is usually connected to the LAN and Internet through a physical network card. virtual machines are also known as virtual computers, and virtual network cards must exist, if we want the virtual computer to connect to the LAN or Internet, we must make the virtual network card and the real physical network card of the host work together. VMware provides three ways to bind a virtual Network card with a physical Network card: Bridge Mode, Network Address Translation (Network Address Transformation, NAT) mode, and Host) mode. In Host Only mode, virtual machines can communicate with each other, but they cannot communicate directly with other real computers in the LAN. However, in this mode, it is still possible to access the Internet through the Host. The virtual network card of the VM in the Bridge mode to the Network Address Translation (NAT) mode to the Host Only mode can be set to the above three network connection modes. By default, VMnet0 is set to Bridge mode, VMnet1 is set to Host Only mode, and VMnet8 is set to NAT mode by default. The VMnet2-VMnet7 and VMnet9 virtual NICs can be customized, but only one of all the virtual NICs can be set to NAT mode, the default is VMnet8. You can view the information in VMware workstation> Edit> Virtual Network Editor. Configure the VMnet8 IP address and mask. First, check the Network Properties of VMnet8. Also, under the Network tab, select "Use the following items for this connection" and select VMware Bridge Protocol for future use in Bridge Mode. View the properties of TCP/IPv4, and you can see that the IP address has automatically changed to a fixed 192.168.137.1, And the subnet mask is 255.255.255.0. These settings will be ignored for the moment. Next, you need to configure the VMnet8 IP attribute in the VM. 5. Choose VMware workstation> Edit> VMware Network Editor, select VMnet8, and check Connect a host virtual network adapter to this network and Use local DHCP service to distribute IP address to VMs. The Subset IP address must be in the same address segment as the host's VMnet8 IP address. You can enter 192.168.137.0. The Subset Mask must have the same subnet Mask as VMnet8, that is, 255.255.255.0. Open DHCP Settings, enter Start IP address 192.168.137.0, and End IP address 192.168.137.255. Then, the IP address is automatically allocated to the virtual computer in this IP segment. In NAT Settings, set the Getway IPaddress to the VMnet8 IP address of the host computer, that is, 192.168.137.1.

To sum up the above settings, the physical network card of the host computer is shared with VMnet8. VMnet8 acts as a router, and the virtual computer in the VM automatically obtains the IP address within an IP segment through DHCP, these virtual machines are connected to the Internet on the physical network card through the IP address connected to the vrovm( VMnet8.

After these settings, enable CentOS in VMware. If it is normal, you can ping the network, and open the browser in Xwindow to start surfing. If you cannot connect to the Internet, you can use the root user (other users do not have the permission to modify the configuration file) to log on to CentOS, check whether the bootproto in the file system-> etc-> sysconfig-> network-scripts-> ifcfg-eth0 is dhcp. If not, change it to dhcp and then restart the network connection with the Command service network restart, you can connect to the network.

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.