Configure the network in the VM Nat Mode

Source: Internet
Author: User

I found many methods on the Internet and found that many methods have problems. The first configuration below can also be used to access the Internet, but the host cannot be pinged to the virtual machine. The virtual machine can be pinged to the host and will occupy the IP address of 192.168.0.1, if the IP address in the company is an email server or another server, the problem may occur. The second method is good, simple, and supports two-way Ping.

Method 1:

1. Check whether the VM Nat is enabled. In the "edit" menu, click "Edit Virtual Network", select the NAT option page, set the host nic "vmnet8", and enable it.

2. Set the VMware network connection mode to Nat.

3. Configure vmnet8 as 192.168.0.1 in the network connection. Subnet 255.255.255.0

4. If you set the local connection to Internet sharing, a problem may occur. The system prompts that Internet Connection Sharing cannot be started. An automatic IP address is required for a LAN connection that has been configured with an IP address. Refer to the online article to solve the problem as follows:

(1) do not use the network segment 192.168.0.1-254 when you set the shared network adapter (nic. For example, I changed it to 192.168.1.92.

(2) Set vmnet8 to 192.168.0.1.

(3) This will solve the problem of "cannot start Internet Connection Sharing when setting Internet Connection Sharing in Windows XP. An automatic IP address is required for a LAN connection that has been configured with an IP address.

(4) After sharing is set, you can change the IP address of nic a to the original address.

 

5. Click the NIC settings of a specific Virtual Machine to set it to Nat.

6. in Linux, choose system> Management> network configuration.

7. Select "device"> "Nic"> "double-click:

8. Select "automatically obtain IP Address" and click OK!
Restart the network service on the terminal:/etc/init. d/network restart,

Check through/sbin/ifconfig. Then you can access the Internet.

 

Method 2:

1. Enable the NAT and DHCP services of the Virtual Machine and set the NIC of the virtual machine to the NAT mode.

2. vmnet8 is automatically obtained by default, and the local connection of the host does not need to be shared.

3. View ipconfig on the command line of the host. The IP address of vmnet8 is 192.168.235.1 (different machines may be different ).

4. In the "edit" menu of the VM, click "Edit Virtual Network" and select the NAT option page. The gateway IP address is 192.168.235.2.

5. In Linux, you can use automatic retrieval or manually specify an IP address. For example, if I specify 192.168.235.128, Gateway: 192.168.235.2, DNS: 192.168.235.2

6. After saving, restart the network service to access the Internet, and ping the host and Virtual Machine in two directions.

 

 

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.