How to Torture your Kids from Anywhere

David Blume
2 min readAug 10, 2018

--

I can log in to my home’s router from anywhere and configure the local network as needed, including stopping YouTube and Netflix when the kids need to do homework.

tl;dr Use port forwarding and ssh tunneling

I have a Raspberry Pi at home serving a website. My Internet Service Provider assigns my home’s IP address dynamically. So that Pi also updates a name server so that the website can always be found with a name. (My Asus router can also do this with a subdomain at asuscomm.com.)

I recently realized I could use port forwarding to my Pi to get to the Router’s admin page when I’m away from home. Here’s the recipe for the setup at home:

  1. Ensure your Pi has a wired connection to the router. You may eventually want to turn off Wi-Fi to really annoy the kids, but you don’t want to lose the connection to your Pi.
  2. On the Pi, enable only ssh key-based authentication. (If you allow for username and password login, you’ll get lots attempts at logins from remote hackers. Key-based login is better anyway.)
  3. On the router, map a static IP address to the Pi.
  4. On the router, port forward incoming ssh connections to the Pi.
  5. Make a note of the local IP address of the router. (Say, 192.168.1.1)

Now, when you need to see you home’s network when you’re away from home, you’ll use ssh tunneling to the router’s admin page.

From your laptop, ssh connect to your Raspberry Pi at the domain name that points to it, and pass in parameters for the -L port forwarding command. Say, forward local port 8080 to 192.168.1.1 port 80 at the ssh server, the Pi.

ssh admin@my.ddnsaddress.net -L 8080:192.168.1.1:80

When the connection is successful, then when you set your browser to localhost on port 8080, the request will be tunneled to the Pi, which will forward it to 192.168.1.1, default HTTP port 80.

http://localhost:8080

Et voilà, you’ll see your home’s Router’s admin page. You’ll be able fix network issues or impose rules to make sure everybody gets their homework done.

When you quit the ssh session, then the tunnel closes. That’s what makes this better than many other options for remote controlling the local network.

--

--

David Blume

A rock-climbing father of two and software developer.