I discovered sshuttle today, and I must say it's a great tool. If I wish to forward some container subnets from my dedicated server to be locally accessible, it makes life much easier when developing remotely.

Installing sshuttle

On Mac, it's as simple as:

brew install sshuttle

Next, you can write a simple shell wrapper for the subnets you wish to forward from your host, suppose the host is 142.1.1.1 and I wish to forward all 10/8 to my local machine over sshuttle, I can write this below script and execute it which will make 10/8 resolvable for me:

#!/bin/bash
set -e
sshuttle -r [email protected] $1 $2 $3 $4

I've added 4 optional parameters to support up to 4 networks to forward, now by running the next command you will have the networks exposed to you locally:

sshuttlebox 10.0.0.0/8

And there we go, it works!

Mike

Senior Software Engineer, Labber, Sysadmin. I make things scale rapidly. Optimize everything.

Read More