Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I create a remote port forwarding tunnel with Putty, a remote port opens on interface with ip On the remote host I'm able to nc localhost RPORT and forwarding works, but I'm unable to connect with nc RHOST RPORT. The problem is, that RPORT gets open on wrong interface -- localhost, instead of the public IP interface.

How can I setup remote port forwarding, so that I can connect from the internet, to RHOST:RPORT?

On RHOST, netstat -an | grep RPORT returns tcp 0 0* LISTEN

share|improve this question
@DmitriChubarov: I think you are confusing local forwarding with remote forwarding. Setup on your image would forward local port 3128 to a remote port proxy:3128. My problem is with remote -> local. – qwe Nov 8 '12 at 18:23

GatewayPorts needs to be set to on in sshd_config for the far side to allow others to connect to the forwarded port or you need to check 'Remote ports do the same (SSH-2 only)' in the PuTTY GUI to request that setting of the session.

If you wanted to forward from other hosts via PuTTY you need to check the 'Local ports accept connections from other hosts' setting.

share|improve this answer

Your Answer


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.