I want to connect (using ssh) two remote computers in a local network using a unique public IP X.X.X.X.
| HOST_A---------| 184.108.40.206 | _____________ |---------|ROUTER PUBLIC|-----------|INTERNET|-------------|CLIENT | _______________ | 220.127.116.11 X.X.X.X HOST_B---------| 18.104.22.168 |
My public IP has restriction in port 22 so I'm using the port 1234. The router port-forwarding 1234 is enable and directed to HOST_A. Currently, I can access to HOST_B from client executing
$ ssh -p 1234 user@X.X.X.X
Howerver, I can not access to HOST_B and I don't understand how to use -R and -L option of ssh. I read and follow many examples in the web and I can not achieve HOST_B without login in HOST_A previously.
I appreaciate an explanation about TCP-forwarding because I'm not sure about if it is possible to login in HOST_B using the ip X.X.X.X without configuring HOST_A.
An instance of my search: How to setup ssh tunnel to forward ssh?