Giter Site home page Giter Site logo

uredir's Introduction

UDP port redirector

Badge Travis Status

uredir is a small Linux daemon to redirect UDP connections. It can be used to forward connections on small and embedded systems that do not have (or want to use) iptables.

uredir can be used with the built-in inetd service in Finit to listen for, e.g. SNMP connections, on some (safe) interfaces and forward to an SNMP daemon on loopback.

  • In normal mode it forwards packets to a given destination and remembers the sender's address. Packets received from the given destination are forwarded to the sender.
  • In inetd mode uredir lingers for three (3) seconds after forwarding a reply. This to prevent inetd from spawning new instances for multiple connections, e.g. an SNMP walk.

For a TCP port redirector, see redir.

Usage

uredir [-hinsv] [-I NAME] [-l LEVEL] [-t SEC] [SRC:PORT] DST:PORT

  -h      Show this help text
  -i      Run in inetd mode, get SRC:PORT from stdin, implies -n
  -I NAME Identity, tag syslog messages with NAME, default: uredir
  -l LVL  Set log level: none, err, info, notice (default), debug
  -n      Run in foreground, do not detach from controlling terminal
  -s      Use syslog, even if running in foreground, default w/o -n
  -t SEC  Timeout for connections, default 3 seconds
  -v      Show program version

 Bug report address: https://github.com/troglobit/uredir/issues

Examples

This simple UDP proxy example forwards inbound DNS requests on any interface to an external DNS server on 192.168.0.1:

uredir :53 192.168.0.1:53

To run uredir from a process monitor like Finit or systemd, tell it to not background itself and to only use the syslog for log messages:

uredir -ns :53 127.0.0.1:53

To run uredir in inetd mode, e.g. to redirect SNMP requests, try the following. Runs in foreground, as required for inetd services, and uses syslog for logging:

snmp  dgram  udp  wait  root  uredir -i 127.0.0.1:16161

Build & Install

uredir is tailored for Linux systems and should build against any (old) C libray. However, uredir v3.0 and later require an external library, libuEv. Installing it should present no surprises since it too use a standard configure script and support pkg-config. The latter is used by the uredir build to locate the library and header files.

Hence, the regular ./configure && make is usually sufficient to build uredir. But if libuEv is installed in non-standard location you may need to provide the path:

    PKG_CONFIG_PATH=/opt/lib/pkgconfig:/home/ian/lib/pkgconfig ./configure
    make

Origin & References

The uredir project is open source under the ISC license and actively maintained at GitHub. Please use its interface for reporting bugs and an pull requests.

uredir was heavily inspired by redir(1), by Sam Creasey.

uredir's People

Contributors

jonasj76 avatar troglobit avatar wkz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uredir's Issues

How to use it?

./uredir 0.0.0.0:3500 xxx.xxx.xxx.xxx:abcd

but it doesn't work

Missing 'configure' script

Build instruction say:
./configure && make

./configure isn't present.

More information if anyone else attempts to build this:
Tried to use ./autogen.sh it and had the issue
./autogen.sh: 3: autoreconf: not found

Installed autoreconf (apt install autoreconf)
Now autogen succeeded and was able to run ./autogen.sh and then the generated ./configure

Which errored out with

./configure: line 3928: syntax error near unexpected token `uev,'
./configure: line 3928: `PKG_CHECK_MODULES(uev,  libuev >= 2.1.1)'

Seems libuev is a custom library by the same author. Would have been nice to embed it in the repo to more easily build...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.