Record the communication between the physical machine and the virtual machine in nat mode in vmware once [Save]

Record the communication between the physical machine and the virtual machine in nat mode in vmware

https://blog.csdn.net/qq_31329893/article/details/83511815


The cause of the matter is that I did the openstack experiment of the old boy.

openstack-controller======》The host name is controller as required, ip is 10.0.0.11/24 gw is 10.0.0.2.   

openstack-compute1======》The host name is compute1 as required, ip is 10.0.0.31/24 gw is 10.0.0.2.   

(The teacher on the network uses vmware's nat mode by default)


But in this situation, my two VMs can ping each other, but the communication between the physical machine and the virtual machine in nat mode cannot ping each other, and the two VMs cannot access the external network. According to https://blog.csdn.net/qq_31329893/article/details/83511815

The statement mentioned is to create a nat mapping, but I still can’t do it. The nat I added is as follows:

image.png

image.png



Finally, I found out that I had to modify two things:

The ip of the first VMnet8 network card has to be empty from the original 192.168.26.1 255.255.255.0 gw to 10.0.0.1 255.255.255.0 gw!

In the second place, click "Virtual Network Editor" under Edit: the subnet under the nat network card is changed from 192.168.26.0 255.255.255.0 to 10.0.0.0 255.255.255.0

image.png

image.png


image.png


After the modification is completed, it is found that the physical function can be pinged through 10.0.0.11 and 10.0.0.31 (10.0.0.11 and 10.0.0.31 can also be connected to 10.0.0.1 and 10.0.0.2, and can also be connected to external networks such as Baidu)! And telnet 10.0.0.11 port 22 and telnet 10.0.0.31 port 22 are both connected! [In addition, telnet 10.0.0.11 port 6589 and telnet 10.0.0.31 port 6591 are all unavailable, which shows that the nat has no effect, delete it.] My requirement has been fulfilled, and I can log in to their port 22 through xshell remotely!



The virtual machine nat mode is the communication logic. It is equivalent to that the gateway is the editor of vmware. It has the dhcp function and temporarily uses an ip named .2, which is the gateway ip, which is the gateway!

After that, the vm and the physical machine are equivalent to two computers respectively. You have to be in the same network segment to get through!


image.png


image.png


Guess you like

Origin blog.51cto.com/8189171/2535617