Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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! :)

share|improve this question
add comment

1 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/
share|improve this answer
    
This works well with non SSL web interface. With SSL enabled web it does not seems to work. –  chandank Feb 21 '13 at 23:38
    
I use SSH port forwarding to connect to SSL servers all the time (I did it this morning, in fact). Note that if SSL is enabled you will need to change the ports above to match the SSL ports on your device (probably port 443, but some vendors chose another port). –  Stefan Lasiewski Feb 21 '13 at 23:55
    
Thanks, It later worked for me too. I was just making typo error. Thanks anyways for getting back on this. –  chandank Feb 22 '13 at 17:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.