5

The setup is as follows:

Computer A (behind a firewall with open SSH port 22)

  • OS: Windows 10
  • Installed Putty

Computer B (outside firewall, full admin rights)

  • Raspberry Pi
  • OpenSSH installed
  • A working SSH account accessible from computer A

How can one re-route all internet traffic (not only browsers but all applications) on computer A though an SSH tunel to computer B. For example, if an application on computer A accesses web-address X on port Y, the request should be automatically SSD-tuneled through port 22 to computer B from which X:Y is then accessed. The same should apply for any back-channel traffic.

Addresses X and ports Y can by any possible, and are not predefined.

Setting up the tunel for specific ports in Putty on computer A has been tried but there seems to be no re-routing happening. How can one "tell" to application to use the SSH-tunel and not try to usual routing?

1
  • SSH port forwarding is limited to TCP (no UDP) and to the specific ports that you've arranged to forward. To get what you're asking for here, you would need a VPN between systems A and B. You could probably tunnel the VPN through SSH if you wanted to. OpenBSD SSH has some support for forwarding a network interface; here's a writeup about getting it to run on Linux. I don't know how or if you can get it working with putty in windows.
    – Kenster
    Jan 2, 2018 at 14:27

1 Answer 1

1

You need to create an SSH tunnel and use a SOCKS proxy as system-wide settings. Please note that this will work for proxy-aware applications, and there may be some apps that won't be able to work with this setting.

  1. Create a SSH profile to your SSH remote server. Then go to Connection -> SSH -> Tunnels and setup a dynamic SSH tunnel as in the image below. Make sure the dynamic port is not used (e.g. use a high port or check using netstat -an, making sure the port is free).

Setup a dynamic SSH tunnel in PuTTY

  1. Configure system-wide proxy settings to use the SOCKS proxy by setting localhost as the proxy server (or 127.0.0.1) and the dynamic port number you used in the above setting (e.g. 8910 as in the image).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .