information gathering – fping

fping is a ping(1) like program which uses the Internet Control Message Protocol (ICMP) echo request to determine if a host is up. fping is different from ping in that you can specify any number of hosts on the command line, or specify a file containing the lists of hosts to ping. Instead of trying one host until it timeouts or replies, fping will send out a ping packet and move on to the next host in a round-robin fashion. If a host replies, it is noted and removed from the list of hosts to check. If a host does not respond within a certain time limit and/or retry limit it will be considered unreachable.

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

OPTIONS

-a      Show systems that are    alive.

-d      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.

-e      Show elapsed (round-trip) time of packets

-f      Read list of system 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

-g   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 192.168.1.0/24

or

fping -g 192.168.1.0 192.168.1.255

-in  The minimum amount of    time (in milliseconds) between sending a ping
packet to any    host (default is 10).

-q      Quiet. Don’t show per    host results, just set final exit status.

-rn  Retry    limit (default 3). This    is the number of times an attempt at
pinging a host will be made, not including the first try.

-s      Dump final statistics.

-tn  Individual host timeout in milliseconds (default 2500). This is the
minimum number of milliseconds between ping packets directed
towards a given host.

-u      Show systems that are    unreachable.  fping a list of IP addresses as
input    and have the results printed as    hostnames.

fping -g 192.168.1.1 192.168.1.16

fping sends icmp to the range to see if alive.

root@bt:~# fping -g 192.168.1.1 192.168.1.16
192.168.1.1 is alive
192.168.1.2 is alive
192.168.1.3 is alive
192.168.1.4 is alive
192.168.1.5 is alive
192.168.1.16 is alive
192.168.1.6 is unreachable
192.168.1.7 is unreachable
192.168.1.8 is unreachable
192.168.1.9 is unreachable
192.168.1.10 is unreachable
192.168.1.11 is unreachable
192.168.1.12 is unreachable
192.168.1.13 is unreachable
192.168.1.14 is unreachable
192.168.1.15 is unreachable

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s