Saturday, April 20, 2013

redirect TCP connections with redir

Sometimes you need an easy way to redirect incoming connections to another system. For example when migrating an old box to a new one. redir: Redirect TCP connections It can run under inetd or stand alone (in which case it handles multiple connections). Its 8 bit clean, not limited to line mode, is small and light. Supports FTP redirects and supports transparency support. redir is all you need to redirect traffic across firewalls authenticate based on an IP address etc etc. No need for the firewall toolkit. The functionality of inetd/tcpd and "redir" will allow you to do everything you need without screwy telnet/ftp etc gateways. (I assume you are running IP Masquerading of course.)
You’ll need the ‘redir’ program for this to work:
apt-get install redir

Redir redirects tcp connections coming in to a local port to a specified address/port combination.

To redirect TCP connections with redir utility,  Simply type the
command such as below

redir --laddr=<listen_address> --lport=<listen_port>  --caddr=<connect_address>  --cport=<connect_port>

Suppose that the ip address of our system is and we woud like to connect to  ip address and 3120 port over our system. Simply, we want redirutiliy to redirect connections coming to on port 3120 to  port 3120. We have to run redir such as below to do so:
redir --laddr= --lport=3120  --caddr= --cport=3120

No comments:

Post a Comment