Well, I might have found a way after some testing, but i dont know is this is much of a practical solution.
I did this:
1. Established a tunnel from the gateway to the ssh server. Check that it works.
2. Established a new tunnel from the workstation and into the gateway and addressed gateway localhost (I used Putty). (Connect the tunnel from your client to the tunnel from the gateway.)
I addressed this way on my client localhost:portnumber this request is sendt further on to the localhost:portnumber on the gateway and from there trough the ssh server and out where it is addressed from the ssh server.
But would this help at all to connect two tunnels this way (Via the gateway) ? Possibly it would be just as easy to use one (tree) tunnel(s) from each workstation to the external ssh server ?
Adressing on my client for using the connected tunnels like this:
http://localhost:83/Two alternative ways:
client-ssh-tunnel-------Gateway---new ssh tunnel originated from gateway--ssh-server--target
client-ssh-tunnel-------Gateway---same ssh tunnel after nat--ssh server--target
Could not get this working:
client ----Gateway in--DNAT-to-tunnel--Gateway out---ssh-server--target
This is a description of the same limitations as I found, when playning a little bit:
http://utcc.utoronto.ca/~cks/space/blog/linux/IptablesLimitation