当前位置: 首页 > news >正文

扫描某个网段下存活的IP:fping

前言:

之前用arp统计过某网段下的ip,但是有可能统计不全。网络管理平台又不允许登录。想要知道当前的ip占用情况,可以使用fping

fping命令类似于ping,但比ping更强大。与ping需要等待某一主机连接超时或发回反馈信息不同,fping在给一个主机发送完数据包后,马上给下一个主机发送数据包,实现多主机同时ping。同时,fping还可以在命令行中指定要ping的主机数量范围。

但是当某台主机或者交换机的网络策略禁用ICMP或者禁止ping包的时候,那就无法通过此方法来获取局域网中被占用的具体ip

使用方式:

ping指定的多个IP:

fping 192.168.3.1 192.168.3.12 192.168.3.16 2>/dev/null

ping整个网段:

fping -g 192.168.3.0/24 2>/dev/null

ping整个网段,只显示存活的主机:

fping -ag 192.168.3.0/24 2>/dev/null

在这里插入图片描述

ping某一段IP:

fping -ag 192.168.0.5 192.168.0.130 2>/dev/null

ping的具体选项目

Usage: fping [options] [targets...]Probing options:-4, --ipv4         only ping IPv4 addresses-6, --ipv6         only ping IPv6 addresses-b, --size=BYTES   amount of ping data to send, in bytes (default: 56)-B, --backoff=N    set exponential backoff factor to N (default: 1.5)-c, --count=N      count mode: send N pings to each target-f, --file=FILE    read list of targets from a file ( - means stdin)-g, --generate     generate target list (only if no -f specified)(give start and end IP in the target list, or a CIDR address)(ex. fping -g 192.168.1.0 192.168.1.255 or fping -g 192.168.1.0/24)-H, --ttl=N        set the IP TTL value (Time To Live hops)-I, --iface=IFACE  bind to a particular interface-l, --loop         loop mode: send pings forever-m, --all          use all IPs of provided hostnames (e.g. IPv4 and IPv6), use with -A-M, --dontfrag     set the Don't Fragment flag-O, --tos=N        set the type of service (tos) flag on the ICMP packets-p, --period=MSEC  interval between ping packets to one target (in ms)(in loop and count modes, default: 1000 ms)-r, --retry=N      number of retries (default: 3)-R, --random       random packet data (to foil link data compression)-S, --src=IP       set source address-t, --timeout=MSEC individual target initial timeout (default: 500 ms,except with -l/-c/-C, where it's the -p period up to 2000 ms)Output options:-a, --alive        show targets that are alive-A, --addr         show targets by address-C, --vcount=N     same as -c, report results in verbose format-D, --timestamp    print timestamp before each output line-e, --elapsed      show elapsed time on return packets-i, --interval=MSEC  interval between sending ping packets (default: 10 ms)-n, --name         show targets by name (-d is equivalent)-N, --netdata      output compatible for netdata (-l -Q are required)-o, --outage       show the accumulated outage time (lost packets * packet interval)-q, --quiet        quiet (don't show per-target/per-ping results)-Q, --squiet=SECS  same as -q, but show summary every n seconds-s, --stats        print final stats-u, --unreach      show targets that are unreachable-v, --version      show version-x, --reachable=N  shows if >=N hosts are reachable or not
http://www.lryc.cn/news/402886.html

相关文章:

  • 【深度学习】PyTorch框架(3):优化与初始化
  • Go-知识测试-子测试
  • .net core IConfiguration 读 appsettings.json 数据,举例
  • 全球Windows机器蓝屏,作为量化人,我的检讨来了
  • 部署和运维
  • 微信小程序基本语法
  • 测试用例的设计方法
  • Android10.0 锁屏分析-KeyguardPatternView图案锁分析
  • Python 装饰器:函数的函数,代码的艺术
  • 安全防御2
  • C语言 ——— 打印水仙花数
  • 「Conda」在Linux系统中安装Conda环境管理器
  • 9.11和9.9哪个大?GPT-4o也翻车了
  • [开源]语雀+Vercel:打造免费个人博客网站
  • 使用ElementUI和element-china-area-data库实现省市区三级联动组件封装
  • 0718,TCP协议,三次握手,四次挥手
  • 如何安装Visual Studio Code
  • vi 编辑器快捷生成 main 函数和基本框架
  • npm相关指令
  • 为什么不要碰自媒体
  • 酷炫末世意境背景404单页HTML源码
  • PHP 调用 1688 详情 API 接口的实战攻略
  • SAP ABAP性能优化
  • 【鸿蒙学习笔记】构建布局・选项卡 (Tabs)
  • 独立游戏《星尘异变》UE5 C++程序开发日志5——实现物流系统
  • Web开发:<br>标签的作用
  • DVC+Minio
  • C++内存管理(区别C语言)深度对比
  • 手把手带你写一个精简版 HashMap 的 put 方法
  • 【面试题】数据结构:堆排序的排序思想?