I'm trying to use an ssh tunnel from a remote location to connect to my home network and access the router web interface.

I have SSH access to the home network, and I can connect to the gateway machine "Lounge". (e.g.

What would I need to do to proxy web requests to the router ( on the home network, via "Lounge", so that I can view it from the remote location?

If it makes a difference, the "Lounge" machine is running OS X.

I want an ssh / command-line only solution to this, thanks.


Download putty if you don't already have it, the format you need for this is:

putty -ssh username@publicip -pw password -L localport:privateip:destinationport

Here is what you would use to get to remotely through SSH:

putty -ssh username@publicip -pw password -L 8080:

You could then open up a web browser to on the computer you created the tunnel with and up would pop the router interface.

| improve this answer | |
  • 1
    putty is cross platform, I have done this from a linux box as well as from a windows box, and I have done it through many operating systems. The operating system should not matter on the SSH server or on the client you are using to connect. – MaQleod Aug 31 '11 at 6:27
  • If I do that, I get redirected to the router page of my current network (Not the remote one). If I do it with every other webpage, it works. Any solution? – Emanuel Graf Oct 8 '19 at 13:54

The straight ssh command for this without puTTY is...

ssh user@host -L localport:routerip:remoteport

and then open http://localhost:localport in your browser.

Thanks to MaQleod for showing me the ssh switches.

(P.S. Don't go putting passwords in plaintext! avoid the -pw switch)

| improve this answer | |

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.