I have a server at a remote location, which is on two subnets (i.e. it has two network interface cards NIC1 and NIC2, A is on e.g. 130.0.0.0, B is on 192.168.1.10). I can ssh in via A, which is outward facing.

How can I access resources in the subnet B from my home computer. E.g. I would like to access the switching hub of subnet B via its browser interface (192.168.1.0).

All machines are running Ubuntu 18.04.

I do not want to set up a VPN server on the remote machine (for security reasons). I would prefer to do everything over my existing SSH tunnel.

I know that I have previously been able to create a tun interface on my local (home) computer via ssh, using sshuttle:

sshuttle -r user@remoteserver 0.0.0.0/0 -vv --dns

However, this will direct my HTTP and HTTPS requests through the "normal" gateway of the remote server (I.e. I will access the internet normally with my IP showing up as the server's IP).

I want to go via the subnet B (to access via browser the switching hub's network interface).

Is there a direct way to do this or do I need to go about this in a different way?

up vote 0 down vote accepted

I was able to actually get this working using the original idea I had, with one trick: I had to enable ufw on my local machine. Otherwise sshuttle was erroring out.

So, on local machine, I did:

sudo ufw enable

Then,

sshuttle -r username@ipForSubnetA 0.0.0.0/0 -vv --dns

This actually (scarily?) allowed me to on my local machine access elements of subnet B.

The remote machine is quite locked down firewall-wise, only allowing SSH access via private key over one port.

If anyone knows any insecurities in sshuttle please feel free to tell me :)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.