I have the following system scenario, where host A (88.12.0.1) and host B (193.11.8.1) are only connected via SSH. On Host B (+172.17.0.2) there is a Docker container running with IP 172.17.0.3.
Now I have an application on host A that has to communicate with an application on Host B (port 22222) and an application on the container (port 22223).
Another application on Host A (port 8081) is running as a server which has to be contacted by the Docker container application.
So far I have managed to forward the traffic only from Host A to B by setting up the following rules on Host A:
ssh -NL 22222:193.11.8.1:22222 [email protected] -v
ssh -NL 22223:193.11.8.1:22223 [email protected] -v
Only SSH is available as a port between Host A and Host B.
The first of the above rules works as it is, since it covers the first case of the application on Host A contacting application on Host B. The second rule is to forward the traffic that is meant for the docker container from Host A to Host B (but would need to be forwarded from there to the docker container).
The mapping on host B, should be that the incoming traffic that has destination port 22223 should be forwarded to the Docker container (172.17.03:22223). The Docker container when sending traffic to 8081 the traffic has to be forwarded to Host A at port 8081, through the Host B were the container is running on, the SSH channel that connects Host A and B to the server application running on Host A and port 8081.
ssh, onlysshport is open ? or what ?sshport to mapping between two different apps on the source and tow different apps on the destination ?