[GLLUG] ssh local port forwarding remote interface binding.

damion.yates at gmail.com damion.yates at gmail.com
Thu Jan 14 17:05:18 UTC 2021

On Thu, 14 Jan 2021, damion.yates at gmail.com wrote:

> On Thu, 14 Jan 2021, Tim Woodall via GLLUG wrote:
>> In
>> ssh -N -L 8080:webserver:80 gateway
>> Is there any way to specify which interface should be bound on gateway 
>> other than by changing the routing table on gateway?
> I found
> https://unix.stackexchange.com/questions/16057/use-ssh-with-a-specific-network-interface
> And my ssh manpage has indeed got a -b to change the bind address on 
> your initial outgoing connection and also -B to change bind interface. 
> The rest about binding for the listening onb a fwd is indeed not 
> helping your cause.

Ah I misunderstood.  You want the machine called "gateway" to bind 
against a specific interface when doing the forwarding.  I had assumed 
this to be done by your choice of IP in the portion before the first 
port the "webserver" being remote and the part you want to route out to 
but I think I can see the issue now.  How do make sshd choose to use a 
particular binding for a host.  I can't see a -b in man sshd but man 
sshd_config does have GatewayPorts.  Otherwise route update or socat 
sound reasonable.

  - Damion

  - Damion

More information about the GLLUG mailing list