Fixing Remote Access for Plex in pfSense

Fixing Remote Access for Plex in pfSense
So I’m an avid user of plex and am a plexpass subscriber. I travel a lot for work and it’s so convenient for me to just watch films, TV shows and even live TV on my ipad or phone when I’m out and about. I am running plex media server on my windows 10 machine and that’s pointed at a share that’s on my server. I was initially using plexinc/pms-docker on the server (Ubuntu 19.10), but i was suffering from some various shortages and am in the midst of rebuilding a new server, so I opted to run the applet on my main windows machine for now. Everything was working perfectly, except the windows based PMS (plex media server) was unable to access the internet properly. I connect to several servers around the world, one is in my home country, others are back ups that I have abroad. All work perfectly well with plexpass, so it was frustrating that I couldn’t access this PMS from outside my own LAN. Even internally on the LAN I was having dropouts etc! I did some research and eventually came up with a solution. It appears that my pfsense install (2.4.4-RELEASE-p3 (amd64)) needed further configuring to allow it to go through. These are the steps I took to remedy it. Please note i’ve redacted various IP addresses and other settings from the pictures for security reasons. Even it it’s just an internal IP address (i.e. 192.168…..) I do this for good practice.  
  1. In order to get past the block that I think my ISP was placing. I needed to add two rules. Firstly I needed to port forward anything coming in on port 32400 to my internal machine where PMS is running. (IP’s blanked for security). The rule says literally anything coming in on the WAN address pushes forward to MY.PMS.SERVER.ADDRESS
  2. Then I needed to add a rule to pass the other way. Anything from MY.PMS.SERVER.ADDRESS: 32400 to go out to the WAN.
  3. I needed to add a specific entry in the DNS resolver
See below for the rules in detail. I always find this is helpful for those not that familiar with pfSense.
Plex Wan rules
Plex Wan rules
Nat plexpass forwarding rule WAN to LAN
Nat plexpass forwarding rule WAN to LAN
 
Nat plexpass forwarding rule - LAN to WAN
Nat plexpass forwarding rule – LAN to WAN
 
Plex DNS Resolver Setting
Plex DNS Resolver Setting
  Now this last part where you add the custom option to the resolver was necessary because without this, Plex has to use a remote connection even if everything is within the LAN. This is a feature of DNS rebinding in pfSense. Am sure there are many experts out there that can rephrase this more accurately, but I added it anyway. I was told without this rule, i would end up with a relay connection and the bandwidth would be extremely limited. Once this was added, I went into the PMS configuration options and went to the entry remote access:
Plex Remote Access Settings
Plex Remote Access Settings
I disabled remote access, specified the public port manually and hit apply. When I enabled remote access again, the status went green and plex was now available outside of the LAN and it immediately fixed my dropouts (missing server, lagging etc) within the LAN. I’ve had no issues since then. Now if anyone thinks i’ve made a grave error, or there are better/more secure ways to achieve the same, then please let me know in the comments. Hopefully this is useful for some of you! Cheers  

Comments

  1. i have this setup going, but occasionally it says :
    Not available outside your network
    Your server is signed in to Plex, but is not reachable from outside your network. Learn more

    however people can still connect so i think its just plex on crack

  2. I have tried this but it doesn’t work for me. I think my issue may be my BT router as it doesn’t have a modem only option. I can disable DHCP but apparently it still NATS and other stuff anyways which result in duplication which may be the issue. It is a BT Smart Home Hub 2. Any suggestions apart from getting a router that does support modem only?

    1. You’re using pfsense right? I haven’t had a BT router for yonks so am probably the wrong person to ask on that. My main internet connection is a 4g modem at the moment as we are living remotely. I have CG NAT and the only way I got around that was to use tailscale, which is awesome.

      I’m able to still access Plex despite the CG NAT though, but if I wasn’t able to, I’d probably look to use the tailscale IP address it gives you to try and connect to Plex directly that way. I don’t even need port forwards with tailscale but I’ve never needed to or tried to throw plex over it.

  3. All good, worked like a charm (even without DNS resolver part)! I have no issues playing 4K in my LAN and app is working fine outside my network too 😉

Leave a Reply