-1

i made some tests with verbose argument while initializing ssh tunnels, with a GOOD a WRONG destination address, but i didn't see a difference between good and bad ssh tunnel initialization.

when i launch my ssh tunnel with a reachable ip address, like that :

ssh -L 3338:<reachable-ip-adress>:4000 my-user@bastion1.amfinesoft.net

verbose mode returns to me :

debug1: Requesting forwarding of local forward LOCALHOST:3338 -> ip-adress:4000

AND when i launch my ssh tunnel with a UNREACHABLE ip address, like that :

ssh -L 3339:<unreachable-ip-adress>:4001 my-user@bastion1.amfinesoft.net

verbose mode returns to me the same output !

debug1: Requesting forwarding of local forward LOCALHOST:3339 -> ip-adress:4001

In the first test, i know my ssh tunnel is correctly intialized, but not the second test.

So, my question is : how to check, on my bastion1 machine, or on my localhost machine that desired ssh tunnel has beenn correctly initialized ?

1 Answers1

0

The tunnel was setup correctly in both cases, as the tunnel exists only between your local system and the system you ssh to (bastion1).

Setting up a tunnel will not check, if packets can actually be forwarded, as ssh has no knowledge on the protocol inside the tunnel and how forwarding works. Only once you send a packet through the tunnel and the sshd on bastion1.amfinesoft.net will try to forward it to the unreachable IP-Address, you will be able to see, whether or not your target address is reachable.

So to check if your tunnel is working, you need to check whether the target system can be reached, using the protocol you are tunnelling.

treuss
  • 1,913
  • 1
  • 15