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

相关文章

postgresql数据库基本操作及命令详解

《postgresql数据库基本操作及命令详解》本文介绍了PostgreSQL数据库的基础操作,包括连接、创建、查看数据库,表的增删改查、索引管理、备份恢复及退出命令,适用于数据库管理和开发实践,感兴... 目录1. 连接 PostgreSQL 数据库2. 创建数据库3. 查看当前数据库4. 查看所有数据库

linux重启命令有哪些? 7个实用的Linux系统重启命令汇总

《linux重启命令有哪些?7个实用的Linux系统重启命令汇总》Linux系统提供了多种重启命令,常用的包括shutdown-r、reboot、init6等,不同命令适用于不同场景,本文将详细... 在管理和维护 linux 服务器时,完成系统更新、故障排查或日常维护后,重启系统往往是必不可少的步骤。本文

nginx启动命令和默认配置文件的使用

《nginx启动命令和默认配置文件的使用》:本文主要介绍nginx启动命令和默认配置文件的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录常见命令nginx.conf配置文件location匹配规则图片服务器总结常见命令# 默认配置文件启动./nginx

基于Python实现一个Windows Tree命令工具

《基于Python实现一个WindowsTree命令工具》今天想要在Windows平台的CMD命令终端窗口中使用像Linux下的tree命令,打印一下目录结构层级树,然而还真有tree命令,但是发现... 目录引言实现代码使用说明可用选项示例用法功能特点添加到环境变量方法一:创建批处理文件并添加到PATH1

Java -jar命令如何运行外部依赖JAR包

《Java-jar命令如何运行外部依赖JAR包》在Java应用部署中,java-jar命令是启动可执行JAR包的标准方式,但当应用需要依赖外部JAR文件时,直接使用java-jar会面临类加载困... 目录引言:外部依赖JAR的必要性一、问题本质:类加载机制的限制1. Java -jar的默认行为2. 类加

git stash命令基本用法详解

《gitstash命令基本用法详解》gitstash是Git中一个非常有用的命令,它可以临时保存当前工作区的修改,让你可以切换到其他分支或者处理其他任务,而不需要提交这些还未完成的修改,这篇文章主要... 目录一、基本用法1. 保存当前修改(包括暂存区和工作区的内容)2. 查看保存了哪些 stash3. 恢

java -jar命令运行 jar包时运行外部依赖jar包的场景分析

《java-jar命令运行jar包时运行外部依赖jar包的场景分析》:本文主要介绍java-jar命令运行jar包时运行外部依赖jar包的场景分析,本文给大家介绍的非常详细,对大家的学习或工作... 目录Java -jar命令运行 jar包时如何运行外部依赖jar包场景:解决:方法一、启动参数添加: -Xb

Linux基础命令@grep、wc、管道符的使用详解

《Linux基础命令@grep、wc、管道符的使用详解》:本文主要介绍Linux基础命令@grep、wc、管道符的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录grep概念语法作用演示一演示二演示三,带选项 -nwc概念语法作用wc,不带选项-c,统计字节数-

MySQL的ALTER TABLE命令的使用解读

《MySQL的ALTERTABLE命令的使用解读》:本文主要介绍MySQL的ALTERTABLE命令的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1、查看所建表的编China编程码格式2、修改表的编码格式3、修改列队数据类型4、添加列5、修改列的位置5.1、把列

Linux命令之firewalld的用法

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