Port forwarding, multiple IP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am quite confidently using tunnels to enable me to do some work from
home but have had some problems with the -b option.

I have a server with multiple RIP addresses & services already running
(mainly map).

The map server is bound to

What I want though is to tunnel my work map connection into my server
and bind it to and have it accessible on the local lan.

I have tried the following command line:

ssh -b -L 143:imapserver:143 -fgN username@server

But it still tries to bind to all interfaces, this results in a error
that it cannot bind to that address.

Am I doing this correctly or is my understanding of the -b option incorrect?

It also works fine when I shutdown the locally running map server.

Is there a way for this to work or will I need to use a different local
port and some iptables trickery.

Re: Port forwarding, multiple IP

You did not say what SSH software you're using; I will assume the current
OpenSSH.  The -b option affects the source socket of the SSH connection;
it has nothing to do with how the listening sockets for -L are bound.
There are only two options: all addresses (-g on) or loopback only (-g

The ssh.com client has the option you're looking for:
  ssh -L address:port:address:port ...

  Richard Silverman

Re: Port forwarding, multiple IP

Ahh, ok. Thanks.

Yes it was openSSH.

If that is the case then I think I will have to shuffle local ports and
use iptables to forward the ports and assign the interfaces. I was
hoping for an easier way :)

Richard E. Silverman wrote:

Quoted text here. Click to load it

Site Timeline