Like ping or mtr, fping uses ICMP requests to check the existence of machines in a network. The advantage is, fping is able to scan entire networks or can read IP addresses to check from text files.

Installation

fping can be installed as an IPFire addon over the console with:

pakfire install fping

or over the IPFire web interface via Pakfire

How does it work

fping sends a packet to one address and then jumps to the next one immediately. This can be accomplished over an IP address range of an entire subnet, or with the help of a text file. A response or packet loss will be noted by fping and returned via the console. The output of fping is quite easy to parse, so other accomplished processes can be triggered (there are examples on fping´s man page which are linked below).

Examples

Testing of individual IP's:
fping 192.168.20.1 192.168.20.2 192.168.20.5
Output:

192.168.20.1 is alive
192.168.20.2 is alive
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.5
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.5
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.5
192.168.20.5 is unreachable

Check an entire subnet with a:
fping -g 192.168.20.0/24
With this command fping starts with 192.168.20.1 and after it reaches .254 it starts again from the beginning and passes this process 3 times.

Shortened output:

192.168.20.1 is alive
192.168.20.2 is alive
192.168.20.18 is alive
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.3
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.4
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.5
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.6
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.7
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.8
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.9
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.10
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.11
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.12
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.13
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.14
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.15
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.16
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.17
ICMP Host Unreachable from 192.168.20.1 for ICMP Echo sent to 192.168.20.19

If fping should only go once through the subnet you can also work with counts.
An example of a Count of 1:
fping -c 1 -g 192.168.20.0/24

Shortened output:

192.168.20.1   : xmt/rcv/%loss = 1/1/0%, min/avg/max = 1.47/1.47/1.47
192.168.20.2   : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.44/0.44/0.44
192.168.20.3   : xmt/rcv/%loss = 1/0/100%
192.168.20.4   : xmt/rcv/%loss = 1/0/100%
192.168.20.5   : xmt/rcv/%loss = 1/0/100%
192.168.20.6   : xmt/rcv/%loss = 1/0/100%
192.168.20.7   : xmt/rcv/%loss = 1/0/100%
192.168.20.8   : xmt/rcv/%loss = 1/0/100%
192.168.20.9   : xmt/rcv/%loss = 1/0/100%
192.168.20.10  : xmt/rcv/%loss = 1/0/100%
192.168.20.11  : xmt/rcv/%loss = 1/0/100%
192.168.20.12  : xmt/rcv/%loss = 1/0/100%
192.168.20.13  : xmt/rcv/%loss = 1/0/100%
192.168.20.14  : xmt/rcv/%loss = 1/0/100%
192.168.20.15  : xmt/rcv/%loss = 1/0/100%
192.168.20.16  : xmt/rcv/%loss = 1/0/100%
192.168.20.17  : xmt/rcv/%loss = 1/0/100%
192.168.20.18  : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.46/0.46/0.46
192.168.20.19  : xmt/rcv/%loss = 1/0/100%

So fping stops after it reaches .254 and also gives a more detailed output about the average ping and package losses.

Read IP's from a file:
It can e.g. be use touch
touch fping.list
to creat a file containing all the IP's which fping should retrieves. The file might look like this:

192.168.20.1
192.168.20.2
192.168.20.18
192.168.123.1
192.168.39.1
192.168.39.2
192.168.39.40
192.168.39.20

The command
fping < /path/to/file/fping.list
proves then the IP´s in the list, the output can look similar to this:

192.168.20.1 is alive
192.168.20.2 is alive
192.168.20.18 is alive
192.168.123.1 is alive
192.168.39.1 is alive
192.168.39.2 is alive
192.168.39.40 is alive
ICMP Host Unreachable from 192.168.39.1 for ICMP Echo sent to 192.168.39.20
ICMP Host Unreachable from 192.168.39.1 for ICMP Echo sent to 192.168.39.20
ICMP Host Unreachable from 192.168.39.1 for ICMP Echo sent to 192.168.39.20
192.168.39.20 is unreachable

There is more information, so if you are interested in this topic, take a look into the links listed below.