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

相关文章

Linux命令之firewalld的用法

《Linux命令之firewalld的用法》:本文主要介绍Linux命令之firewalld的用法,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux命令之firewalld1、程序包2、启动firewalld3、配置文件4、firewalld规则定义的九大

Linux之计划任务和调度命令at/cron详解

《Linux之计划任务和调度命令at/cron详解》:本文主要介绍Linux之计划任务和调度命令at/cron的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux计划任务和调度命令at/cron一、计划任务二、命令{at}介绍三、命令语法及功能 :at

Linux ls命令操作详解

《Linuxls命令操作详解》通过ls命令,我们可以查看指定目录下的文件和子目录,并结合不同的选项获取详细的文件信息,如权限、大小、修改时间等,:本文主要介绍Linuxls命令详解,需要的朋友可... 目录1. 命令简介2. 命令的基本语法和用法2.1 语法格式2.2 使用示例2.2.1 列出当前目录下的文

Spring Boot项目部署命令java -jar的各种参数及作用详解

《SpringBoot项目部署命令java-jar的各种参数及作用详解》:本文主要介绍SpringBoot项目部署命令java-jar的各种参数及作用的相关资料,包括设置内存大小、垃圾回收... 目录前言一、基础命令结构二、常见的 Java 命令参数1. 设置内存大小2. 配置垃圾回收器3. 配置线程栈大小

Linux find 命令完全指南及核心用法

《Linuxfind命令完全指南及核心用法》find是Linux系统最强大的文件搜索工具,支持嵌套遍历、条件筛选、执行动作,下面给大家介绍Linuxfind命令完全指南,感兴趣的朋友一起看看吧... 目录一、基础搜索模式1. 按文件名搜索(精确/模糊匹配)2. 排除指定目录/文件二、根据文件类型筛选三、时间

使用mvn deploy命令上传jar包的实现

《使用mvndeploy命令上传jar包的实现》本文介绍了使用mvndeploy:deploy-file命令将本地仓库中的JAR包重新发布到Maven私服,文中通过示例代码介绍的非常详细,对大家的学... 目录一、背景二、环境三、配置nexus上传账号四、执行deploy命令上传包1. 首先需要把本地仓中要

Windows命令之tasklist命令用法详解(Windows查看进程)

《Windows命令之tasklist命令用法详解(Windows查看进程)》tasklist命令显示本地计算机或远程计算机上当前正在运行的进程列表,命令结合筛选器一起使用,可以按照我们的需求进行过滤... 目录命令帮助1、基本使用2、执行原理2.1、tasklist命令无法使用3、筛选器3.1、根据PID

Linux系统之authconfig命令的使用解读

《Linux系统之authconfig命令的使用解读》authconfig是一个用于配置Linux系统身份验证和账户管理设置的命令行工具,主要用于RedHat系列的Linux发行版,它提供了一系列选项... 目录linux authconfig命令的使用基本语法常用选项示例总结Linux authconfi

linux打包解压命令方式

《linux打包解压命令方式》文章介绍了Linux系统中常用的打包和解压命令,包括tar和zip,使用tar命令可以创建和解压tar格式的归档文件,使用zip命令可以创建和解压zip格式的压缩文件,每... 目录Lijavascriptnux 打包和解压命令打包命令解压命令总结linux 打包和解压命令打

Redis的Zset类型及相关命令详细讲解

《Redis的Zset类型及相关命令详细讲解》:本文主要介绍Redis的Zset类型及相关命令的相关资料,有序集合Zset是一种Redis数据结构,它类似于集合Set,但每个元素都有一个关联的分数... 目录Zset简介ZADDZCARDZCOUNTZRANGEZREVRANGEZRANGEBYSCOREZ