在RHEL / CentOS 6.x / 7.x上安装并使用Fping应用程序

ping 是一个像 ping 使用方法 互联网控制消息协议ICMP )回声请求 目标主机正在响应ping 与ping不同,您可以在命令行上指定任意数量的目标, ping目标。与其发送到一个目标直到其超时或响应,不如说是, ping 发送ping数据包并以循环方式移至下一个目标。在默认模式下,当目标响应时,将其记录下来并从目标列表中删除以进行检查。如果目标在特定时间限制和/或重试时间限制内未响应,则将其指定为不可访问。 ping 还支持 将指定数量的ping发送到目标, 或无限循环(如ping)。与ping不同 ping 该输出被设计为易于分析,因为它旨在用于脚本中。

本指南描述了如何在RHEL,CentOS和Fedora Linux上安装和使用fping程序。

如何安装fping程序

首先,下载fping源程序包(最新版本为3.10)。

# wget http://fping.org/dist/fping-3.10.tar.gz

要安装应用程序fping,请按照下列步骤操作:

# tar -xvf fping-3.10.tar.gz
# cd fping-3.10
# ./configure
# make
# make install

您可以按照以下步骤来编译支持IPv6地址的fping:

# ./configure --prefix=/usr/local --enable-ipv4 --enable-ipv6
  # make
  # make install

使用fping程序的示例

Fing多个IP地址:

# fping 8.8.8.8 8.8.4.4 104.28.25.20
8.8.4.4 is alive
8.8.8.8 is alive
104.28.25.20 is alive

IP地址的Fping范围:

# fping -s -g 192.168.1.1 192.168.1.5
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.1
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.3
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.5
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.1
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.3
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.5
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.1
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.3
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.5
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.1
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.3
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.5
192.168.1.1 is unreachable
192.168.1.2 is unreachable
192.168.1.3 is unreachable
192.168.1.4 is unreachable
192.168.1.5 is unreachable

       5 targets
       0 alive
       5 unreachable
       0 unknown addresses

       5 timeouts (waiting for response)
      20 ICMP Echos sent
       0 ICMP Echo Replies received
      12 other ICMP received

 0.00 ms (min round trip time)
 0.00 ms (avg round trip time)
 0.00 ms (max round trip time)
        4.191 sec (elapsed real time)

Fping Complite网络

# fping -g -r 3 192.168.1.1/24

显示fping版本

# fping -v
fping: Version 3.10
fping: comments to [email protected]

有关fping的更多信息, fping手册页。如果您喜欢这篇文章,请与您的朋友分享并发表评论。

Sidebar