A Logo

Feel free to include my content in your page via my
RSS feed

Help Irongeek.com pay for
bandwidth and research equipment:

Subscribestar or Patreon

Search Irongeek.com:

Irongeek Button
Social-engineer-training Button

Help Irongeek.com pay for bandwidth and research equipment:


Man page of fping


Section: Misc. Reference Manual Pages (8)
Index of this MAN page

Back To MAN Pages From BackTrack 5 R1 Master List  


fping - send ICMP ECHO_REQUEST packets to network hosts  


fping [ options ] [ systems... ]  


       fping is a program like ping(8) which uses the Internet Control Message Protocol (ICMP) echo request to determine if a target host is responding. 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.

In the default mode, if a target replies, it is noted and removed from the list of targets to check; if a target does not respond within a certain time limit and/or retry limit it is designated as unreachable. fping also supports sending a specified number of pings to a target, or looping indefinitely (as in ping ).

Unlike ping, fping is meant to be used in scripts, so its output is designed to be easy to parse.  


Show systems that are alive.
Display targets by address rather than DNS name.
Number of bytes of ping data to send. The minimum size (normally 12) allows room for the data that fping needs to do its work (sequence number, timestamp). The reported received data size includes the IP header (normally 20 bytes) and ICMP header (8 bytes), so the minimum total size is 40 bytes. Default is 56, as in ping. Maximum is the theoretical maximum IP datagram size (64K), though most systems limit this to a smaller, system-dependent number.
In the default mode, fping sends several requests to a target before giving up, waiting longer for a reply on each successive request. This parameter is the value by which the wait time is multiplied on each successive request; it must be entered as a floating-point number (x.y). The default is 1.5.
Number of request packets to send to each target. In this mode, a line is displayed for each received response (this can suppressed with -q or -Q). Also, statistics about responses for each target are displayed when all requests have been sent (or when interrupted).
Similar to -c, but the per-target statistics are displayed in a format designed for automated response-time statistics gathering. For example: % fping -C 5 -q somehost somehost : 91.7 37.0 29.2 - 36.8 shows the response time in milliseconds for each of the five requests, with the "-" indicating that no response was received to the fourth request.
Use DNS to lookup address of return ping packet. This allows you to give fping a list of IP addresses as input and print hostnames in the output.
Show elapsed (round-trip) time of packets.
Read list of targets from a file. This option can only be used by the root user. Regular users should pipe in the file via stdin: % fping < targets_file
Generate a target list from a supplied IP netmask, or a starting and ending IP. Specify the netmask or start/end in the targets portion of the command line. ex. To ping the class C 192.168.1.x, the specified command line could look like either: fping -g or fping -g
Print usage message.
The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25).
Loop sending packets to each target indefinitely. Can be interrupted with ctl-C; statistics about responses for each target are then displayed.
Send pings to each of a target host's multiple interfaces.
Same as -d.
In looping or counting modes (-l, -c, or -C), this parameter sets the time in milliseconds that fping waits between successive packets to an individual target. Default is 1000.
Quiet. Don't show per-target results, just set final exit status.
Like -q, but show summary results every n seconds.
Retry limit (default 3). This is the number of times an attempt at pinging a target will be made, not including the first try.
Print cumulative statistics upon exit.
Set source address.
Initial target timeout in milliseconds (default 500). In the default mode, this is the amount of time that fping waits for a response to its first request. Successive timeouts are multiplied by the backoff factor.
Select timeout in seconds (default 10).
Show targets that are unreachable.
Print fping version information.


The following perl script will check a list of hosts and send mail if any are unreachable. It uses the open2 function which allows a program to be opened for reading and writing. fping does not start pinging the list of systems until it reads EOF, which it gets after INPUT is closed. Sure the open2 usage is not needed in this example, but it's a good open2 example none the less.

require 'open2.pl';

$MAILTO = "root";

$pid = &open2("OUTPUT","INPUT","/usr/local/bin/fping -u");


foreach(@check) {  print INPUT "$_\n"; }

if ($#output != -1) {
 open(MAIL,"|mail -s 'unreachable systems' $MAILTO");
 print MAIL "\nThe following systems are unreachable as of: $date\n\n";
 print MAIL @output;
 close MAIL;

Another good example is when you want to perform an action only on hosts
that are currently reachable.


$hosts_to_backup = `cat /etc/hosts.backup | fping -a`;

foreach $host (split(/\n/,$hosts_to_backup)) {
  # do it



Roland J. Schemers III, Stanford University, concept and versions 1.x
RL "Bob" Morgan, Stanford University, versions 2.x
David Papp, versions 2.3x and up,
fping website:  http://www.fping.com


Exit status is 0 if all the hosts are reachable, 1 if some hosts were unreachable, 2 if any IP addresses were not found, 3 for invalid command line arguments, and 4 for a system call failure.  


Ha! If we knew of any we would have fixed them!  


If certain options are used (i.e, a low value for -i and -t, and a high value for -r) it is possible to flood the network. This program must be installed as setuid root in order to open up a raw socket, or must be run by root. In order to stop mere mortals from hosing the network (when fping is installed setuid root) , normal users can't specify the following:

 -i n   where n < 10  msec
 -r n   where n > 20
 -t n   where n < 250 msec



netstat(1), ping(8), ifconfig(8c)




This document was created by man2html, using the manual pages.
Time: 07:34:21 GMT, September 13, 2011

Printable version of this article

15 most recent posts on Irongeek.com:

If you would like to republish one of the articles from this site on your webpage or print journal please contact IronGeek.

Copyright 2020, IronGeek
Louisville / Kentuckiana Information Security Enthusiast