How can I set a short timeout with the ping command?

fping might be a better tool than the stock ping you are using. What OS are you on?

  • “fping differs from ping in that you can specify any number of targets on the command line, or specify a file containing the lists of targets to ping.”
  • “Instead of sending to one target until it times out or replies, fping will send out a ping packet and move on to the next target in a round-robin fashion.”
  • “Unlike ping, fping is meant to be used in scripts, so its output is designed to be easy to parse.”

Example:

fping -c1 -t500 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4
  • -c Number of request packets to send to each target.
  • -t Initial target timeout in milliseconds

Leave a Comment