The Linux System in VMware10 uses the NAT network connection method to access the internet configuration.

Source: Internet
Author: User

The Linux System in VMware10 uses the NAT network connection method to access the internet configuration.

I. Description

Three Common network connection methods are provided in VMware10:

1. Bridge: This method is the simplest. It connects the virtual network card to a physical network card. It is similar to binding two different addresses to the next network card in linux. In fact, it sets the network card to the hybrid mode, this allows you to listen on multiple IP addresses.

In this mode, the network card (for example, eth0 in linux) inside the virtual machine is directly connected to the network where our real physical network card is located, which is equivalent to the peer status of the Virtual Machine and the real host, the network relationship is equal, and no one is behind it. This method is easy to use, provided that you have more than one IP address, which is not suitable for use.

2. nat: In this mode, a virtual Nic vmnet8 (by default) appears inside the host. This vmnet8 is equivalent to the NIC connected to the Intranet, the Virtual Machine itself is equivalent to a machine running on the Intranet. The network adapter (eth0) in the virtual machine is independent of vmnet8.

In this way, the dhcp service provided by vmware is loaded to the vmnet8 interface by default, so that the virtual machine can use the dhcp service and the nat service is provided by vmware, it provides address translation from vmnet8 to the Internet. In this case, a real nat server is running, but only for virtual machines. It is applicable to scenarios where only one Internet address is available.

3. hostonly: This method is the most flexible. The only difference with nat is that there is no address translation service in this method. Therefore, by default, virtual machines and hosts access each other. By default, a dhcp service is also loaded to vmnet1. you only need to configure the vmnet1 Nic.

2. access the Internet through NAT connection

Step 1: Open the network sharing center and configure the network parameters of vmnet8

Click VMnet8 and click Properties. The following dialog box is displayed:

Select the IPV4 protocol and click Properties to configure the corresponding IP address and subnet mask. You can configure any network segment here, and then click OK.

Step 2: view the specific IP address of the windows host and start --> cmd ---> enter ipconfig in the command line window

Here, the network parameter of VMnet8 is set as above: IP: 192.168.200.1 mask: 255.255.255.0

Step 3: configure network parameters in VMware. In the menu bar of VMware, click "edit" and select "Virtual Network Editor". In the displayed dialog box, configure the following parameters:

Click the NAT Settings button on the right. In the displayed dialog box, set the network. The subnet must be in the same network segment as the VMnet8 IP address on the windows host, that is, the 192.168.200.0 network segment.

The gateway can select any IP address of VMnet8 in the same CIDR block on a windows host, and then click OK.

Step 4: Open the host in VMware and configure the IP address of the virtual machine. You can use the command line or graphical interface to configure the static IP address.

 

The path to the configuration file is:/etc/sysconfig/network-scripts/ifcfg-eth0 file, which is modified as follows using the vi Editor:

[tong@tong ~]$ cd /etc/sysconfig/network-scripts/[tong@tong network-scripts]$ vi ifcfg-eth0DEVICE=eth0TYPE=EthernetUUID=6b218dfa-ff8e-4455-be44-ffdfd95ccefbONBOOT=yesNM_CONTROLLED=yesIPADDR=192.168.200.5BOOTPROTO=noneNETMASK=255.255.255.0GATEWAY=192.168.200.2PREFIX=24DEFROUTE=yesIPV4_FAILURE_FATAL=yesIPV6INIT=noNAME="System eth0"HWADDR=00:0C:29:85:FC:09DNS1=192.168.1.1LAST_CONNECT=1428687041

The main configuration is as follows:

IPADDR = 192.168.200.5 // the IP address and VMnet8 IP address are in the same network segment NETMASK = 255.255.255.0 // subnet mask GATEWAY = 192.168.200.2 // GATEWAY select your GATEWAY address in the WMware network editor DNS1 = 192.168.1.1 // the IP address of the primary DNS server is the real gateway of the host in windows.

 

Related Article

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.