在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