Can't ping any websites, but can access websites through browser

17,821

From man ping: ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway.

Your browser opens a TCP connection on port 80.

Any system along the path between you and www.google.com could be deciding to treat these two connections differently.

You could use tracepath (from the iputils-tracepath package) to see which systems are in that path, then ping, or hping3 to explore.

FWIW, I get PING responses from www.google.com,(-c 3 limits ping to 3 ICMP packets, which IMHO, is more polite):

walt@aardvark:~(0)$ ping -c 3 www.google.com  

PING www.google.com (74.125.225.114) 56(84) bytes of data.
64 bytes from ord08s08-in-f18.1e100.net (74.125.225.114): icmp_req=1 ttl=56 time=35.9 ms
64 bytes from ord08s08-in-f18.1e100.net (74.125.225.114): icmp_req=2 ttl=56 time=32.1 ms
64 bytes from ord08s08-in-f18.1e100.net (74.125.225.114): icmp_req=3 ttl=56 time=32.0 ms

--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 32.096/33.402/35.964/1.817 ms
Share:
17,821

Related videos on Youtube

ushadow
Author by

ushadow

Updated on September 18, 2022

Comments

  • ushadow
    ushadow over 1 year

    I'm using Ubuntu 13.10 running on the newest version of Macbook Pro (dual boot). I'm using wireless connection to access websites through the Chrome browser and it works. But ping doesn't work. For example, this is the output

    $ping -c 3 www.google.com
    PING www.google.com (74.125.226.212) 56(84) bytes of data.
    
    --- www.google.com ping statistics ---
    3 packets transmitted, 0 received, 100% packet loss, time 2015ms
    

    It seems that it is not the issue of name resolving. So what could be wrong? I'm not using a proxy for my browser.

    This is the output of tracepath

    $ tracepath www.google.com
    1:  <my machine name>.local                                     0.052ms pmtu 1500
    1:  no reply
    2:  no reply
    3:  no reply
    ...
        Too many hops: pmtu 1500
        Resume: pmtu 1500 
    

    EDIT: After re-installing Ubuntu, ping works again.

  • jobin
    jobin over 10 years
    How does this answer the question?
  • ushadow
    ushadow over 10 years
    I'm not using a proxy in my browser.
  • Rakesh Godhala
    Rakesh Godhala over 10 years
    apt-get update is woking in your terminal ?I was about to ask about traceroute map.. It seems your apt-get is working
  • goo
    goo over 10 years
    It shows the difference in the two methods of connection (ping uses Internet control Message Protocol en.wikipedia.org/wiki/Internet_Control_Message_Protocol, and browsers use Transmission Control Protocol en.wikipedia.org/wiki/Transmission_Control_Protocol . It offers tools by which the OP can investigate further into the problem (ICMP fails TCP works), offers a philosophical belief (-c 3) and shows that www.google.com does respond to ICMP Ping requests for one system. Can you suggest improvements? This is what I would do if I were at OP's keyboard.
  • ushadow
    ushadow over 10 years
    apt-get was working. I just re-installed Ubuntu and ping works again.
  • solr
    solr about 9 years
    This response doesn't answer OP question in any way.
  • goo
    goo about 9 years
    It explains how "Can't Ping" and "can access websites" use different protocols (ICMP vs TCP) and may evoke different responses. How would you improve the response?