How to do it...

The fping command is very similar to the ping utility with a few extras added on. It can be used in the same way that ping can be used to send an ICMP echo request to a single target to determine whether it is alive.

  1. This is done by simply passing the IP address as an argument to the fping utility:
  1. Unlike the standard ping utility, fping will stop sending ICMP echo requests after it receives a single reply. Upon receiving a reply, it will indicate that the host corresponding to this address is alive. Alternatively, if a response is not received from the address, fping will, by default, make four attempts to contact the system prior to determining that the host is unreachable:
  1. This default number of connection attempts can be modified using the -c (count) option and supplying an integer value to it that defines the number of attempts to be made:
  1. When executed in this fashion, the output is slightly more cryptic but can be understood with careful analysis. The output for any host includes the IP address, the number of attempts made (xmt), the number of replies received (rcv), and the percentage of loss (%loss).
  2. In the example provided, the first address was discovered to be online. This is evidenced by the fact that the number of bytes received and the latency of reply are both returned. You can also easily determine whether there is a live host associated with the provided IP address by examining the percentage loss. If the percentage loss is 100, no replies have been received. Unlike ping—which is most commonly used as a troubleshooting utility—fping was built with the integrated capability to scan multiple hosts.
  1. A sequential series of hosts can be scanned with fping, using the -g option to dynamically generate a list of IP addresses. To specify a range to scan, pass this argument to both the first and last IP address in the desired sequential range:
  1. The generate list option can also be used to generate a list based on the CIDR range notation. In the same way, fping will cycle through this dynamically generated list and scan each address:
  1. Finally, fping can also be used to scan a series of addresses as specified by the contents of an input text file. To use an input file, use the -f (file) option and then supply the filename or path of the input file: 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset