问题
I am not very knowledgeable on computer networks, but my understanding is that the ping command on Linux tests internet connection by computing the amount of sent and received packages to some IP address.
For this I often use the ping command if I am experiencing connection issues. But the results are ofter very counterintuitive: For example now I seem to have a perfect internet connection, but the results from a ping command to any address returns 100% packet loss
>>> ping google.com
PING google.com(lga25s62-in-x0e.1e100.net (2607:f8b0:4006:81a::200e)) 56 data bytes
--- google.com ping statistics ---
27 packets transmitted, 0 received, 100% packet loss, time 26618ms
What is an explanation for this? What is the ping command really telling me about my current connection?
回答1:
Yout PC defaults to IPv6 so it ping google IPv6 address 2607:f8b0:4006:81a::200e and your network does not route IPv6. You can ping google with IPv4 with command:
ping -4 google.com
What OS and Kernel you are using, what is the result of command:
uname -a
回答2:
You may take the following step:
- View your routing table with
route -n
- Ping the gateway of destination 0.0.0.0
- If it works, try traceroute to www.google.com. If there's ISP problem, you will notice the failure of the hop right after the gateway
- Verify DNS settings
- Verify that google hostname is not falsely mapped manually
Hope that it helps
来源:https://stackoverflow.com/questions/64175206/why-ping-google-com-returns-100-packet-loss-if-i-am-experiencing-a-perfect-in