Here's a thing: I have a piece of software listening on 127.0.0.1:port and only (I can choose the port). I want it to work as a server and accept connections from outer network. How can I forward the communication from (e.g.) 192.168.0.1:port to 127.0.0.1:port?

I am using Ubuntu 11.04. Tried to look into iptables, but they don't actually offer the thing I want to archieve.

link|improve this question
rinetd (ubuntugeek.com/…) looks like exactly something I want - except it needs to be downloaded and installed. I am looking for a system-settings solution. Hope there's one – Corkscreewe May 9 '11 at 21:50
feedback

migrated from stackoverflow.com May 10 '11 at 12:34

This question came from our site for professional and enthusiast programmers.

3 Answers

You should change the ip address that the software is listening on.

If you bind it to the ip 0.0.0.0 and port 80, then it will be able to listen on all interfaces (127.0.0.1 and 192.168.0.1).

link|improve this answer
I wish I could do that. Can't modify its settings though – Corkscreewe May 9 '11 at 21:36
feedback

You can easily make a tunnel using SSH.

something like: ssh -L 3307:192.168.0.1:3306 user@127.0.0.1 will tunnel traffic from port 127.0.0.1:3306 to 192.168.0.1:3307

link|improve this answer
feedback

You can do this in your firewall (you should be using one). I use Firestarter and it has an easy interface for forwarding ports.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown