The host can ping the virtual machine, but the virtual machine cannot ping the host (offline)
Introduction: My host machine is windows10
and the virtual machine is CentOS7
.
Idea: windows firewall interception
reference tutorial: https://blog.csdn.net/hskw444273663/article/details/81301470
problem introduction
1. Check the IP address of the host
Enter in the search box in the lower right corner of the windows desktop cmd
, open the command prompt, and enter ipconfig
the IPv4 addresses of VMnet1 and VMnet8 . Because my virtual machine is set in NET mode, I need to use the IPv4 address of VMnet8 .
2. View the IP address of the virtual machine
The virtual machine needs to open the cable,
open the terminal in the virtual machine in the upper right corner of the desktop, and enter the IP address after ifconfig
the first partinet
3. Try to connect with each other
The host can ping the IP address of the virtual machine, and it can be pinged, but the virtual machine cannot ping the address in VMnet8 of the host, but can only ping the address of VMnet1. This involves the difference between net1 and net8: see https://zhidao.baidu.com/question/93935871.html for details .
Solution
1. Open the host firewall
Open Control Panel , select Small Icons in CategoryWindows Defender防火墙
, and select . Click Advanced Settings
on the left, select Inbound Rules , find File and Printer Sharing (Echo Request - ICMPv4-in) , select according to actual needs, I chose Domain , and then click Enable Rules to enter the virtual machine again, and found that net8 can be pinged La! ! !