Turn from: http://blog.csdn.net/pang040328/article/details/12427359 First, let's introduce VMware's network connectivity approach. Our host usually through the physical network card and LAN and the Internet connection, and the virtual machine has been called a virtual computer, the virtual network card also must exist, and if we want the virtual computer can connect to the local area network or the Internet, it must be the virtual network card and the host's real physical network card together. VMware provides three ways to bundle virtual and physical network cards-bridge mode, network address translation (transformation, NAT) mode, and host-only mode.
Figure 1 Three ways to connect a VMware network adapter
For the differences between the three modes, you can refer to Sophiawang's blog post (http://blog.csdn.net/sophiawang/article/details/3963613), which also refers to several of this article (Figure 2-figure 4). Simply put, bridge mode adds the virtual machine directly to the LAN, so that the virtual machine looks like a real computer in the network, the virtual network card and the host physical network card does not have a nominal affiliation, and therefore need to have redundant IP address within the LAN to provide to the virtual machine network card, If the LAN is strictly assigned to each computer fixed IP, then this bridge mode is basically invalid. In bridge mode, the virtual machine can either access the Internet or communicate with other real computers in the LAN, and the physical NIC hosted in NAT mode acts as a router or switch, and VMware provides many subset IPs for virtual machines based on the host's real IP , so that all virtual machines access the Internet through the host's network ports, but it seems that these virtual machines are legitimately accessing the local area network or the Internet, because their IP addresses appear to be legitimate after the NAT technology. In host only mode, virtual machines can communicate with each other, but virtual machines cannot communicate directly with other real computers in the LAN, but it is possible to access the Internet through the host in this mode.
Figure 2 Bridging (bridge) mode (quoted from Sophiawang)
Figure 3 Network Address translation (NAT) mode (quoted Sophiawang)
Figure 4 Host only mode (quoted Sophiawang)
VM Virtual network card can be set to the above three kinds of network connection mode, by default, VMnet0 is set to bridge mode, VMnet1 is set to host only mode, and VMNET8 default connection mode is NAT mode. Vmnet2-vmnet7 and VMnet9 These seven virtual network card users can be customized, but in all the virtual network card only one block can be set to NAT mode, the default is VMnet8. Users can view this information in the VMware workstation->edit->virtual Network Editor.
Figure 5 Virtual network card and corresponding connection mode in VMware
After knowing how the virtual network card connects to the network, you need to actually connect to the network. Choose a simpler Internet connection, Nat mode, first set "Network Connection" in "Virtual machine Settings" as Nat mode (see Figure 1). Open Win7 's network and Sharing Center, select change adapter settings, and if VMware Workstation is installed correctly, you should see both the VMNET1 and VMNET8 virtual network cards. Check the properties of the local area connection with the broadband connection, and, by the way, check the VMware Bridge protocol in the "This connection uses the following items" under the Network tab to use this protocol later when you choose Bridge mode. On the Share tab, under Internet Connection Sharing, check allow other network users to connect through this computer's Internet connection (N), and select VMnet8 in Home network Connections (H). This sets the network access permissions for the host computer to be shared with VMnet8.
Figure 6 VMnet1 and VMnet8 are visible in the network connection
Figure 7 Setting up a network share
The following need to configure the IP address and mask of the VMnet8. First look at the network properties of the VMnet8, and in the same way, under the Network tab, select the VMware Bridge protocol in the following items for this connection to use in later bridge mode. Viewing the properties of the Tcp/ipv4, you can see that the IP address has been automatically changed to a fixed 192.168.137.1, the subnet mask is already 255.255.255.0, these let it set, for the moment no matter.
Figure 8 Tcp/ipv4 Property in VMnet8
Next you need to configure the IP properties of the VMnet8 in the VM. 5, open the VMware workstation->edit->vmware Network Editor, select VMnet8, tick connect a host virtual Network adapter to this Netwo RK and use the local DHCP service to the distribute IP address to the VMs. The subset IP needs to be in the same address segment as the host VMnet8 IP, and the 192.168.137.0,subset mask should be the same as the VMnet8 subnet mask, that is, fill in the 255.255.255.0. Open the DHCP Settings, the inside of the start IP address fill in the 192.168.137.0,end IP address fill 192.168.137.255, you can automatically assign to the virtual computer IP addresses in this IP segment. In NAT settings, Getway IP is set to the VMnet8 IP in the host computer, which is 192.168.137.1.
The above setting summarizes that the physical network card of the host computer is shared with the VMnet8, VMNET8 acts as a router, and the virtual machines in the VM automatically obtain IP addresses within an IP segment via DHCP, which are all through the router (VMNET8) Connect the IP to the Internet connection on the physical network card.
After setting up this, start the CentOS in VMware, if normal should be able to ping the network, open Xwindow inside the browser should also be able to start surfing. If you are not connected to the Internet, you can log in to CentOS with the root user (other user does not have permission to modify the configuration file), and check the file system->etc->sysconfig->network-scripts-> Ifcfg-eth0 in Bootproto is not DHCP, if not modified to DHCP, also need to set onboot = true; Then use the Command service network restart to restart the network connection, you can connect to the network.
Win7+vmware Centos-linux network Connection settings in the workstation environment