3

I have the following scenario:

  • Host A: Mi machine
  • Host B: Server - 192.168.1.1
  • Host C: Hop node - 192.168.2.1
  • Network N: 192.168.3.0/24

Using sshuttle what's the best way to forward and be able to reach machines of network N (192.168.3.0/24) from Machine A, passing thru B and C?

I can actually run:

sshuttle -r [email protected] -v 192.168.3.0/24 &
ssh [email protected]
sshuttle -r root@$192.168.2.1 -v 192.168.3.0/24 &

If I open in the browser for example http://192.168.3.5 from Machine A I'm receiving the TCP packages in the destination node, but not getting routed correctly the answer.

2 Answers 2

3

Use ProxyCommand like for every other multi-hop setup. Create a file ~/.ssh/config with

Host B
  Hostname 192.168.1.1
  User root
Host C
  Hostname 192.168.2.1
  User root
  ProxyCommand ssh -W %h:%p B

Then just connect using sshuttle:

sshuttle -r C -v 192.168.3.0/24 &
3
  • I tried also using ProxyCommand but wasn't making the jump to the other node. Commenting the ProxyCommand line allows to forward the traffic to the host B, but then, if using ProxyCommand the connection hangs when routing to C.
    – ccamacho
    Jan 17, 2017 at 12:10
  • Remember that A can only see B can only see C can only see 192.168.3.0/24
    – ccamacho
    Jan 17, 2017 at 12:18
  • So then it is the other way then you described (A -> B -> C). Edited the answer.
    – Jakuje
    Jan 17, 2017 at 12:24
0
sshuttle -r user@targetMachine -e 'ssh -J jumpHost1,jumpHost2' <forwardedNetwork>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .