fping
Ping multiple hosts simultaneously
TLDR
List the status of all hosts within a range
List alive hosts within a subnet generated from a netmask
List alive hosts within a subnet generated from an IP range and prune per-probe results
List unreachable hosts within a subnet generated from a netmask
SYNOPSIS
fping [options] [target...]
PARAMETERS
-a
Show addresses instead of hostnames.
-A
Display target addresses in addition to hostnames.
-b
Number of bytes of ping data to send (default is 56, maximum is the maximum IP packet size).
-B
Set exponential backoff factor to
-c
Number of pings to send to each target. In this mode, fping displays statistics for each target separately. If used in combination with options -l or -q, yields a bar graph of response times (or just a textual indication of packet loss).
-C
Same as -c, but shows per-target statistics in CSV format.
-d
Enable DNS lookups for target addresses.
-D
Display the timestamp before each ping line. If used together with -e, the time is shown in microsecond resolution.
-e
Show elapsed (round-trip) time on response, in milliseconds. Use with -D to display time in microseconds.
-f
Read list of targets from a file (one target per line).
-g
Generate target addresses from a network address and prefix length. For example, '-g 192.168.1.0/24' will ping all 256 addresses in the 192.168.1.0/24 network.
A prefix length of 32 would ping the single address 192.168.1.0.
This option may be used to specify multiple networks.
-h
Show help message.
-H
Set number of ICMP header hops (TTL) to
-i
Interval between sending ping packets to one target (in milliseconds). In loop mode, this also controls how often fping re-sends to each target. The default is 25 msec.
-I
Bind to a specific interface address.
-l
Loop mode. Sends pings continuously, displaying the results in a bar graph format. Can be combined with -c to control the number of pings.
-m
Minimum interval between pings to all targets (in milliseconds). The default is 1 msec. It affects the load on the network.
-n
Show network addresses instead of hostnames.
-N
Show network addresses in addition to hostnames.
-o
Show unanswered targets only.
-O
Timeout before considering target unreachable (in milliseconds). The default is 500 msec.
-p
Interval between ping attempts to a target, in milliseconds. In loop or aggregate mode, this option is ignored. Default 500 msec.
-q
Quiet mode. Don't show output unless there is an error.
-Q
Like -q, but show summary every
-r
Number of retries before giving up on target. The default is 3.
-R
Use a raw socket for sending pings (needs root permissions).
-s
Show statistics for all targets after all pings are sent.
-S
Set source address.
-t
Set a global timeout (in seconds) to wait before exiting. Useful when scanning a large number of hosts. Default is to wait forever.
-T
Set TOS (type of service) flag.
-u
Show targets that are unreachable.
-v
Show version information.
-x
Send ICMP_TS (timestamp) requests instead of ECHO (ping) requests. Requires root privileges and allows you to measure time offset between local machine and remote host. Option -D might be useful as well.
One or more target hosts or IP addresses to ping.
DESCRIPTION
fping is a program similar to ping, but designed for pinging multiple hosts in parallel. It's used for network testing and monitoring. Unlike ping, which typically pings a single host until interrupted, fping sends out ping probes to a list of target hosts and moves on to the next one, allowing for quick identification of reachable or unreachable hosts. fping is often used in scripts and automated systems due to its speed and ability to handle many hosts concurrently. It uses the Internet Control Message Protocol (ICMP) 'ECHO_REQUEST' to determine if a host is reachable, displaying response times or error messages indicating network connectivity problems. The key advantage of fping is its efficient handling of network latency when dealing with many targets. fping can be useful to check availability of a specific port using -g and specify a number of IPs in the same network.
CAVEATS
fping requires root privileges when using raw sockets (-R option) or when sending ICMP timestamp requests (-x option). Overuse of fping, especially with short intervals, may be considered a denial-of-service attack on the target network.
EXIT STATUS
fping returns 0 if all the hosts are reachable, 1 if some hosts are unreachable, and 2 if there was some other error. Exit status 2 doesn't implies that some hosts are unreachable.
EXAMPLE
To ping a list of hosts from a file (hosts.txt) and show statistics:
fping -f hosts.txt -s
To ping a network range:
fping -g 192.168.1.0/24
HISTORY
fping was originally written by Roland J. Schemers. It has been widely adopted as a tool for network administrators and system administrators to quickly assess the reachability of multiple hosts. Over time, it has been improved and maintained by various contributors, adding new features and enhancing its performance. It can be found in most linux distributions.
SEE ALSO
ping(8), traceroute(8), nmap(1)