[Linux learning] host can not ping the virtual machine, but it can ping the virtual machine host

Before you want to connect via XShell ubuntu system in a virtual machine, but how are not connected, and then try to ping the virtual machine and found that the host can not communicate with virtual machines, after multiple look after finally found a solution, hereby record for future reference .

Original link: https://blog.csdn.net/ww1473345713/article/details/51490525

1. VM network connection uses a NAT mode

 

 


2. IP uses a virtual machine to automatically obtain.

 

 

 

 

 

 

IP: 192.168.191.130
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.191.2

3. VM host ping, can ping the
host IP address is: 192.168.1.244

 

 

 

4. ping the host virtual machine, request timeout

 

 


5. Analysis
biggest reason may be because the network adapter VMware Network Adapter VMnet8 IP settings wrong, the virtual machine is not in the same IP network segment.
As already viewed the virtual machine's IP, subnet mask and default gateway as follows:

IP: 192.168.191.130
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.191.2


View VMware Network Adapter VMnet8 IP is the number of
press win + R, type cmd to open a command line window, type ipconfig
can see VMware Network Adapter VMnet8 the IP, subnet mask and default gateway:

IP: 192.168.1.25
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.255

 

 

Obviously with the virtual machine's IP is not in the same network segment, we modify the VMware Network Adapter VMnet8 configuration (or can be changed to automatically obtain):

IP: 192.168.191.1
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.191.2

 

 

Try to ping the VM from the host again

 

 

Visible successfully ping the
attempt to connect again Xshell

 

 

connection succeeded!
Problem solved!

Sentence summary: NAT mode, the VMware Network Adapter VMnet8 instead of IP and IP virtual machine the same segment.

 

Guess you like

Origin www.cnblogs.com/Swetchine/p/11568531.html