Why is ping not a Linux timeout?

I just realized that pingon the Linux platform (Ubuntu 13.10) it does not have a timeout as described. I tried

ping -w 2 unreachable.com

and

ping -w 2 unreachable.com

but in no case was there a timeout after 2 seconds. How to use pingwith a specific timeout? Is this even possible? I want the team to stop after 2 seconds, regardless of the connection status.

+4
source share
2 answers

ping -c 5 -W 2 will send 5 pins, waiting for a maximum of 2 seconds for each of them (maximum 10 seconds).

ping -w 5 will send pings, but will stop after 5 seconds.

: IP-, ​​ ( ), DNS, - DNS /etc/resolv.conf - . .

+9

? :

-W , . -W 2, man-:

. , ping RTT

, , , 2 , , .

+2

All Articles