How to keep VMWare virtual machine's IP the same in NAT mode

What is NAT?

NAT (Net Address Translation) is the process of converting an IP address to another IP address.

In practical applications, NAT is mainly used to realize the function of private network accessing public network. This approach of using fewer public IP addresses to represent more private IP addresses will help slow the depletion of available IP address space.

 

NAT port mapping function:

Access the virtual machine directly through the intranet IP of the external network or the local area network, such as SSH and Apache.

 

How to keep VMWare virtual machine's IP the same in NAT mode

 

After using NAT mode, it is found that the guest's IP often changes

 

1. The VMware network connection selects the NAT method. 

2. Check VMnet8 in the NAT item in VMware network settings, and the NAT gateway is set to 192.168.X.2. 

 

3. In Windows, check all network connections, you should find that in addition to the original network card, there are more Vmnet1 and Vmnet8. vmnet1 is the hostonly interface, and Vmnet8 is the NAT network interface we want to use. 

 

4. Use ipconfig to view the IP address of VMnet8 on the Windows host, usually 192.168.X.1. At this time, the setting of VMnet8 should be to automatically obtain IP, and now it is changed to static IP, and this IP is directly filled in VMnet8 without gateway. 

6. Under linux, set the network card IP gateway to 192.168.X.2 and the subnet mask to 255.255.255.0 

7. Under linux, set the gateway to the IP 192.168.X.2 just checked. 

 

8. Set DNS to 192.168.X.2 under linux 

9. Run the command service network restart under linux to restart the linux network service.

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326654395&siteId=291194637
Recommended