I have a Raspi that I want to access on my vacation home. It's on a local network behind a CGNAT router (that is, with no possibility to forward ports on the router) but since it has internet access, I have set up a reverse tunnel to a second Raspi on a local network at home. This second local network is connected to internet through a router with port forwarding capability. The setup as well as the sequence to follow to connect to the remote Raspi can be visualized on the image enclosed:
This setup works fine, but it implies ssh access from A to Raspi B, and from B, to shh to Raspi C (the remote one).
Trying to get rid of the need to login on common server B, I have setup a second schema forwarding port 22 from B to C, so as to be able to ssh directly from A to C:
However, there is something wrong with this second approach because I cannot ssh to C directly from A. I realize that the problem comes from redirecting port 22 in B and C which is the same port used to setup the reverse tunnel, but I do not see how to redirect ports so as to be able to ssh directly from A to C.
Any idea of how to do this ?
Thanks and best regards