I have a synology server behind an unconfigurable NAT, and a linux box behind a configurable NAT. I want to establish an autossh tunnel to mount an NFS drive (shared by the synology box) on the linux box.
From the synology box, I execute the following:
autossh -v -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -i /path/id_rsa -NL 2049:localhost:20049 [email protected] -p <forwarded_ssh_port>
However, I get the following error:
debug1: Local connections to LOCALHOST:2049 forwarded to remote address localhost:20049
debug1: Local forwarding listening on ::1 port 2049.
bind [::1]:2049: Address already in use
debug1: Local forwarding listening on 127.0.0.1 port 2049.
bind [127.0.0.1]:2049: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 2049
Could not request local forwarding.
Indeed (of course), NFS is listening on 2049 on the synology server:
user@synology:~$ netstat -plant|grep 2049
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp6 0 0 :::2049 :::* LISTEN -
Any thoughts on how to establish this tunnel, while avoiding the listening port conflict?
Thanks in advance...