Table of Contents
In this article, we will see how to install fping on Ubuntu 22.04. fping is a free and open source utility used for sending ICMP echo requests to all the hosts in the network. It works very similar to ping utility but comparatively it is very efficient and faster with multiple hosts. fping send ICMP echo requests to multiple hosts and then wait for them to reply.
With ping command, even if you pass multiple hosts to send ICMP echo requests, it sends them one by one but fping sends simultaneously to all the hosts which saves lot of time. Hence it is recommended for multiple hosts usage. It is also quite easy to install and use in almost all the famous linux platforms. Here we will see the steps to install fping on Ubuntu 22.04 based systems.
How to Install fping on Ubuntu 22.04 [Easy Steps]
Also Read: Mastering Bash Concatenate Strings in Linux: [10 Best Examples]
Step 1: Prerequisites
a) You should have a running Ubuntu 22.04
System.
b) You should have sudo
or root
access to run privileged commands.
c) You should have apt
or apt-get
utility installed in your Server.
Step 2: Update Your Server
Before installing fping utility, it is imperative to update all system packages by using sudo apt update && sudo apt upgrade
command as shown below. This will install all the latest bug fixes and security fixes which are super important to make your system safe and secure.
cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade Hit:1 http://in.archive.ubuntu.com/ubuntu jammy InRelease Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] Get:3 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB] Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease Hit:5 https://artifacts.elastic.co/packages/8.x/apt stable InRelease Hit:6 https://ngrok-agent.s3.amazonaws.com buster InRelease Hit:7 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease Get:8 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1,161 kB] Get:9 http://in.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [526 kB] Fetched 1,916 kB in 6s (321 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done 7 packages can be upgraded. Run 'apt list --upgradable' to see them. Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages have been kept back: apt apt-transport-https apt-utils firmware-sof-signed libapt-pkg6.0 ubuntu-drivers-common The following packages will be upgraded: linux-firmware 1 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. Need to get 258 MB of archives. After this operation, 9,330 kB of additional disk space will be used. Do you want to continue? [Y/n] Y ..........................................................
Step 3: Install fping
In the next step, you can install fping utility from default Ubuntu repo by using sudo apt install fping
command as shown below. This will download and install the package along with all its required dependencies.
cyberithub@ubuntu:~$ sudo apt install fping Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: fping 0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded. Need to get 32.0 kB of archives. After this operation, 90.1 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 fping amd64 5.1-1 [32.0 kB] Fetched 32.0 kB in 1s (29.5 kB/s) Selecting previously unselected package fping. (Reading database ... 235686 files and directories currently installed.) Preparing to unpack .../archives/fping_5.1-1_amd64.deb ... Unpacking fping (5.1-1) ... Setting up fping (5.1-1) ... Processing triggers for man-db (2.10.2-1) ...
Also Read
Step 4: Verify Installation
After successful installation, you can verify installed files path by using dpkg -L fping
command as shown below.
cyberithub@ubuntu:~$ dpkg -L fping
/.
/usr
/usr/bin
/usr/bin/fping
/usr/share
/usr/share/bug
/usr/share/bug/fping
/usr/share/doc
/usr/share/doc/fping
/usr/share/doc/fping/NEWS.Debian.gz
/usr/share/doc/fping/changelog.Debian.gz
/usr/share/doc/fping/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/fping
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/fping.8.gz
/usr/share/man/man8/fping6.8.gz
/usr/bin/fping6
Step 5: Check Version
You can also check the currently installed version of fping utility by using fping --version
command as shown below.
cyberithub@ubuntu:~$ fping --version fping: Version 5.1
Step 6: Using fping
It is now time to test fping utility by sending ICMP echo requests to target address google.com
and check its response. If successful, it will show output as Connected
or else Not Connected
. Here we are using one host but you can use multiple hosts for your use case.
cyberithub@ubuntu:~$ fping google.com 1>/dev/null 2>&1 && echo "Connected" || echo "Not Connected" Connected
Step 7: Check all available options
To check all the options available with fping utility, you can use fping --help
command as shown below.
cyberithub@ubuntu:~$ fping --help
Usage: fping [options] [targets...]
Probing options:
-4, --ipv4 only ping IPv4 addresses
-6, --ipv6 only ping IPv6 addresses
-b, --size=BYTES amount of ping data to send, in bytes (default: 56)
-B, --backoff=N set exponential backoff factor to N (default: 1.5)
-c, --count=N count mode: send N pings to each target
-f, --file=FILE read list of targets from a file ( - means stdin)
-g, --generate generate target list (only if no -f specified)
(give start and end IP in the target list, or a CIDR address)
(ex. fping -g 192.168.1.0 192.168.1.255 or fping -g 192.168.1.0/24)
-H, --ttl=N set the IP TTL value (Time To Live hops)
-I, --iface=IFACE bind to a particular interface
.....................................................
Step 8: Uninstall fping
Once you are done using fping, you can choose to uninstall it from your system by using sudo apt remove fping
command as shown below. To remove all dependent packages, you can use --auto-remove
option with below command.
cyberithub@ubuntu:~$ sudo apt remove fping Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: fping 0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded. After this operation, 90.1 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 235695 files and directories currently installed.) Removing fping (5.1-1) ... Processing triggers for man-db (2.10.2-1) ...