On network A
we have hosts 192.168.0.1
, 192.168.0.2
and 192.168.0.3
. On a separate physical network B
I want the above hosts to appear to be on the local network for a set of specific ports (same ports on all the hosts).
I have got a working SSH connection (Client on A
, Server on B
) and the host on B
has GatewayPorts=clientspecified
(and service restarted).
The host on B
has multiple IP addresses defined that match the ones above.
The SSH connection is opened with -R 192.168.0.1:1234:192.168.0.1:1234 -R 192.168.0.2:1234:192.168.0.2:1234 -R 192.168.0.2:1234:192.168.0.2:1234
According to -v
the ports are successfully bound.
Opening a connection from any host on Network B
to any of the mentioned addresses on port 1234
always connects to the same host on network A
- i.e. not (necessarily) the one wanted.
According to -v
the incoming connection is on the correct IP address but it forwards to the wrong one.
Is this a bug in SSH or am I doing something wrong?
Please see the diagram here (I can't post an image apparently) http://dev.dj-djl.com/images/port%20forwarding%20over%20ssh.png
netstat -anp | grep :1234
on the ssh server show? - how are the machines on192.168.1.x
routing to192.168.0.x
?