Fping - 高性能Ping工具

【Fping - 高性能Ping工具】Fping是一个命令行工具,类似于ping,用于发送ICMP ( Internet控制消息协议 ),Fping与ping不同之处在于可以指定要ping的主机数量范围或主机列表文件,而且性能要高很多 。
Fping主要应用与linux系统,同时也有编译的windows版本 。
Fping官网地址:http://fping.org/
一、示例:
1. Fping多个IP地址# fping 172.168.1.23 172.168.1.25 172.168.1.272. Fping IP地址范围# fping -s -g 172.168.1.1 172.168.1.103.使用不同选项填充完整网络# fping -g -r 1 192.168.1.0/244.从文件中读取目标列表# fping < fping.txt二、命令参数:
−4, −−ipv4Restrict name resolution and IPs to IPv4 addresses.−6, −−ipv6Restrict name resolution and IPs to IPv6 addresses.−a, −−aliveShow systems that are alive.−A, −−addrDisplay targets by address rather than DNS name. Combined with −d, the output will be both the ip and (if available) the hostname.−b, −−size= BYTESNumber of bytes of ping data to send. The minimum size (normally 12) allows room for the data that fping needs to do its work (sequence number, timestamp). The reported received data size includes the IP header (normally 20 bytes) and ICMP header (8 bytes), so the minimum total size is 40 bytes. Default is 56, as in ping. Maximum is the theoretical maximum IP datagram size (64K), though most systems limit this to a smaller, system-dependent number.−B, −−backoff=NBackoff factor. In the default mode, fping sends several requests to a target before giving up, waiting longer for a reply on each successive request. This parameter is the value by which the wait time (−t) is multiplied on each successive request; it must be entered as a floating-point number (x.y). The default is 1.5.−c, −−count=NNumber of request packets to send to each target. In this mode, a line is displayed for each received response (this can suppressed with −q or −Q). Also, statistics about responses for each target are displayed when all requests have been sent (or when interrupted).−C, −−vcount=NSimilar to −c, but the per-target statistics are displayed in a format designed for automated response-time statistics gathering. For example: $ fping −C 5 −q somehost somehost : 91.7 37.0 29.2 − 36.8shows the response time in milliseconds for each of the five requests, with the "−" indicating that no response was received to the fourth request.−d, −−rdnsUse DNS to lookup address of return ping packet. This allows you to give fping a list of IP addresses as input and print hostnames in the output. This is similar to option −n/−−name, but will force a reverse-DNS lookup even if you give hostnames as target ( NAME− > IP− > NAME ).−D, −−timestampAdd Unix timestamps in front of output lines generated with in looping or counting modes (−l, −c, or −C).−e, −−elapsedShow elapsed (round-trip) time of packets.−f, −−fileRead list of targets from a file. This option can only be used by the root user. Regular users should pipe in the file via stdin: $ fping < targets_file−g, −−generate addr/maskGenerate a target list from a supplied IP netmask, or a starting and ending IP. Specify the netmask or start/end in the targets portion of the command line. If a network with netmask is given, the network and broadcast addresses will be excluded. ex. To ping the network 192.168.1.0/24, the specified command line could look like either: $ fping −g 192.168.1.0/24or $ fping −g 192.168.1.1 192.168.1.254−h, −−helpPrint usage message.−H, −−ttl=NSet the IP TTL field (time to live hops).−i, −−interval= MSECThe minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 10, minimum is 1).−I, −−iface= IFACESet the interface (requires SO_BINDTODEVICE support).−l, −−loopLoop sending packets to each target indefinitely. Can be interrupted with Ctrl-C; statistics about responses for each target are then displayed.−m, −−allSend pings to each of a target host’s multiple IP addresses (use of option ’−A’ is recommended).−M, −−dontfragSet the "Don’t Fragment" bit in the IP header (used to determine/test the MTU ).−n, −−nameIf targets are specified as IP addresses, do a reverse-DNS lookup on them to−N, −−netdataFormat output for netdata (−l −Q are required). See: <http://my−netdata.io/>−o, −−outageCalculate "outage time" based on the number of lost pings and the interval used (useful for network convergence tests).−O, −−tos=NSet the typ of service flag ( TOS ). N can be either decimal or hexadecimal (0xh) format.−p, −−period= MSECIn looping or counting modes (−l, −c, or −C), this parameter sets the time in milliseconds that fping waits between successive packets to an individual target. Default is 1000 and minimum is 10.−q, −−quetQuiet. Don’t show per-probe results, but only the final summary. Also don’t show ICMP error messages.−Q, −−squiet= SECSLike −q, but show summary results every n seconds.−r, −−retry=NRetry limit (default 3). This is the number of times an attempt at pinging a target will be made, not including the first try.−R, −−randomInstead of using all-zeros as the packet data, generate random bytes. Use to defeat, e.g., link data compression.−s, −−srcPrint cumulative statistics upon exit.−S, −−src=https://www.isolves.com/it/wl/rj/2022-04-14/addrSet source address.?t, ??timeout= MSECInitial target timeout in milliseconds. In the default, non-loop mode, the default timeout is 500ms, and it represents the amount of time that fping waits for a response to its first request. Successive timeouts are multiplied by the backoff factor specified with ?B.In loop/count mode, the default timeout is automatically adjusted to match the "period" value (but not more than 2000ms). You can still adjust the timeout value with this option, if you wish to, but note that setting a value larger than "period" produces inconsistent results, because the timeout value can be respected only for the last ping.Also note that any received replies that are larger than the timeout value, will be discarded.?T nIgnored (for compatibility with fping 2.4).?u, ??unreachShow targets that are unreachable.?v, ??versionPrint fping version information.


推荐阅读