fping is a small command line tool to send ICMP (Internet Control Message Protocol) echo request to network hosts, similar to ping, but much higher performing when pinging multiple hosts. fping totally differs from ping in that you can define any number of hosts on the command line or specify a file with the list of IP addresses or hosts to ping.
Read Also: A Linux Sysadmin’s Guide to Network Management, Troubleshooting and Debugging
For example, using fping, we can specify the complete network range (192.168.0.1/24). It will send Fping request to host and move to another target host in a round-robin fashion. Unlike ping, Fping is meant for basically scripting.
How to Install Fping in Linux Systems
In most Linux distributions, the package fping is available to install from the default package repositories using package management tool as shown.
# sudo apt install fping [On Debian/Ubuntu] # sudo yum install fping [On CentOS/RHEL] # sudo dnf install fping [On Fedora 22+] # sudo pacman -S fping [On Arch Linux]
Alternatively, you can install latest version of fping (4.0) from the source package using following commands.
$ wget https://fping.org/dist/fping-4.0.tar.gz $ tar -xvf fping-4.0.tar.gz $ cd fping-4.0/ $ ./configure $ make && make install
Let’s see some Fping command with their examples.
1. Fping Multiple IP Address
The below command will fping multiple IP address at once and it will display status as alive or unreachable.
# fping 188.8.131.52 184.108.40.206 220.127.116.11 18.104.22.168 is alive 22.214.171.124 is unreachable 126.96.36.199 is unreachable
2. Fping Range of IP Address
The following command will fping a specified range of IP addressees. With below output we are sending echo request to range of IP address and getting reply as we wanted. Also cumulative result shown after exit.
# fping -s -g 192.168.0.1 192.168.0.9 192.168.0.1 is alive 192.168.0.2 is alive ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.3 ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.3 ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.3 ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.4 192.168.0.3 is unreachable 192.168.0.4 is unreachable 8 9 targets 2 alive 2 unreachable 0 unknown addresses 4 timeouts (waiting for response) 9 ICMP Echos sent 2 ICMP Echo Replies received 2 other ICMP received 0.10 ms (min round trip time) 0.21 ms (avg round trip time) 0.32 ms (max round trip time) 4.295 sec (elapsed real time)
3. Fping Complete Network with Different Options
With above command, it will ping complete network and repeat once (-r 1). Sorry, it’s not possible to show output of the command as it is scrolling up my screen with no time.
# fping -g -r 1 192.168.0.0/24
4. Reads the List of Targets From a File
We have create a file called fping.txt having IP address (188.8.131.52 and 184.108.40.206) to fping.
# fping < fping.txt 220.127.116.11 is alive 18.104.22.168 is alive
5. Show Version of Fping
Check the Fping version by executing the command.
# fping -v fping: Version 4.0 fping: comments to [email protected]
Those who want to get more information with options about Fping command, please look into a man page. Also requested to try Fping command in your environment and share your experience with us through the comment box below.