2PING(1)
2ping(1) π¦ okay bestie, this is the manual page for 2ping, and I'm going to explain it like we're in the group chat π This is part 1 of 2.
β¨ NAME β¨
2ping is a bi-directional ping utility, so it's regular ping with main character energy π
β¨ SYNOPSIS β¨
2ping [options] --listen | host/IP [host/IP [...]]
So you either run it with --listen to be the listener, or you give it one or more hosts/IPs to ping π«Ά
β¨ DESCRIPTION β¨
okay so 2ping is a bi-directional ping utility π It uses 3-way pings (kinda like TCP's SYN, SYN/ACK, ACK π¦) and then compares notes after the fact between a 2ping listener and a 2ping client. That's how it figures out which direction the packet loss is happening π₯
Step one: start a listener on a known stable network host π The listener's stability should not be in question, bestie π«Ά Why? Because 2ping can tell whether packet loss is inbound or outbound relative to an endpoint, but that won't help you find the cause if both endpoints are sus π
Once the listener is up, start 2ping in client mode and tell it to connect to the listener β¨ The two ends start pinging each other and showing network stats. If packet loss happens, 2ping waits a few seconds (default 10, configurable with --inquire-wait) before comparing notes, so it can figure out which direction the loss is going π§
To quit on the client or listener end, hit ^C and a list of statistics will pop up π Want a quick inline stats peek without quitting? Hit ^\ or send the process a QUIT signal πΈ
β¨ OPTIONS β¨
Ping-compatible options (long option names are 2ping-specific, iykyk) π
--audible,-aβ Audible ping π--adaptive,-Aβ Adaptive ping, and this one is lowkey iconic π₯ The interpacket interval adapts to round-trip time, so effectively there's not more than one unanswered probe on the network (or more, if preload is set). On networks with low rtt, this mode is basically the same as flood mode.--count=count,-c countβ Stop after sending count ping requests π--flood,-fβ Flood ping, the most dramatic mode π For every ping sent, a β.β gets printed, and for every ping received, a backspace gets printed. It's a rapid display of how many pings are getting dropped. If interval isn't given, it sets the interval to zero and outputs pings as fast as they come back or one hundred times per second, whichever is more.
2ping-specific notes: detected outbound and inbound loss show up as β>β and β<β, respectively. Receive errors show up as βEβ. Because 2ping is asynchronous, successful responses (backspaces) may overwrite these loss and error characters π
--interval=interval,-i intervalβ Chill for interval seconds between each ping β³ Normally the default is one second between pings, but in flood mode there's no waiting at all.--interface-address=address,-I addressβ Set the source IP address π In listener mode, you can use this option multiple times to bind to multiple IP addresses. In client mode, you can only use it once, and all outbound pings get bound to that source IP.
2ping-specific notes: this option only takes an IP address, not a device name. Also, in listener mode, if the machine has an interface with multiple IP addresses and a request comes in via a sub IP, the reply still leaves via the interface's main IP. So either this option, or (preferred π«Ά) listening on all IPs individually via the Python βnetifacesβ module, must be used if you want to respond via an interface's sub-IP.
--preload=count,-l countβ If specified, 2ping sends that many packets without waiting for a reply π--pattern=hex_bytes,-p hex_bytesβ You can specify up to 16 βpadβ bytes to fill out the packets you send π§© This is super useful for diagnosing data-dependent problems in a network. For example,--pattern=ffwill fill the sent packet's pad area with all ones.
2ping-specific notes: this pads the portion of the packet that does not contain the active payload data. If the active payload data is larger than the minimum packet size (--min-packet-size), no padding will be sent.
--quiet,-qβ Quiet output π€« Nothing is displayed except the summary lines at startup and when finished.--packetsize-compat=bytes,-s bytesβ ping compatibility moment π« This sets--min-packet-sizeto this value plus 8 bytes.--verbose,-vβ Verbose output π In 2ping, this prints decodes of the packets that are sent and received.--version,-Vβ Show the version and exit π·οΈ--deadline=seconds,-w secondsβ Set a timeout, in seconds, before 2ping exits, no matter how many pings have been sent or received β° Due to blocking, this may happen up to one second after the deadline you set.
When port -1 is specified, 2ping picks a random unused high port for you π¦ This is lowkey perfect for automated unit and functional testing π§ͺ but NOT for normal use, bestie π
--send-monotonic-clockβ β¨ Sends a monotonic clock value along with each packet. If the peer sends its own time, you can check it out with--verboseπ--send-random=bytesβ π² Sends random data to the peer, up tobytes. The actual amount is capped by other factors too, and can't go past--max-packet-size. If you're gonna use this data for anything trusted, pair it with--authfor HMAC authentication π--send-timeβ β° Sends the host time (wall clock) with each packet. Same deal as above: if the peer sends its time back,--verbosewill show it π--srvβ π In client mode, hostnames get looked up through DNS SRV records. If the SRV query returns multiple record targets, they're ALL pinged in parallel, and priority and weight are not considered π The record's port gets used instead of--port. This needs thednspythonmodule installed, so make sure it's there first π--srv-service=serviceβ π§ When you're using--srv, this sets the service name for SRV lookups. The default service is2pingπΈ--stats=intervalβ π Prints a line of brief current statistics everyintervalseconds. You can also get that same line on demand by hitting^\or sending theQUITsignal to the 2ping process β--subtract-peer-host-latencyβ π«Ά If a peer sends its host latency (the time it spends between receiving a packet and sending out a reply), this subtracts it from the RTT calculations. Very precise, very iconic π
π BUGS π
None known, many assumed π Iykyk.
βοΈ AUTHOR βοΈ
2ping was written by Ryan Finnie <ryan@finnie.org> π
π©βπ» AUTHORS π©βπ»
Ryan Finnie. The mastermind herself π
That's the whole 2PING(1) page, bestie π¦π Go forth and ping things responsibly π β¨
π¦ where this page comes from
- debian bookworm: 2ping 4.5-1.1 Β· GPL-2.0-or-later
- debian trixie: 2ping 4.5-1.2 Β· GPL-2.0-or-later
- fedora 43: 2ping 4.5.1-20.fc43 Β· GPL-2.0-or-later
- fedora 43: 2ping 4.5.1-22.fc43 Β· GPL-2.0-or-later
- fedora 44: 2ping 4.5.1-24.fc44 Β· GPL-2.0-or-later
- opensuse-leap 16.0: 2ping 4.5.1-bp160.1.11 Β· GPL-2.0-or-later
- ubuntu jammy: 2ping 4.5-1 Β· GPL-2.0-or-later
- ubuntu noble: 2ping 4.5-1.2 Β· GPL-2.0-or-later
- ubuntu resolute: 2ping 4.5-2 Β· GPL-2.0-or-later
- ubuntu stonking: 2ping 4.5-2 Β· GPL-2.0-or-later
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms