ptunnel(8)
๐ ptunnel โ the manual, bestie edition ๐
okay so this is ptunnel(8) from section 8 of the manual (that's the "system admin / daemons" section, iykyk), and it's brought to you by Yellow Lemon Software. it tunnels TCP over ping packets. yes literally. slay.
โจ NAME โจ
ptunnel โ tunnel TCP connections over ICMP echo request/reply packets. ๐ฆ
๐ธ SYNOPSIS ๐ธ
ptunnel -p proxy_address -lp listen_port -da destination_address -dp
dest_port [-c network_device] [-v verbosity] [-f file] [-udp] [-syslog]
ptunnel [-c network_device] [-v verbosity] [-f file] [-udp] [-syslog]
[-daemon file]
ptunnel [-u] [-x password] [-setuid user] [-setgid group] [-chroot dir]
[-setcon context]
ptunnel -h
like, pick your lane bestie. client mode, shared-options-only mode, the privilege-dropping era, or just -h if you want the quick vibe check. ๐
๐ DESCRIPTION ๐
ptunnel is an application that lets you reliably tunnel TCP connections to a remote host using ICMP echo request and reply packets โ aka the ping requests and replies you already know and love. ๐
at first glance this might seem like a rather useless thing to do (and honestly? valid first impression) but it can actually come in handy in some cases. here's the main character motivation behind why ptunnel exists:
Setting: You're on the go, and stumble across an open wireless network. The network gives you an IP address, but won't let you send TCP or UDP packets out to the rest of the internet โ for instance to check your mail. ๐ญ What to do?? By chance, you discover that the network will allow you to ping any computer on the rest of the internet. With ptunnel, you can utilize this feature to check your mail, or do other things that require TCP. periodt. ๐
โจ
๐ OPTIONS ๐
Client options
-pproxy_address โ Specify the host on which the proxy is running. like, where's your proxy at bestie. ๐-lplisten_port โ Specifies the port on which the client will listen for incoming TCP connections. ๐-dadestination_addr โ Specifies the address to which you want your packets tunneled after reaching the proxy when in client mode, or restricts the destination packets can be forwarded to when in server mode. two moods, one flag. ๐ซ-dpdestination_port โ Specifies/restrict the port that the proxy should tunnel the TCP connection to. ๐
Shared options
-cnetwork_device โ Specify the network interface to capture packets from. Note that packet capturing isn't always necessary, but you should try this if you experience problems withptunnel. lowkey the fix-it flag. ๐ ๏ธ-vverbosity โ Controls the verbosity level.-1is no output,0shows errors only,1shows info messages,2gives more output,3provides even more output, level4displays debug info and level5displays absolutely everything, including the nasty details of sends and receives. ๐๐-udpโ Enables tunneling over UDP port 53 (DNS) instead of using ICMP. This will only work if your proxy can accept incoming traffic on port 53, and the client is able to send data to the proxy on port 53. Note that this option does not wrapptunnel's data in DNS-compliant packets. This option must be given on both the proxy and client side for things to work correctly. ๐จ-syslogโ (Not available on Windows.) Changes logging to use the built-in syslog fascility. ๐-daemonfile โ (Not available on Windows.) Run in background, writing PID in file. ๐-uโ Attempts to runptunnelwithout privileges. This doesn't usually work! On UNIX systems please consider using the following three options instead: ๐ซฃ-setuiduser โ (Not available on Windows.) When started in privileged mode, drop down to user's rights as soon as possible. โฌ๏ธ-setgidgroup โ (Not available on Windows.) When started in privileged mode, drop down to group's rights as soon as possible. โฌ๏ธ-chrootdir โ (Not available on Windows.) When started in privileged mode, restrict file access to the specified directory. ๐-setconcontext โ (Not available on Windows.) Set SELinux context when all there is left to do are network I/O operations. In order to be able to combine with-chrootyou will have tomount --bind /proc /chrootdir/proc๐ง-xpassword โ Specifies a password or passphrase to use. This will allow you to protect the proxy from use by others who don't know the password. It needs to be specified on both proxy and client. ๐-ffile โ Specifies a log file. If you specify-syslog, syslog is always used instead. ๐-hโ Displays brief usage information. the tutorial level. ๐ฎ
๐ EXAMPLES ๐
The following assumes that ptunnel is run as root, both on the proxy and client. To tunnel ssh connections from the client machine via a proxy running on proxy.pingtunnel.com to the computer login.domain.com, the following command line would be used:
ptunnel -p proxy.pingtunnel.com -lp 8000 -da login.domain.com -dp 22
An ssh connection to login.domain.com can now be established as follows:
ssh -p 8000 localhost
If ssh complains about potential man-in-the-middle attacks, simply remove the offending key from the known_hosts file. The warning/error is expected if you have previously ssh'd to your local computer (i.e., ssh localhost), or you have used ptunnel to forward ssh connections to different hosts. not a bug bestie, it's just ssh being ssh. ๐
Of course, for all of this to work, you need to start the proxy on your proxy-computer (proxy.pingtunnel.com). Doing this is very simple:
ptunnel
If you find that the proxy isn't working, you will need to enable packet capturing on the main network device. Currently this device is assumed to be an ethernet-device (i.e., ethernet or wireless). Packet capturing is enabled by giving the -c switch, and supplying the device name to capture packets on (for instance eth0 or en1). The same goes for the client. On Mac OS X, packet capturing must always be enabled (both for proxy and client), as resent packets won't be received otherwise. ๐โจ
To protect yourself from others using your proxy, you can protect access to it with a password using the <tt>-x</tt> switch. The password is never sent in the clear, but keep in mind that it may be visible from tools like top or ps, which can display the command line used to start an application. ๐ stay safe out there.
๐ซ EXIT STATUS ๐ซ
ptunnel does not exit until forced to do so by an interrupt (Ctrl-C) or if it crashes. it's giving clingy. it's giving main character who refuses to leave the party. ๐ญ
๐ BUGS ๐
ptunnel currently does not handle packet capturing on network interfaces other than ethernet or wireless correctly. we know. we're working on the vibe. ๐ซถ
๐ AUTHORS AND CONTRIBUTORS ๐
- Daniel Stoedle (
daniels@cs.uit.no) - Windows port: Mike Miller (
mike@mikeage.net) - SELinux support: Sebastien Raveau (
sebastien.raveau@epita.fr) - Patches: Joe McKenzie, Steffen Wendzel and StalkR.
the whole squad ate. no crumbs. ๐ฝ๏ธโจ
โญ LICENSE โญ
ptunnel is licensed under the BSD License. ๐
๐ฆ AVAILABILITY ๐ฆ
The ptunnel homepage is currently located here:
http://www.cs.uit.no/~daniels/PingTunnel/
The freshmeat project page is located here:
http://freshmeat.net/projects/ptunnel/
Please take the time to rate ptunnel if you find it useful. Thanks! ๐ฅบ๐
and that's the whole page bestie!! this was Version 0.72, dated September 5, 2011, courtesy of Yellow Lemon Software โ thanks for reading the ptunnel(8) manual with me, you're doing amazing sweetie, now go ping something responsibly ๐
๐ซถโจ
๐ฆ where this page comes from
- debian bookworm: ptunnel 0.72-3+b1 ยท BSD-3-Clause
- debian trixie: ptunnel 0.72-3+b3 ยท BSD-3-Clause
- nixos 26.05: ptunnel 0.72
- nixpkgs unstable: ptunnel 0.72
- ubuntu jammy: ptunnel 0.72-3 ยท BSD-3-Clause
- ubuntu noble: ptunnel 0.72-3build2 ยท BSD-3-Clause
- ubuntu questing: ptunnel 0.72-3build2
- ubuntu resolute: ptunnel 0.72-4 ยท BSD-3-Clause
- ubuntu stonking: ptunnel 0.72-4 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms