Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ping www.google.com works, but ping -R www.google.com fails. Why?

share|improve this question
1  
It would be helpful if you provided a bit more information. How does it fail exactly? Do the pings get dropped? Do they come back without route information? Or something else? –  James Henstridge May 19 '12 at 2:05
add comment

3 Answers 3

ping -R is a kind of poor-man's-traceroute, which sets the RECORD_ROUTE flag in the packets send, asking each host along the way to return the path taken by the packet at that point.

As Marty noted, the maximum length that may be recorded is nine hops, and many hosts may simply ignore this flag.

Try traceroute or mtr instead if you want to find out the route your ICMP (ping) packets are taking on their way to google.com

share|improve this answer
add comment

It works for me as well as it is supposed to work.

According to the man page:

"Note that the IP header is only large enough for nine such routes.  
 Many hosts ignore or discard this option."

So, if the route is more than 9 hops, including your local machine, then that's all you'll ever see is the first 9.

share|improve this answer
add comment

Some sites may consider such requests as a potential security problem as they reveal network connectivity information possibly useful for an attacker. They may therefore drop the packets silently.

Many sites disallow traceroute functionality as well for the same reason.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.