Docker remote access always indirect

Server Version#: 1.27.0.5897
Player Version#: not sure

I have installed plex through docker, when I try to use remote access my streams are always indirect but are ok on the same network.
I am using a custom router software openWRT which is Linux-based, and I’m not sure what I’m doing wrong, I have tried port forwarding external (WAN) IP to internal (LAN) IP 172.17.0.2 but it still doesn’t seem to work.

docker IP 172.17.0.1
plex docker IP 172.17.0.2
router IP 192.168.100.1

Assuming a fairly typical setup, that’s not a LAN IP address. Your router is supplying IP addresses in the 192.168.100.x range (assuming a /24 which is typical). It will only know how to route to addresses in this range on the LAN side and go to the WAN for all other addresses.

@Shengis

The 172.17.0.1 address you show is a different subnet than your router’s 192.168.100.x. It’s still a RFC-1918 private address but being a different subnet is the root of having indirect (no direct connection possible).

If you look at the number of translations:

WAN IP → 192.168.100.x → 172.17.0.1 .

This is 2 translations. It’s known as Double NAT (Network Address Translation).

PMS will not work in this configuration unless you account for both layers of translation by creating two forwarding rules .

If I may suggest an easier method?

  1. Is it possible to setup your docker using HOST networking?
  2. If you can, the docker container will share the same LAN IP as the computer.
  3. This reduces the number of translations to 1 and Remote Access can then work with ease.

I think I can try a HOST networking but I kinda want to keep all my server info, are there any drawbacks to setting up 2 forwarding rules?
i assumes it
WAN IP - 192.168.100.1:32400 - 172.17.0.2:32400 ?

@Shengis

If your modem/router allows you to setup a port forwarding rule that way then it should work but most do not which is why I suggest using HOST networking in the container

Ohk, I think I’m going to try that first cos I have a pretty advanced router system.


I’m pretty noob when it comes to networking but in the picture im forwarding
external port (wan) 32400 to Internal (Lan) 192.168.100.1:32400,
then external port (LAN) 192.168.100.1:32400 to internal (docker) 172.17.0.2:32400
not sure if it’s correct.

also, my router is connected to a modem would I have to port forward the modem too?

What is that a screenshot of? Is it OpenWRT?

Do note that it is highly unlikely that your computer’s IP address is 192.168.100.1 as this is typically the kind of address that a router would have and furthermore it is the exact address used by many modems. In your first post you stated that this is the IP address of your router.

You want to configure your router to forward port 32400 on the WAN to the LAN IP address of your computer running docker (on port 32400). THIS IS NOT the IP address of your router! You should have NO forwarding rules using the docker IP address in the router configuration.
Then configure the server’s setting Custom server access URLs to http://LAN_IP_ADDRESS:32400.

After saying all that, you are likely better off using host-based communication. Docker’s (horribly inaccurately named) bridged networking (which is the default) is really not designed for a service such a the Plex Media Server.

Hi I’ll try what you suggested, and yes this is OpenWRT but a custom build, I’m actually running the plex server on the router, I’m also going to get some help with my router guys if all else fails then I’ll try the host mode and just for information sake how different is the host config compared to the bridge version ?

Wait, you are running docker on the router? That’s not the configuration I was expecting in all of this and so my previous comments may not apply here. You may not be better off using host networking in this case. I would presume that docker is configured to only interact with the LAN side of the network. If that’s true, then you just need to make sure that port 32400 from the WAN is also forwarded to the docker container. It depends on the intricate details of how the networking works here to exactly how to configure this so I’m not sure I can tell you what you need to do.

ohk, so I’ve made some changes to my network, I realize that I was connecting my modem to my OpenWrt router so It didn’t matter what port I forwarded. it just wouldn’t work.
so right now my Openwrt router is connected directly to the net, and I’m using a HOST network PLEX but remote access is still not working I’ve tried WAN port to LAN as well as WAN port to Docker port. nothing works.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.