fping命令

2024-04-06 15:36
文章标签 命令 fping

本文主要是介绍fping命令,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

fping是一个用于网络扫描的工具,它可以在 Linux 系统上使用。fping可以发送 ICMP ECHO_REQUEST(即 ping)数据包到指定的网络地址范围,并等待响应。通过这种方式,fping可以用来检测哪些 IP 地址是活跃的。

可以测试多个ip或者域名,并形成报告

[root@localhost ~]# fping 192.168.71.130 qq.com 192.168.71.131
192.168.71.130 is alive
qq.com is alive
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.131
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.131
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.131
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.131
192.168.71.131 is unreachable
  1. 192.168.71.130是可达的(alive)。
  2. qq.com是可达的(alive)。
  3. 对于发送到192.168.71.131的ICMP Echo请求,从192.168.71.130收到了ICMP Host Unreachable错误。
  4. 192.168.71.131是不可达的(unreachable)。

指定范围

这里指定的是192.168.71.130到192.168.71.140在内的所有ip地址,并返回报告

[root@localhost ~]# fping  -s -g 192.168.71.130  192.168.71.140 
192.168.71.130 is alive
192.168.71.132 is alive
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.133
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.133
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.133
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.133
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.131
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.131
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.131
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.131
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.137
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.137
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.137
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.137
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.136
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.136
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.136
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.136
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.135
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.135
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.135
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.135
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.134
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.134
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.134
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.134
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.140
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.140
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.140
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.140
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.139
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.139
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.139
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.139
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.138
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.138
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.138
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.138
192.168.71.131 is unreachable
192.168.71.133 is unreachable
192.168.71.134 is unreachable
192.168.71.135 is unreachable
192.168.71.136 is unreachable
192.168.71.137 is unreachable
192.168.71.138 is unreachable
192.168.71.139 is unreachable
192.168.71.140 is unreachable11 targets2 alive9 unreachable0 unknown addresses36 timeouts (waiting for response)38 ICMP Echos sent2 ICMP Echo Replies received36 other ICMP received0.055 ms (min round trip time)1.05 ms (avg round trip time)2.04 ms (max round trip time)4.271 sec (elapsed real time)

执行结果

  1. 共有11个目标地址。
  2. 其中2个是可达的(alive)。
  3. 9个是不可达的(unreachable)。
  4. 0个未知地址。
  5. 共发送了38个ICMP Echo请求,收到了2个ICMP Echo回复。
  6. 共收到36个其他类型的ICMP消息。
  7. 最小往返时间(round trip time)为0.055毫秒。
  8. 平均往返时间为1.05毫秒。
  9. 最大往返时间为2.04毫秒。
  10. 总共花费了4.271秒的实际运行时间。

测试连通整个网络

fping -g -r 1 192.168.71.0/24

创建文件,使用fping测试文件内容的ip地址

[root@localhost ~]# cat 1.sh 
192.168.71.1
192.168.71.12
192.168.71.15
192.168.71.18
192.168.71.10
192.168.71.111
[root@localhost ~]# fping -f 1.sh 
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.12
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.12
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.12
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.12
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.111
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.111
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.111
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.111
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.10
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.10
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.10
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.10
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.18
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.18
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.18
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.18
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.15
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.15
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.15
ICMP Host Unreachable from 192.168.71.130 for ICMP Echo sent to 192.168.71.15
192.168.71.1 is unreachable
192.168.71.12 is unreachable
192.168.71.15 is unreachable
192.168.71.18 is unreachable
192.168.71.10 is unreachable
192.168.71.111 is unreachable

这篇关于fping命令的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/880210

相关文章

零基础学习Redis(10) -- zset类型命令使用

zset是有序集合,内部除了存储元素外,还会存储一个score,存储在zset中的元素会按照score的大小升序排列,不同元素的score可以重复,score相同的元素会按照元素的字典序排列。 1. zset常用命令 1.1 zadd  zadd key [NX | XX] [GT | LT]   [CH] [INCR] score member [score member ...]

30常用 Maven 命令

Maven 是一个强大的项目管理和构建工具,它广泛用于 Java 项目的依赖管理、构建流程和插件集成。Maven 的命令行工具提供了大量的命令来帮助开发人员管理项目的生命周期、依赖和插件。以下是 常用 Maven 命令的使用场景及其详细解释。 1. mvn clean 使用场景:清理项目的生成目录,通常用于删除项目中自动生成的文件(如 target/ 目录)。共性规律:清理操作

利用命令模式构建高效的手游后端架构

在现代手游开发中,后端架构的设计对于支持高并发、快速迭代和复杂游戏逻辑至关重要。命令模式作为一种行为设计模式,可以有效地解耦请求的发起者与接收者,提升系统的可维护性和扩展性。本文将深入探讨如何利用命令模式构建一个强大且灵活的手游后端架构。 1. 命令模式的概念与优势 命令模式通过将请求封装为对象,使得请求的发起者和接收者之间的耦合度降低。这种模式的主要优势包括: 解耦请求发起者与处理者

linux 判断某个命令是否安装

linux 判断某个命令是否安装 if ! [ -x "$(command -v git)" ]; thenecho 'Error: git is not installed.' >&2exit 1fi

jenkins 插件执行shell命令时,提示“Command not found”处理方法

首先提示找不到“Command not found,可能我们第一反应是查看目标机器是否已支持该命令,不过如果相信能找到这里来的朋友估计遇到的跟我一样,其实目标机器是没有问题的通过一些远程工具执行shell命令是可以执行。奇怪的就是通过jenkinsSSH插件无法执行,经一番折腾各种搜索发现是jenkins没有加载/etc/profile导致。 【解决办法】: 需要在jenkins调用shell脚

Linux命令(4):fg与bg命令

fg、bg、jobs、&、ctrl + z都是跟系统任务有关的,虽然现在基本上不怎么需要用到这些命令,但学会了也是很实用的 一.& 最经常被用到 这个用在一个命令的最后,可以把这个命令放到后台执行 二.ctrl + z 可以将一个正在前台执行的命令放到后台,并且暂停 三.jobs 查看当前有多少在后台运行的命令 四.fg 将后台中的命令调至前台继续运行 如果后台中有多个命令,可以

Linux命令(3):sz与rz命令

一般来说,linux服务器大多是通过ssh客户端来进行远程的登陆和管理的,使用ssh登陆linux主机以后,如何能够快速的和本地机器进行文件的交互呢,也就是上传和下载文件到服务器和本地; 与ssh有关的两个命令可以提供很方便的操作: sz:将选定的文件发送(send)到本地机器 rz:运行该命令会弹出一个文件选择窗口,从本地选择文件上传到服务器(receive) rz,sz是便是Linux

Detectorn2预训练模型复现:数据准备、训练命令、日志分析与输出目录

Detectorn2预训练模型复现:数据准备、训练命令、日志分析与输出目录 在深度学习项目中,目标检测是一项重要的任务。本文将详细介绍如何使用Detectron2进行目标检测模型的复现训练,涵盖训练数据准备、训练命令、训练日志分析、训练指标以及训练输出目录的各个文件及其作用。特别地,我们将演示在训练过程中出现中断后,如何使用 resume 功能继续训练,并将我们复现的模型与Model Zoo中的

Linux命令(11):系统信息查看命令

系统 # uname -a # 查看内核/操作系统/CPU信息# head -n 1 /etc/issue # 查看操作系统版本# cat /proc/cpuinfo # 查看CPU信息# hostname # 查看计算机名# lspci -tv # 列出所有PCI设备# lsusb -tv

Android下执行linux命令

最近在开发过程中 使用了几个命令来对   手机的文件的权限进行修改;现在记录一下: 用到的方法: 1:判断是否有Root权限;  /**      * 判断当前手机是否有ROOT权限      * @return      */     public static boolean isRoot(){         boolean bool = false;         try{