Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

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

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

    
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
add comment

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).

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

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

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.