Ssh – access router web interface from outside (have ssh access to machine inside)

networkingPROXYremote-accessrouterssh

I'm trying to access my router web interface remotely, but I don't have access to the router for another few months (traveling).

internally, my ubuntu server's IP is [192.168.1.111]. My router IP is [192.168.1.1]

let's say the domain name example.com forwards to my router (WAN IP). I currently have port 80 fwd'ed to 192.168.1.111. (I also have port 22 fwd'ed).

Can I set SSH up on my Ubuntu server (or something else) that will allow me to fwd back to the router (192.168.1.1)?

Basically I want to put in "example.com" on my laptop (in another country) and see my router's web interface.

Thanks! 🙂

Best Answer

You must allow SSH port forwarding on your router, so that external hosts can SSH to a host inside your network. You must also be careful to secure the machine inside your network, and use a strong password.

  1. Determine the IP address of your broadband connection. I use DynDNS.org on my router, so that I just need to remember a hostname, not an IP. Most broadband connections use DHCP, so the IP address will change. DynDNS will update your hostname to point to the new IP address.

  2. Connect to your router using SSH tunneling, like this:

    externalhost % ssh -L 10080:192.168.1.1:80 yourhostname.dyndns.org

This will create an SSH connection from your local host to yourhostname.dyndns.org (which is a host inside your network). The '-L' will create a SSH tunnel from port 10080 to the router at 192.168.1.1 port 80.

  1. Then with your browser, connect to http://localhost:10080/
Related Topic