| REDIR(1) | General Commands Manual (smm) | REDIR(1) |
redir — redirect
TCP connections
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 |
redir redirects TCP connections coming in
on a local port, [SRC]:PORT, to a specified
address/port combination, [DST]:PORT. Both the
SRC and DST arguments can be
left out, redir will then use
0.0.0.0.
redir can be run either from inetd or as a
standalone daemon. In --inetd mode the listening
SRC:PORT combo is handled by another process, usually
inetd, and a connected socket is handed over to
redir via stdin. Hence only
[DST]:PORT is required in
--inetd mode. In standalone mode
redir can run either in the foreground,
-n, or in the background, detached like a proper
UNIX daemon. This is the default. When running in the foreground log
messages are also printed to stderr, unless the -s
flag is given.
Depending on how redir was compiled, not all options may be available.
Mandatory arguments to long options are mandatory for short options too.
-b,
--bind=IPredir to pick a specific address to bind to
when it listens for incoming connections. Not applicable when running in
Linux's transparent proxy mode, -p.-h,
--help-f,
--ftp=TYPEredir for an FTP server, this will
cause redir to also redirect FTP connections. Type should be specified as
either "port", "pasv", or "both", to specify
what type of FTP connection to handle. Note that
--transproxy often makes one or the other
(generally port) undesirable.-i,
--inetd-I,
--ident=NAME-l,
--loglevel=LEVEL-n,
--foreground-p,
--transproxyredir to make connections appear as if they had
come from their true origin. See the file transproxy.txt in the
distribution, and the Linux Documentation/networking/tproxy.txt for
details. Untested on modern Linux kernels.-s,
--syslog-n is
enabled.-t,
--timeout=SEC-v-x,
--connect--connect
requires the hostname and port which the HTTP proxy will be asked to
connect to.The following options control traffic shaping, if
redir is built with shaping enabled.
-m,
--max-bandwidth=BPS-o,
--wait-in-out=<1,2,3>--max-bandwidth and
--random-wait for input(1), output(2), or
both(3).-w,
--random-wait=MSEC--bufsize)-z,
--bufsize=BYTES--max-bandwidth or
--random-wait to simulate a slow connection.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.
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.
redir is written by Nigel Metheringham and
Sam Creasey, with contributions from many others. It is currently being
maintained at GitHub by Joachim Nilsson.
| 01 May, 2016 | Debian |