Linux network settings in VMware Workstation Environment

Source: Internet
Author: User

Linux network settings in VMware Workstation Environment
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. Simply put: The Bridge Mode directly adds a virtual machine to the LAN, so that the virtual machine looks like a real computer in the network, there is no nominal subordination between the virtual network card and the host physical network card, therefore, redundant IP addresses in the LAN are required to be provided to the Virtual Machine Nic. If a fixed IP address is strictly assigned to each computer in the LAN, the Bridge mode will basically fail. For example, if you want to mount a Network File System, but we are installing a linux system on a vmvm in windows, you can use this method! In Bridge Mode, virtual machines can access the Internet or communicate with other real computers in the LAN. In NAT mode, the host's physical Nic acts as a router or switch, at this time, VMware will provide many Subset IP addresses for virtual machines to use based on the real IP address of the host. In this way, all virtual machines access the Internet through the network port of the host, however, it seems that these virtual computers are legally accessing the LAN or the Internet, because their IP addresses seem legal after NAT technology. 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. VM Virtual NICs can be set to the above three network connection modes. By default, VMnet0 is set to the Bridge mode, and VMnet1 is set to the Host Only mode, the default connection mode of VMnet8 is NAT. 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. After understanding how the virtual network card connects to the network, you need to actually connect to the network. Select a simple Internet Connection mode, that is, NAT mode. First, set "Network Connection" to NAT mode in "Virtual Machine Settings" (SEE ). Open "network and sharing center" in Win7 and select "Change adapter Settings". If VMware workstation is correctly installed, You can see VMnet1 and VMnet8. Check the properties of local connections with broadband connections. By the way, under the Network tab, select "Use the following items for this connection", and select VMware Bridge Protocol, this protocol can be used later when the Bridge mode is used. On the "share" tab, select "allow other network users to connect to (N) through the Internet connection of this computer" in "Internet Connection Sharing) select VMnet8. In this way, the network access permission of the host computer is shared with vmnet8. 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.