系统中有个最最常用命令工具--ping,而fping 是ping 工具的加强版本。安装过程很简单:

[root@mail /]# wget --limit-rate 500k http://www.fping.org/dist/fping-3.8.tar.gz
[root@mail /]# tar zxvf fping-3.8.tar.gz && cd fping-3.8
[root@mail /]# ./configure && make && make install
 
[root@mail /]# fping --help
fping: invalid option -- '-'
Usage: fping [options] [targets...]
   -a         show targets that are alive
   -A         show targets by address
   -b n       amount of ping data to send, in bytes (default 56)
   -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 25)
   -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 1000)
   -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 500)
   -T n       ignored (for compatibility with fping 2.4)
   -u         show targets that are unreachable
   -O n       set the type of service (tos) flag on the ICMP packets
   -v         show version
 
实用案例
  • 例出局域网中存活的主机
[root@mail /]# fping -a 192.168.0.1/24 -g 2> /dev/null
192.168.0.1
192.168.0.3
………………
  • 查询DNS
fping 有一个-d ,它通过每一个echo 回应进行DNS查询来返回主机名。使用该选项可以在ping 的回应信息中打印出主机名而非IP地址
[root@mail /]# cat ip_list.txt
192.168.20.5
192.168.20.11
192.168.20.53
192.168.20.241
……………………
[root@mail /]# fping -a -d 2>/dev/null < ip_list.txt
www.vqiu
dns.vqiu

Linux 网络工具之fping的更多相关文章

  1. 【转】Linux 网络工具详解之 ip tuntap 和 tunctl 创建 tap/tun 设备

    原文:https://www.cnblogs.com/bakari/p/10449664.html -------------------------------------------------- ...

  2. Linux 网络工具

    1 nethogs nethogs 是一个免费的工具,当要查找哪个 PID (注:即 process identifier,进程 ID) 给你的网络流量带来了麻烦时,它是非常方便的.它按每个进程来分组 ...

  3. Linux 网络工具netcat(nc)的应用

    NETCAT netcat是Linux常用的网络工具之一,它能通过TCP和UDP在网络中读写数据,通过与其他工具结合和重定向,可以在脚本中以多种方式使用它. netcat所做的就是在两台电脑之间建立链 ...

  4. linux网络工具nc命令

    nc是netcat的简写,有着网络界的瑞士军刀美誉.因为它短小精悍.功能实用,被设计为一个简单.可靠的网络工具. nc命令的作用 (1)实现任意TCP/UDP端口的侦听,nc可以作为server以TC ...

  5. Linux常用网络工具:fping主机扫描

    Linux下有很多强大网络扫描工具,网络扫描工具可以分为:主机扫描.主机服务扫描.路由扫描等. fping是一个主机扫描工具,相比于ping工具可以批量扫描主机. fping官方网站:http://f ...

  6. Linux 网络工具详解之 ip tuntap 和 tunctl 创建 tap/tun 设备

    本文首发于我的公众号 Linux云计算网络(id: cloud_dev),专注于干货分享,号内有 10T 书籍和视频资源,后台回复「1024」即可领取,欢迎大家关注,二维码文末可以扫. 在前面一篇文章 ...

  7. linux网络工具iproute2的使用简介

    一.写本文的目的 本文完全是自己在学习iproute2的过程中搜集的大杂烩,记录在这里,方便以后自己查询学习,图片都是来自网络,在此表示感谢! 二.简单了解iproute2工具套装 iproute2是 ...

  8. Linux网络工具lsof和netstat

    lsof全名为list opened files,即列举系统中已经被打开的文件,基本使用如下: (1) 查看/etc/passwd使用情况 lsof /etc/password (2) 查看监听的so ...

  9. Linux 网络工具中的瑞士军刀 - socat & netcat

    独立博客阅读:https://ryan4yin.space/posts/socat-netcat/ 文中的命令均在 macOS Big Sur 和 Opensuse Tumbleweed 上测试通过 ...

随机推荐

  1. LeetCode42 Trapping Rain Water

    题目: Given n non-negative integers representing an elevation map where the width of each bar is 1, co ...

  2. git的一些命令

    因为项目的原因,大家把项目托管到git上,然后我不会,队友就传了一个廖雪峰的git教程,讲的很详细,不会用git的同学,可以在http://pan.baidu.com/s/1pKizolP上下载,这是 ...

  3. 快递鸟物流单号自动识别接口JAVA对接demo

    import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import ...

  4. Traveling by Stagecoach 状态压缩裸题

    Traveling by Stagecoach dp[s][v]  从源点到达  v,状态为s,v的最小值.  for循环枚举就行了. #include <iostream> #inclu ...

  5. [Arduino] 外部中断

    原文:http://www.arduino.cn/thread-2421-1-1.html 1.什么是中断? 试想一下,你正在家里吃饭,这时传来了敲门声,虽然你巨饿,虽然面前全是山珍海味,但此时你不得 ...

  6. DPKG命令与软件安装、APT

    ====Linux软件包==== Linux系统中,软件通常以源代码或者预编译包的形式提供. 软件的源代码通常需要编译为二进制代码才可使用,安装比较耗时.用户可以自行调节编译选项,决定需要的功能或组件 ...

  7. ibatis mysql replace into 返回ID

    目前只能在replace into 之后,重新查询数据

  8. 京东2017 C++一面

    一面直接跪,日 1. 重写和重载的区别                            答的一般 2. C++内存分配方式                           不会 3. TCP ...

  9. UIScrollView的相关属性说明

    _scrollView = [[UIScrollView alloc] init]; //height = 0:禁止垂直方向滚动 _scrollView.contentSize = CGSizeMak ...

  10. While reading xxx.png pngcrush caught libpng error: Not a PNG file..

    While reading /XXX/XXX/XXX/img1.png pngcrush caught libpng error: Not a PNG filCould not find file: ...