Plex over double NAT

digital-oceanplexport-forwarding

I am attempting to get around my ISPs carrier grade NAT and still be able to access my plex server from outside.

I found two guides:

http://www.donaldsimpson.co.uk/2016/10/24/tunneling-out-of-carrier-grade-nat-cgnat-with-ssh-and-aws/

https://amoss.me/2017/05/port-forwarding-behind-a-carrier-grade-nat/

To implement I have an ubuntu 16.04 VM hosted by digitalocean, which has a public IP. I can ssh from my plex server (also ubuntu 16.04) to the remote digital ocean server.

On my Plex server I run the following command:

ssh -nNTv -R 32400:localhost:32400 root@<public IP of remote host>

And leave that running in a screen.

The tunnel is successful. From the remote host here is netstat and nc -v to the loopback interface:

root@Ubuntu1604:~/.ssh# nc -v 127.0.0.1 32400
Connection to 127.0.0.1 32400 port [tcp/*] succeeded!

root@Ubuntu1604:~/.ssh# netstat -tln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.1:32400         0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp6       0      0 ::1:32400               :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
root@Ubuntu1604:~/.ssh# 

But as you can see, it is not listening on its public IP The only other active interface besides loopback is eth0, which is assigned the public IP address. So if I attempt to access remote server public IP:32400 I get nothing.

How do I get my remote server to be listening on 32400 eth0, while still forwarding that to my localserver:32400?

Best Answer

I already had an empty bind address, the problem was I needed to specify to bind to all addresses, like this:

ssh -nNTv -R 0.0.0.0:32400:localhost:32400 root@<public IP of remote host>
Related Question