- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
fping是一个小型命令行工具,用于向网络主机发送ICMP ( Internet控制消息协议 )回应请求,类似于ping,但在ping多个主机时性能要高得多。 fping完全不同于ping,因为您可以在命令行上定义任意数量的主机,或者指定包含要ping的IP地址或主机列表的文件。
另请参阅 : Linux系统管理员的网络管理,故障排除和调试指南
例如,使用fping,我们可以指定完整的网络范围( 192.168.0.1/24 )。 它会向主机发送Fping请求,并以循环方式移动到另一个目标主机。 与ping不同,Fping基本上用于编写脚本。
如何在Linux系统中安装Fping
在大多数Linux发行版中,可以使用包管理工具从默认包存储库安装包fping ,如图所示。
# sudo apt install fping [On Debian/Ubuntu]
# sudo yum install fping [On CentOS/RHEL]
# sudo dnf install fping [On Fedora 22+]
# sudo pacman -S fping [On Arch Linux]
或者,您可以使用以下命令从源包安装最新版本的fping ( 4.0 )。
$ wget https://www.landui.com/dist/fping-4.0.tar.gz
$ tar -xvf fping-4.0.tar.gz
$ cd fping-4.0/
$ ./configure
$ make && make install
让我们看一些Fping命令及其示例。
1. Fping多个IP地址
以下命令将同时显示多个IP地址,它将显示状态为活动或无法访问。
# fping 50.116.66.139 173.194.35.35 98.139.183.24
50.116.66.139 is alive
173.194.35.35 is unreachable
98.139.183.24 is unreachable
2. Fping IP地址范围
以下命令将指定指定范围的IP收件人。 使用以下输出,我们将响应请求发送到IP地址范围并获得我们想要的回复。 退出后还显示累积结果。
# fping -s -g 192.168.0.1 192.168.0.9
192.168.0.1 is alive
192.168.0.2 is alive
ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.3
ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.3
ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.3
ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.4
192.168.0.3 is unreachable
192.168.0.4 is unreachable
8 9 targets
2 alive
2 unreachable
0 unknown addresses
4 timeouts (waiting for response)
9 ICMP Echos sent
2 ICMP Echo Replies received
2 other ICMP received
0.10 ms (min round trip time)
0.21 ms (avg round trip time)
0.32 ms (max round trip time)
4.295 sec (elapsed real time)
3.使用不同选项填充完整网络
使用上述命令,它将ping整个网络并重复一次( -r 1 )。 抱歉,无法显示该命令的输出,因为它在没有时间的情况下向上滚动屏幕。
# fping -g -r 1 192.168.0.0/24
4.从文件中读取目标列表
我们创建了一个名为fping.txt的文件,其IP地址( 173.194.35.35和98.139.183.24 )到fping。
# fping < fping.txt
173.194.35.35 is alive
98.139.183.24 is alive
5.显示Fping版本
执行命令检查Fping版本。
# fping -v
fping: Version 4.0
fping: comments to [email protected]
售前咨询
售后咨询
备案咨询
二维码
TOP