大网数据广告活动
服务器运维问答

Chaining sshuttle commands over two hops

· 52CE 我爱测

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…

问题原文

原帖链接 · ccamacho · CC BY-SA 3.0

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 omitted] -v 192.168.3.0/24 &
ssh [email omitted]
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.

已采纳解答

原帖链接 · Jakuje · CC BY-SA 3.0

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 &

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-01-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。