How to connect a virtual machine using nat mode
Step 1: Open VMware Editor and click Virtual Network Editor
Select VMnet8 mode
Click below to change settings
Set the subnet ip, subnet ip arbitrarily set yourself, because it is nat mode, VMware will automatically convert the mapping address, my local address this time is 192.168.0.122, and then I do not want to have duplication with the host, so I set it to 10.168.5.0.
After setting up, set up DHCP, click DHCP to enter the settings
Set your DHCP address range.
Step 2: Set up your VMnet8 virtual network card
Note that this address must be the address of a segment in VMware that you set, and I set it as its gateway here.
The third step is to configure the ip file of the virtual machine. I believe everyone will configure this, so I won't talk about it in detail.
Note: After this configuration, I can ping each other, but one day suddenly I don't know why ping doesn't work. The final modification method is as follows:
At this point open your host computer Internet card, enter the interface as shown below
Follow the diagram, then ping, ping each other.