I have the following problem. From machine A I connect to machine B over the internet via ssh and port forwarding. Machine B is part of my local network and has connection to machine C which acts as a server inside the LAN.

A --------- | ---- B ---- C
  INTERNET GW        LAN      

Now I want to start a program on A that needs access to C without using a vpn connection. I tried ssh tunneling:

#user@A: ssh -N user@B -L 9999:B:9999

But when I start the program on A it cant connect to C. I guess it has something to do with A not having a route to C because it has only a local address (192.168.something) . How can I find out whats going wrong?


This is what you need.

#user@A: ssh -N user@B -L 9999:C:9999

When you connect from A with telnet

#user@A: telnet localhost 9999
  • Still i get a No route to host error when i try to telnet C 9999 – greole Mar 1 '14 at 10:52
  • Updated with telnet command – X Tian Mar 1 '14 at 11:19
  • @greole of course. From A you should telnet A 9999 or localhost 9999 – user55518 Mar 1 '14 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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