WMware Linux System Connection Network

Source: Internet
Author: User

Recently because of learning to try to install Linux open source operating system, of course, installed in the virtual machine environment, the choice of distribution is CentOS (Community Enterprise Operating system). Accustomed to Windows, the initial use or struggling, the first problem encountered is that the installation of the Linux operating system is not connected to the Internet. The following is a summary of the process of solving this problem, because bloggers know little about the knowledge of network technology, the following about the principle of the introduction of personal understanding, the focus is to solve the actual problems encountered.

let's start by introducing 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.

650) this.width=650; "src=" http://image.sciencenet.cn/home/0927131uf7mueera0aym9u.jpg "alt=" Win7+vmware <wbr Centos-linux Network connection settings (GO) "title=" in the >workstation environment <wbr>workstation network connection Settings (GO) in Win7+vmware centos-linux environment style= "margin:0px;padding:0px;border:0px none;list-style:none;"/>

Figure 1 Three ways to connect a VMware network adapter

For the differences between the three modes, you can refer to the Sophiawangthis blog post (http://blog.csdn.net/sophiawang/article/details/3963613), this article also cites several of these (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. Host only modevirtual 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.

650) this.width=650; "src=" Http://image.sciencenet.cn/home/0922011wgjtnnjg67n75rp.gif "alt=" Win7+vmware <wbr Centos-linux Network connection settings (GO) "title=" in the >workstation environment <wbr>workstation network connection Settings (GO) in Win7+vmware centos-linux environment style= "margin:0px;padding:0px;border:0px none;list-style:none;"/>

Figure 2 Bridging (bridge) mode (quoted from Sophiawang)

650) this.width=650; "src=" Http://image.sciencenet.cn/home/092356cszojez4oce5553c.gif "alt=" Win7+vmware <wbr Centos-linux Network connection settings (GO) "title=" in the >workstation environment <wbr>workstation network connection Settings (GO) in Win7+vmware centos-linux environment style= "margin:0px;padding:0px;border:0px none;list-style:none;"/>

Figure 3 Network address translation (NAT) mode ( quoted Sophiawang)

650) this.width=650; "src=" Http://image.sciencenet.cn/home/092457el95hbabrvbhep9w.gif "alt=" Win7+vmware <wbr Centos-linux Network connection settings (GO) "title=" in the >workstation environment <wbr>workstation network connection Settings (GO) in Win7+vmware centos-linux environment style= "margin:0px;padding:0px;border:0px none;list-style:none;"/>


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.

650) this.width=650; "src=" http://image.sciencenet.cn/home/102614cwoswz06w1o4cvlc.jpg "alt=" Win7+vmware <wbr Centos-linux Network connection settings (GO) "title=" in the >workstation environment <wbr>workstation network connection Settings (GO) in Win7+vmware centos-linux environment style= "margin:0px;padding:0px;border:0px none;list-style:none;"/>


after understanding 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.

650) this.width=650; "src=" http://image.sciencenet.cn/home/104548t2obheg2totoohtb.jpg "alt=" Win7+vmware <wbr Centos-linux Network connection settings (GO) "title=" in the >workstation environment <wbr>workstation network connection Settings (GO) in Win7+vmware centos-linux environment style= "margin:0px;padding:0px;border:0px none;list-style:none;"/>

Figure 6 VMnet1 and VMnet8 are visible in the network connection

650) this.width=650; "src=" http://image.sciencenet.cn/home/105722qzryp9rjyz77pdc4.jpg "alt=" Win7+vmware <wbr Centos-linux Network connection settings (GO) "title=" in the >workstation environment <wbr>workstation network connection Settings (GO) in Win7+vmware centos-linux environment style= "margin:0px;padding:0px;border:0px none;list-style:none;"/>

Figure 7 Setting up a network share

This connection uses the following items

650) this.width=650; "src=" http://image.sciencenet.cn/home/111353ywmpphyhqcpwh1o7.jpg "alt=" Win7+vmware <wbr Centos-linux Network connection settings (GO) "title=" in the >workstation environment <wbr>workstation network connection Settings (GO) in Win7+vmware centos-linux environment style= "margin:0px;padding:0px;border:0px none;list-style:none;"/>

Figure 8 Tcp/ipv4 Property in VMnet8

Next you need to configure VMNET8 's I in the VM P attribute. 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.


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-> The Bootproto in Ifcfg-eth0 is not DHCP, and if not, modify it to DHCP and then use the command service network restart to restart the network connection to 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.