-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathuredir.1
100 lines (100 loc) · 2.59 KB
/
uredir.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.Dd 17 April, 2016
.Dt UREDIR 1
.Os
.Sh NAME
.Nm uredir
.Nd UDP port redirector
.Sh SYNOPSIS
.Nm
.Op Fl hinsv
.Op Fl I Ar ID
.Op Fl l Ar LVL
.Op Fl t Ar SEC
.Op Ar [SRC]:PORT
.Ar [DST]:PORT
.Sh DESCRIPTION
.Nm
is a small tool to redirect UDP traffic. It can be used as a poor man's
filtering tool, e.g. for small multihomed embedded systems without a
built-in firewall.
.Pp
.Nm
forwards packets to a specified destination remembering the sender's
address, any packets received from the destination are in turn forwarded
to the sender.
.Pp
When
.Nm
is launched from
.Xr inetd 8
it does not immediately exit when the first reply has been forwarded.
Instead it lingers for three (3) seconds in case more requests are
received, e.g. in the case of an SNMP walk. This helps conserve
precious system resources, useful in particular on embedded systems.
.Pp
For a TCP port redirector, try
.Xr redir 1 ,
which now has the same maintainer as
.Xr uredir 1 .
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl h
Print a summary of the options and exit
.It Fl i
Run in inetd mode, read data from stdin. Implies
.Fl n ,
always runs in foreground
.It Fl I Ar ID
Identity, tag syslog messages with the ID name, default: process name
.It Fl l Ar LVL
Set log level: none, err, info, notice (default), debug
.It Fl n
Run in foreground, do not detach from controlling terminal
.It Fl s
Use syslog, even if running in foreground, default w/o
.Fl n
.It Fl t Ar SEC
Set timeout to SEC seconds for connections, default 3
.It Fl v
Show program version
.It Ar [SRC]:PORT
Source, or outer/public, IP and UDP port to bind to, the SRC can be left
out to default to 0.0.0.0. Must not be set when running in inet mode,
.Fl i
.It Ar [DST]:PORT
Destination, or inner/private, IP and UDP port to redirect to
.El
.Sh EXAMPLE
This simple UDP proxy example forwards inbound DNS requests on any
interface to an external DNS server on 192.168.0.1.
.Pp
.Rs
uredir :53 192.168.0.1:53
.Re
.Pp
To run
.Nm
in inetd mode, e.g. to redirect SNMP requests, and timeout after 5 sec,
try the following. Runs in foreground, as required for inetd services,
and uses syslog for logging:
.Pp
.Rs
snmp dgram udp wait root uredir -it 5 127.0.0.1:16161
.Re
.Pp
Syntax may vary between different inetd implementations and UNIX
distributions.
.Fi
.Sh SEE ALSO
.Xr redir 1
.Xr inetd 8
.Sh BUGS
Use the project's GitHub page to file bug reports, feature requests or
patches -- preferably as pull requests
.Aq https://github.com/troglobit/uredir
.Sh AUTHORS
.Nm
used to be based on
.Nm udp_redirect
by Ivan Tikhonov, but is today based on youdp by Tobias Waldekranz.
Current maintainer is Joachim Nilsson.