+3 votes
831 views
How to install and use fping command on Linux

in Linux / Unix by (552k points)
reopened | 831 views

1 Answer

+4 votes
Best answer

1. How to install fping on Linux
2 . How to run ping to various Linux IP addresses
3. How to ping a range of IP addresses in Linux
4. How to scan a complete Linux network with fping
5. How to validate the fping version in Linux
6. How to ping from a file in Linux
7. Additional fping parameters (Linux)

The ping command has been through the years one of the most practical ways to check the operation of both a remote and a local computer when working with packages that are sent and from which an answer is expected to know details as if this active or not, shipping quality, packages received and much more..

By using the ping command it is possible to do this action with a single host or equipment in particular, but today we have a free utility called fping, thanks to which the equipment detection or network verification tasks will be with more functions complete. It is for this reason that today TechnoWikis will explain how we can install and use fping in Linux and thus add one more utility to the management tasks.

What is fping
Fping has been developed as an application that is responsible for sending ICMP (Internet Control Message Protocol) echo requests to the computers on the network in order to validate their status in real time, but, unlike the ping command , fping allows us to ping several hosts simultaneously and also allows us to specify a file in which is the list of IP addresses or hosts to ping. With fping we have a standard tool for network diagnostics and statistics.

Unlike traditional ping, fping is designed to be used in scripts, so its output is focused to be of a much simpler analysis.


1. How to install fping on Linux


To install this fping utility we can execute any of the following commands based on the distribution used:
Debian / Ubuntu
 sudo apt install fping 
CentOS / RHEL
 sudo yum install fping 
Fedora
 sudo dnf install fping 
Linux arch
 sudo pacman -S fping 
image
Note
Alternatively, we can install fping from the resources, for this we execute the following lines in their order:
 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 

2 . How to run ping to various Linux IP addresses


To validate multiple IP addresses, we will execute the following:
 fping IP1 IP2 IP3…. 
image

We will get two results that are:

Alive
IP address is active
Unreachable
The host is not available

3. How to ping a range of IP addresses in Linux


Another option is to ping a specific range of IP addresses. This sends an echo request to the range of the IP address and the response of each of them is obtained and in the final part we find details such as:
  • Amount of managed IP address
  • Number of positive and negative responses
  • Response times
  • Total time of task execution
image

4. How to scan a complete Linux network with fping


It is possible that for some support task it is necessary to see how many IP addresses are active or not in a local network. To do this we will add the parameter -r 1 which repeats the action once, we execute the following:
 fping -g -r 1 (IP range), for example, fping -g -r 1 192.168.0.0/24 
image

5. How to validate the fping version in Linux


To know the current version of fping just run the following:
 fping -v 
image

6. How to ping from a file in Linux


It is possible to create a text file with a range of addresses to analyze, in this case we must use the following syntax:
 fping <fping.txt 
With this command you create the text file with the info.

7. Additional fping parameters (Linux)


With fping we will have the opportunity to use additional parameters such as:
Restrict search for IPv4 addresses only
 −4, −−ipv4 
Search only IPv6 addresses
 −6, −−ipv6 
Display only active IP addresses
 −a, −−alive 
Display goals by address instead of DNS name
 −A, −−addr 
It is the number of bytes of ping data to send
 −b, −−size = BYTES 
Rollback factor is used in the default mode, there fping sends several requests to a target before generating error, and for this it waits longer for a response in each successive request
 −B, −−backoff = N 
Indicate the number of request packages to send to each target
 −c, −−count = N 
Use the DNS to find the address of the ping return packet
 −d, −−rdns 
Get the IP addresses of a text file
 −f, −−file 
Show the IP TTL field
 −H, −−ttl = N 
Display the used interface
 −I, −−iface = IFACE 
Send ping to each of the multiple IP addresses of the destination host
 −m, −−all 
Define the type of service
 −O, −−tos = N 
They are the retry limits which by default is 3
 −r, −−retry = N 
Set the resource address
 −S, −−src = addr 
Search only offline host
 −u, −−unreach 

by (3.5m points)
edited

Related questions

+5 votes
1 answer
asked Apr 30, 2020 in Linux / Unix by backtothefuture (552k points) | 318 views
+4 votes
1 answer
+3 votes
1 answer
+5 votes
1 answer
+5 votes
1 answer
asked Feb 22, 2020 in Linux / Unix by backtothefuture (552k points) | 355 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users