Teach you a trick how two computers can access each other's virtual machines in VMware's NAT mode

1. Preparations

Need two computers (I prepared two win10)

VMware virtual machine: [ Official website download ] The system is installed on both win10 computers centos 7(this is centos 7the version here)

Let's get started.

2. Start

2.1 Set NAT mode

Right click on the virtual machine selection 【设置】, find 【网络适配器】the selection【NAT模式】

In the same local area network, the host machine and the virtual machine network in NAT mode can communicate with each other.

insert image description here

2.2 Perform NAT mode setting

choose【虚拟网络编辑器】

insert image description here
After seeing the NAT network mode of VMnet8 selected, click【NAT设置】

insert image description here
Map the host port of the host machine to port 22 of the virtual machine. Of course, the host port can also be other ports, not necessarily 22, 2201 is also possible. But the mapped port of the virtual machine must be 22 .

Just configure multiple virtual machines.

insert image description here

2.3 XShell accesses the virtual machine of the other party

The following is used on another host to XShellaccess the virtual machine on this host.

The host is to fill in the IP of the other host, not the IP of the virtual machine. The port number is the host port number configured above.

insert image description here
Then enter the virtual machine password (this part is omitted) to access normally.

In this way, the intercommunication access between virtual machines in NAT mode is solved. This method is not only applicable to configuration access between accessing virtual machines, but also applicable to mapping access of various ports in virtual machines.

The advantage of this is that there is no need to expose the port number like in bridge mode. You can directly map the host port.

Guess you like

Origin blog.csdn.net/qq_41857955/article/details/130547067