[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Remote port forwarding - only listen on IPv4



I'm using remote port forwarding, and only want to forward the IPv4-address.

My command:
$ ssh -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 60" -o
"StrictHostKeyChecking no" -N -p22 -R20000:localhost:22 myserver

I've used 'localhost' (as above), '127.0.0.1' and '*' in an attempt to
figure this out, but both IPv4 and IPv6 are always forwarded.

Example:

What I have:
$  ss -tuln
Netid  State   Recv-Q  Send-Q   Local Address:Port    Peer Address:Port Process
tcp    LISTEN  0       128            0.0.0.0:22         0.0.0.0:*
tcp    LISTEN  0       128            0.0.0.0:20000        0.0.0.0:*
tcp    LISTEN  0       128               [::]:20000           [::]:*

What I want:
$  ss -tuln
Netid  State   Recv-Q  Send-Q   Local Address:Port    Peer Address:Port Process
tcp    LISTEN  0       128            0.0.0.0:22         0.0.0.0:*
tcp    LISTEN  0       128            0.0.0.0:20000        0.0.0.0:*

Thanks for any hints.

Andreas


Reply to: