REDIR(1)
π REDIR(1) β the redirect TCP connections glow-up π
System Manager's Manual Β· bestie edition, no cap β¨
β¨ NAME β¨
redir β redirect TCP connections π¦
π SYNOPSIS π
redir [-hinpsv] [-b IP] [-f TYPE] [-I NAME] [-l LEVEL] [-m BPS]
[-o <1,2,3>] [-t SEC] [-w MSEC] [-x HOST:PORT] [-z BYTES]
[SRC]:PORT [DST]:PORT
π DESCRIPTION π
okay so picture this: redir takes TCP connections that show up on a local port, [SRC]:PORT, and sends them over to an address/port combo you picked, [DST]:PORT. that's the whole vibe. both the SRC and DST arguments can be left out btw β if you ghost them, redir will just use 0.0.0.0 instead. generous queen. π
redir can run either from inetd or as a standalone daemon, and honestly it slays at both. in --inetd mode, the listening SRC:PORT combo is handled by another process β usually inetd β and a connected socket gets handed over to redir via stdin. so in --inetd mode only [DST]:PORT is required. only one. minimal. iconic. π
in standalone mode, redir can run either in the foreground with -n, or in the background, detached like a proper UNIX daemon. and that detached thing? that's the default. when you're running in the foreground, log messages also get printed to stderr β unless you pass the -s flag. so rude of them to talk over each other honestly.
heads up bestie: depending on how redir was compiled, not all options may be available. it's giving "depends on the build", fr fr. π
πΈ OPTIONS πΈ
mandatory arguments to long options are mandatory for short options too. equal opportunity requirements. periodt. π
-b,--bind=IPβ forcesredirto pick a specific address to bind to when it listens for incoming connections. not applicable when you're running in Linux's transparent proxy mode,-p. (so don't try it there, she won't hear you π)-h,--helpβ show built-in help text. the classic "hello?? explain yourself" button. β¨-f,--ftp=TYPEβ when you're usingredirfor an FTP server, this makesrediralso redirect FTP connections. TYPE should be specified as either"port","pasv", or"both", to specify what type of FTP connection to handle. note that--transproxyoften makes one or the other (generallyport) undesirable. so like, pick your fighter. π₯-i,--inetdβ run as a process started frominetd(1), with the connection passed as stdin and stdout on startup.-I,--ident=NAMEβ specify program identity (name) to be used for TCP wrapper checks and syslog messages. your name, your brand, your main character moment. π-l,--loglevel=LEVELβ set log level:none,err,notice,info,debug. default isnotice. choose your volume, bestie. π-n,--foregroundβ run in foreground, do not detach from controlling terminal. she stays. π«Ά-p,--transproxyβ on a Linux system with transparent proxying enabled, this causesredirto make connections appear as if they had come from their true origin. see the filetransproxy.txtin the distribution, and the LinuxDocumentation/networking/tproxy.txtfor details. untested on modern Linux kernels β so like, proceed with caution, she's a little vintage. π-s,--syslogβ log messages to syslog. this is the default, except when-nis enabled.-t,--timeout=SECβ timeout and close the connection after SEC seconds of inactivity. ghosting, but scheduled. π»-vβ show program version. tiny flag, big energy.-x,--connectβ redirects connections through an HTTP proxy which supports theCONNECTcommand. specify the address and port of the proxy using[DST]:PORT.--connectrequires the hostname and port which the HTTP proxy will be asked to connect to. so like, it needs the deets. don't leave it on read. π¨
π TRAFFIC SHAPING π
the following options control traffic shaping, if redir is built with shaping enabled. conditional queen. π§
-m,--max-bandwidth=BPSβ reduce the bandwidth to be no more than BPS bits/sec. the algorithm is basic, the goal is to simulate a slow connection, so there is no peak acceptance. she's not fancy, she's just slow. π-o,--wait-in-out=<1,2,3>β apply--max-bandwidthand--random-waitfor input (1), output (2), or both (3). pick a lane, or don't. π-w,--random-wait=MSECβ wait between0and2 x nmilliseconds before each "packet". a "packet" is a block of data read in one time byredir. a "packet" size is always less than the bufsize (see also--bufsize). mystery timing, very mysterious of her. β¨-z,--bufsize=BYTESβ set the bufsize (default4096) in bytes. can be used combined with--max-bandwidthor--random-waitto simulate a slow connection. slow and steady, bestie. π
π BUGS π
command line syntax changed in v3.0. compatibility with v2.x can be enabled using the --enable-compat configure option. this enables the following options: --laddr=ADDR --lport=PORT --caddr=ADDR --cport=PORT β which in v3.0 were been replaced with [SRC]:PORT and [DST]:PORT. (yes, the manpage said "were been". we're keeping it. character. π)
for full compatibility, using any of these options will implicitly also enable -n. there is currently no way to tell redir to background itself in this mode of operation. so like, she's staying in the foreground whether you like it or not. no cap. π«
π SEE ALSO π
inetd(1) uredir(1)
π AUTHORS π
redir is written by Nigel Metheringham and Sam Creasey, with contributions from many others. it is currently being maintained at GitHub by Joachim Nilsson. shoutout to the whole squad, we love a collaborative slay. π«Άβ¨
and that's the page, bestie!! π this one's from Debian, dated 01 May, 2016, and it lives under the name REDIR(1) β go forth and redirect responsibly, mwah π π
π¦ where this page comes from
- debian bookworm: redir 3.3-1 Β· GPL-2.0-or-later
- debian trixie: redir 3.3-1 Β· GPL-2.0-or-later
- epel 10: redir 3.3-12.el10_1 Β· GPL-2.0-or-later
- epel 9: redir 3.3-3.el9 Β· GPLv2+
- fedora 43: redir 3.3-13.fc43 Β· GPL-2.0-or-later
- fedora 44: redir 3.3-14.fc44 Β· GPL-2.0-or-later
- nixos 26.05: redir 3.3
- nixpkgs unstable: redir 3.3
- ubuntu jammy: redir 3.3-1 Β· GPL-2.0-or-later
- ubuntu noble: redir 3.3-1 Β· GPL-2.0-or-later
- ubuntu resolute: redir 3.3-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: redir 3.3-1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms