Port forwarding on Linux without iptables?

Solution 1:

Use the tool called "socat", it is great tool for such things and it is already packaged in many linux distribution. Read about it here : http://www.dest-unreach.org/socat/doc/README

Port forwarding example with socat :

socat TCP4-LISTEN:80,fork TCP4:www.yourdomain.org:8080

This redirect all TCP connections on port 80 to www.yourdomain.org port 8080 TCP.

Solution 2:

There's a tiny, light resources program called redir which is pretty configurable.

apt-get install redir on Debian-based distributions.


Solution 3:

What about rinetd ?
Its a daemon that redirects TCP connections. Have a look at the man page to see if it suits your needs: https://manpages.debian.org/unstable/rinetd/rinetd.8.en.html


Solution 4:

xinetd supports a redirect attribute which will do what you want. As others have noted there are a number of programs which handle redirects.

Using xinetd or other program which uses the tcpwrappers library will allow you to apply access restrictions if and when it becomes necessary.


Solution 5:

xinet/inetd. For e. g.:

redirect

Allows a tcp service to be redirected to another host. When xinetd receives a tcp connection on this port it spawns a process that establishes a connection to the host and port number specified, and forwards all data between the two hosts.

http://linux.die.net/man/5/xinetd.conf