Home > Operation and Maintenance > CentOS > What should I do if centos cannot ping under the virtual machine?

What should I do if centos cannot ping under the virtual machine?

王林
Release: 2020-03-30 10:56:39
Original
3394 people have browsed it

What should I do if centos cannot ping under the virtual machine?

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
Copy after login
Copy after login

Return no, so open it:

firewall-cmd --zone=public --add-port=22/tcp --permanent
Copy after login

Reload the firewall:

firewall-cmd --reload
Copy after login

Check whether port 22 is open:

firewall-cmd --zone= public --query-port=22/tcp
Copy after login
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template