Using SSH to forward the same local port to multiple external hosts

Okay, this is kinda awesome :-), I got my geek on :-)

My application is connecting to a cluster of external servers but my application can configure hostname but can’t configure port.

So I wanted to connect to a remote cluster using SSH tunneling, but I was unable to forward everything because the port binding to localhost ( can only be used once.

Then I saw that you can use multiple loopback addresses! See this page:

Basically you can bind the portforward to, till, that should provide enough addresses, right!? :-)

So I can use multiple port forwards from my localhost(s) to the six remote hosts like this:

ssh \
-L \
-L \
-L \
-L \
-L \

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s