I'm a newbie and I'd like to know about the Ping command on Linux (I'm using Ubuntu 11.04).

After pinging a PC on my network, how can I make the target PC respond to my ping calls? I can see that the bytes are transmitted to the target but how do I ensure the target responds to the calls?

link|improve this question
Am I right in thinking you want the target PC to react/respond when it receives a ping? Example, alert the user? When you ping the target PC it should automatically reply and you should receive output detailing the latency between the two machines. In this sense it is already responding. Are you receiving time-out messages? – Ionis Oct 10 '11 at 9:49
feedback

migrated from stackoverflow.com Oct 10 '11 at 10:20

This question came from our site for professional and enthusiast programmers.

2 Answers

Most PCs should respond to ping

$ ping -c 5 black
PING black.example.com (10.0.0.8) from 10.0.0.9 : 56(84) bytes of data.
64 bytes from black.example.com (10.0.0.8): icmp_seq=1 ttl=128 time=0.231 ms
64 bytes from black.example.com (10.0.0.8): icmp_seq=2 ttl=128 time=0.209 ms
64 bytes from black.example.com (10.0.0.8): icmp_seq=3 ttl=128 time=0.210 ms
64 bytes from black.example.com (10.0.0.8): icmp_seq=4 ttl=128 time=0.211 ms
64 bytes from black.example.com (10.0.0.8): icmp_seq=5 ttl=128 time=0.210 ms

--- black.example.com ping statistics ---
5 packets transmitted, 5 received, 0% loss, time 3999ms
rtt min/avg/max/mdev = 0.209/0.214/0.231/0.012 ms

If they don't respond, I'd check any "firewall" configuration on the target PC.

Firewall, Advanced, ICMP, "allow incoming icmp request"

or command line

netsh firewall set icmpsetting 8 enable

(Assuming the target PC is running Windows (specifically XP)).

link|improve this answer
feedback

target PC responds to ping when it is configured in that way. by default most servers ignore ping requests.

try ping google.com and try ping localhost

you will see the difference.

link|improve this answer
i wouldnt say most are configured to ignore ping, including google.com which pings just fine here. icmp is likely discarded at your network perimeter. – Sirex Oct 10 '11 at 11:24
feedback

Your Answer

 
or
required, but never shown

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