系统中有个最最常用命令工具--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. tachyon with hadoop

    hadoop2.2.0 jdk1.7 tachyon0.5.0 无zookeeper tachyon和hadoop都是伪分布式模式 1.修改core-site.xml文件 <property&g ...

  2. .NET多线程执行函数

    前面几篇文章一直在写LINQ,这里为什么会出现多线程?原因是DebugLZQ在写一个LINQ综合Demo的时候遇到了多线程,便停下手来整理一下.关于多线程的文章,园子里很多很多,因此关于多线程理论性的 ...

  3. C#获取进程的主窗口句柄的实现方法

    通过调用Win32 API实现. public class User32API { private static Hashtable processWnd = null; public delegat ...

  4. 采用handle消息机制实现轮播效果

    // 自动轮播条显示 if (mhandle == null) { mhandle = new Handler() { public void handleMessage(Message mes) { ...

  5. java 输入输出 函数对象构造

    /*********************输入输出*******************/   //输入字符串 不包括最后的换行符'\n'     import java.io.BufferedRe ...

  6. EasyUI设置复选框单选操作

    Html 代码: <td align="left" colspan="2">                    <input type=& ...

  7. js 实现angylar.js view层和model层双绑定(改变view刷新 model,改变model自动刷新view)

    近段时间研究了下angular.js 觉得它内部实现的view和model层之间存在很微妙的关系,如下图 如上图说的,view的改变会update 数据层model, 数据层会update视图层vie ...

  8. 【CSS3】---only-child选择器+only-of-type选择器

    only-child选择器 “:only-child”选择器选择的是父元素中只有一个子元素,而且只有唯一的一个子元素.也就是说,匹配的元素的父元素中仅有一个子元素,而且是一个唯一的子元素. 示例演示 ...

  9. 常见的Activity Action Intent常量

    Intent的中文意思是“意图,目的”的意思,可以理解为不同组件之间通信的“媒介”或者“信使”. 目标组件一般要通过Intent来声明自己的条件,一般通过组件中的<intent-filter&g ...

  10. Android&iOS视频直播之旅

    现在的移动互联网时代,大家的网速真是越来越快,高带宽的WIFI和覆盖率极大的4G,4G+把手机观看视频直播推上了风口浪尖,越来越多的应用在玩手机视频直播,我们做的应用里也要嵌入视频直播. 这篇文章里我 ...