I'm doing the following:

% autossh -i YYY.pem XXX@SERVER -N -R 90:localhost:9000 -o ServerAliveInterval=30

to forward a server port from the local machine to the public machine.

But connections are originating from on the local machine now. How do I forward the port so that connections appear to originate from their true IP?

For example, I have a echo listener that sits on port 9000. Whenever it gets a connection it prints the IP of the origin. Right now, it prints out over and over.

  • I spent about 8 hours yesterday trying to find the answer to this, and I'm not sure there is one. I figured out how to forward with iptables dnat & ssh -w, but then the ip is hidden with a different ip. I tried making a bridge with tun0 but somehow it is not allowed. I've been trying a "route add" but this also does not work. I'm stuck if anyone has hints I would be interested. Mar 22 '13 at 13:14
  • i've tried making a tap0 bridge with openvpn but still to no avail Mar 22 '13 at 21:41
  • If I understand what you're trying to do here, you want to expose a port (90) that is on your FW (aka. SERVER), and direct any connections on port 90 to an internal server's port 9000? But you're initiating this setup from the host who's port 9000 is listening?
    – slm
    Mar 28 '13 at 5:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.