VMware+Centos can connect to this machine in NAT mode, but cannot connect to the same LAN

Note: When using VMware+Centos using NAT mode, the machine can directly access the network of the centos virtual machine, but the same local area network, that is, other computers under the same wifi cannot connect to the virtual machine network

 

I’m not very familiar with Linux, let’s talk about my personal understanding, because in NAT mode, the centos network is directly associated with the physical host’s network, so the same LAN wants to access this centos virtual machine that uses NAT mode. It should be the ip and port of the physical machine where the virtual machine is accessed,

 

Then there is a question. How can the local IP be associated with the IP and business port on CentOS, and then be accessed by computers in the local area network? This is a good question and also a key question. After thinking and exploring, Finally found a solution

 

Solution: as shown in the figure below

image.png

 

image.png

 

image.png

 

 

image.png

 

image.png

 

 

image.png

 

image.png

Then click OK,

Note: The host port should not conflict with other ports on the host as far as possible

 

After these configurations are completed

 

Computers in the local area network can access this centos virtual machine

Access method: http://ip of the physical host where centos is located: the host port configured on centos/ the address behind remains unchanged

 

http://192.168.74.11:8082/bigdoor/swagger-ui.html

 

Note: If it is local access, you can directly use the ip and port of centos to access directly. If it is access to other computers in the local area network, you must use the ip and port access of the physical machine (provided that the above configuration is passed)

 

Note: The ip address in the above URL is the ip address of the windows computer where the centos virtual machine is located, and the port is the host port configured by centos. The following address remains unchanged, as shown in the figure below. The port in the URL above is the one configured by the arrow in the figure below. port

image.png

Guess you like

Origin blog.csdn.net/qq_39999478/article/details/108917013