The system has one of the most common command tools--ping, while fping is the enhanced version of the Ping tool. The installation process is simple:
[email protected]/]# wget--limit-rate 500k http://www.fping.org/dist/fping-3.8.tar.gz [email protected]/]# tar zxvf fping-3.8.tar.gz && cd fping-3.8 [[email protected]/]# ./configure && make && make install [email protected]/]# fping--help fping:invalid Option--'-'usage:fping [Options] [targets ...]-A
show targets that is alive
-A show targets by address-
B N amount of ping data to send, in bytes (default)-
b F set exponential backoff factor to F-
C n count of pings to send to each target (default 1)-
c n same as-c, report results in verbose format-
d print timestamp before each output line-
e show elapsed time on return packets-
F file read List of targets from a file (-means stdin) (only if no-g specified)-
g generate target list (only if no-f specified)(Specify the start and end IP in the target list, or supply a IP netmask)(ex. fping-g 192.168.1.0 192.168.1.255 or fping-g 192.168.1.0/24)-
H n Set the IP TTL value (time to Live hops)-I
n interval between sending ping packets (in millisec) (default)-
L Loop sending pings forever-
m ping multiple interfaces on target host-
n show targets by name (-D is equivalent)-
p n interval between ping packets to one target (in millisec)(in looping and counting modes, default)-
Q Quiet (don ' t show per-target/per-ping results)-
q n same as-q, but show summary every n seconds-
R n number of retries (default 3)-
s Print final stats-I
if bind to a particular interface-
s addr set source Address-
T n individual target initial timeout (in millisec) (default)-
t n ignored (for compatibility with fping 2.4)-
u Show targets that is unreachable-
o-n set the type of Service (TOS) flag on the ICMP packets-
v show version
Practical Cases
- Example of surviving hosts in a local area network
[Email protected]/]#fping-a 192.168.0.1/24-g 2>/dev/null192.168.0.1192.168.0.3... .........
the fping has a-D, which returns a host name by using each echo response to perform a DNS query. Use this option to print the host name instead of the IP address in the ping's response message[Email protected]/]#Cat Ip_list.txt192.168.20.5192.168.20.11192.168.20.53192.168.20.241 ......... ......... [Email protected]/]#Fping-a-D 2>/dev/null < Ip_list.txtWww.vqiudns.vqiu
The fping of Linux Network Tools