Problem discovery:
1. First ping the address:
win R and enter cmd to enter the command prompt
Enter ping Linux The system's IP address
was found to be unable to be pinged.
(Recommended tutorial: centos tutorial)
Solution process:
2. Enter Linux, check the firewall
Enter the command Check whether port 22 is open:
firewall-cmd --zone= public --query-port=22/tcp
Return no, so open it:
firewall-cmd --zone=public --add-port=22/tcp --permanent
Reload the firewall:
firewall-cmd --reload
Check whether port 22 is open:
firewall-cmd --zone= public --query-port=22/tcp
Return yes, indicating that it has been enabled.
So I pinged the IP address again and found that the ping still failed.
3. Enter the virtual machine and configure the network
1. Open the virtual machine homepage, click ->Edit->Virtual Machine Network Editor->Change settings in the lower right corner-> After re-entering, click VMnet0->Select Bridge Mode->Select Automatic->Click OK to end;
2. Select the specific Centos7, right-click and select Settings-> Select Network Adapter->Select Customize (U): Specific virtual network->Select VMnet0->Check Connected, check Connect at startup, click OK;
3. Restart Centos7.
4. Return to our computer, configure the network
ping ip address, and find that pinging still fails.
Open the Control Panel->Network Sharing Center->Enable VMware Network Adapter VMnet1->Select Properties-> Enter: Internet Protocol Version 4 (TCP/IPv4), set automatically obtain an ip address and automatically Get the DNS server address.
ping the ip address and found that the ping was successful.
problem solved.
Recommended related video tutorials: linux video tutorial
The above is the detailed content of What should I do if centos cannot ping under the virtual machine?. For more information, please follow other related articles on the PHP Chinese website!