Create Local Ssh Tunnel - multiple Ports

Hi all,

the documentation of the Create Local Ssh Tunnel says:

The keyword uses the existing connection to set up local port forwarding (the openssh -L option) from a local port through a tunneled connection to a destination reachable from the SSH server machine

My question is if it’s possible to have multiple “-L” commands in the Keyword?

Well i know about the -L option and i use it in my tests (not RF Test) - there i use the -L option along with the ssh command but in total i have 3 -L parameters. e.g.

ssh root@server1 -L 4711:server2:4711 -L 4712:server2:4712 -L 4713:server2:4713

My setup is the following:

[My client PC] —> SSh to [server1] —> Ssh to [server2]

So after i run the command above i can sent my traffic to my application running on server2 port 4713 in the way that i sent it to localhost:4713 and it will be forwarded throught the ssh tunnel between my client and server1 to the application on server2

Sadly server2 does not have any direct connection to my client - it only has a connection to server1.
Thus only an ssh between server1 ↔ server2 exists.

Now i have an application running on server2 on port 4713 and i need to connect to it from my client.

But how can i do this with Create Local Ssh Tunnel? From the example i see:

local_port: Any,
remote_host: Any,
remote_port: int = 22,
bind_address: Any = None) -> None

So local port can be “Any” so i could have a list having multiple local ports like @port= {4711, 4712, 4713} - this would be the same as -L $port[2]:

But the remote_port is an int which default is 22 - i can overwrite it to e.g. 4713 but this would give me only the single tunnel to: -L 4713:server2:4713

But i also need to connect to other ports 4711 and 4712 not only 4713.
Thus now (without RF) i use the above command and then i can do
ssh root@localhost -p 4711 or -p 4712 or -p 4713 and can connect the the server2 applications running on the defined ports. So in total i have 3 applications running on server2

Any ideas?
Br,
Camil

Have not tried yet but maybe i just have to call the Keyword 3 times each with the port setting i want to.
So to have the equivalent of:

ssh root@server1 -L 4711:server2:4711 -L 4712:server2:4712 -L 4713:server2:4713

i just have to do

Create Local Ssh Tunnel | 4711 | server2 | 4711 | bind_address=127.0.0.1
Create Local Ssh Tunnel | 4712 | server2 | 4712 | bind_address=127.0.0.1
Create Local Ssh Tunnel | 4713 | server2 | 4713 | bind_address=127.0.0.1