I have a very limited understanding of computer networking, so my terminology will probably be incorrect in places, but let me try to explain the situation as clearly, general, and accurately as possible.

The set-up is as follows:

An Application with native socks support is configured to connect to a proxy server listening locally (the proxy server in this case is PuTTY with dynamic tunnel enabled), which tunnels via SSH to a remote server that, in turn, connects to the destination.

This works fine when the software on the local machine is acting as a client, i.e. it is initiating the connections, but if the software needs to receive incoming connections, it does not work because connections are made to the remote tunnel server, which does not know what to do with said connections and subsequently drops them.

The remote server and local server are running GNU/Linux and Windows respectively.

My question is, how can I make it so that the remote tunnel server forwards connections it receives on a certain port to my local machine? Preferably over the existing SSH connection if possible.

  • What about setting up a VPN and forwarding incoming connections to local machine's VPN IP? – dusty Mar 5 '11 at 16:50

ssh calls this a "reverse port forwarding"; in OpenSSH this is the -R command line option, in PuTTY this is done by selecting the "Remote" option for the port forwarding. Note that the ssh server must gave GatewayPorts yes in its sshd_config for other machines to be able to connect to the forwarding socket on the remote.


You don't seem to have a "very limited understanding of computer networking". TCP connections should work fine over a socks tunnel. But if the application uses UDP, that won't work over the tunnel without a more sophisticated setup. What application is it that you're trying to use over the tunnel?

Your Answer

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

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