Port Forwarding - Multiple Hops? - WeOnlyDo Discussion board

Port Forwarding - Multiple Hops? (wodSSHTunnel)

by Mike, Wednesday, October 08, 2014, 23:13 (3459 days ago)

I need to create a tunnel through multiple servers, something i haven't been able to accomplish with other SSH libraries.

I am trying to use Local Port Forwarding connecting my Desktop to a Windows server. Once connected, i am trying to continue the Port forwarding to an end device. This device is connected to a router ie. ANDA . It has a web interface I want to browse it on my Desktop.

Of course, i can do this with Putty successfully.

1. First connecting my desktop to the first server by creating a forwarded port

L9998 127.0.0.1:9997

2. Once SSH session is connecting on Windows server i run the SSH Command.

ssh -L - <[listenaddress:]listenport:remotehost:remoteport>
ssh -L 9997:192.168.1.10:443 admin@99.99.99.00

3. Once logged in to end device, i launch a browser on localhost and success!
https:127.0.0.1:9998


Trying to do this multi-hop with the port forwarding is unsuccessful. I create a standard local port forwarding to the Windows jump server with the SSH.NET library and then try and execute the SSL -L command. This gets me into the ssh connection to the end device, but i seem to lose the SSH tunnel or socket and get a channel error when i try and launch the browser on the bound port.

Is this multiple hop tunnel scenerio possible with this library?

Port Forwarding - Multiple Hops?

by wodSupport, Thursday, October 09, 2014, 02:06 (3459 days ago) @ Mike

Mike,

hi. If you're making two SSH connections then this will work. You should connect with SSH.NET and execute 'ssh -L ... ' to make the tunnel.

Then connect with wodSSHTunnel and open tunnel between your desktop and this server. You could 'plug in' Putty, just for a test, to see if this works ok.

I'm not sure why you're losing wodSSHTunnel, perhaps you didn't fire up it correctly? If you try, for a test, local port forwarding between your desktop and, for example, www.google.com over wodSSHTunnel, does that work?

Kreso

Port Forwarding - Multiple Hops?

by Mike, Monday, October 20, 2014, 17:12 (3447 days ago) @ wodSupport

I was able to solve this using wodSSHTunnel using the first jump server as a ProxyServer