Plex Server - FreeNAS - pfSense - Port Forwarding problems

  • This is more of a description after the fact, rather than a question.

    I have been running Plex as a plugin on my FreeNAS server for months now without any problems. I recently changed my gateway router from an Apple Airport Extreme to instead using a pfSense virtual firewall. After that change I was no longer able to access my Plex server properly from outside my home network.

    I was perplexed because NAT and Firewall rules are concepts I'm very comfortable with and other NAT rules I created were working perfectly fine. I enabled UPnP NAT services and those wouldn't work either. It was all very odd. The firewall rules themselves were actually misleading because I was seeing destination networks that actually don't exist in my home network.

    Some of the errors I was receiving were:

    "myplex: published mapping state response was -52"

    "error issuing curl_easy_perform(handle): 52"

    "exception handled: boost: mutex unlock failed in pthread_mutex_unlock: operation not permitted"

    During my troubleshooting and looking at the Plex logs I noticed the NAT service seemed to keep getting hung in these weird states where the only fix was to stop all the services and restart them. In the Verbose logging I could see the UPnP NAT trying to register with the firewall and it would seem to register, but the return traffic from Plex to check and make sure it's working would fail and I'd have a half working session.

    What I was finally able to narrow it down to was this. I use Jumbo Frames on my LACP LAG's of the FreeNAS server and elsewhere in my network. Unfortunately the FreeNAS Plugin Jails seem to inherit the 9000 byte mtu on the jails' virtual nic. This seems to be causing trouble with the NAT service getting hung up. When I finally manually set the mtu down to 1500 and restarted the services, everything started working.

    This issue isn't entirely Plex's issue, but it is shared by all 3 vendors. The one thing I think that Plex could do better is to enhance the UPnP capability to not get into a mutex lock and to try and do a path mtu analysis to be more flexible with various network designs.

    Likewise, pfSense could handle the jumbo frames better to indicate they are being dropped. And FreeNAS should offer an easy way to set the MTU for a jail as opposed to just inherit the parent nic's Jumbo frame setting.

    I hope this helps others with similar scenarios.

  • Sorry to bring this thread up from the graveyard, however I wanted to inform others that this recommendation is what finally got me going.

    I recently upgraded hardware and did a fresh install of 2.2.6.    After nearly two weeks of seriously banging my head on NAT port forwarding not working, uPnP not working, multiple reinstalls (assuming I did something stupid, and scrambled pfSense's brains), I could not for the life of me get Plex to connect outside to the internet.

    I'm running Plex (Version as a plugin to Open Media Vault.  I noticed the only time it would publish properly was in that little window when filters were reloading.  I spent hours pouring through logs looking for some kind of clue, but turned up nothing every time.

    Finally, after finding this thread, I dropped my MTU from 9000 down to 1500 on the Open Media Vault interfaces, and BANG - connected right up.

    Hope this helps someone else.    I can finally go to sleep and dream about how I will fix the other problems I created…

  • I am having the same issue here with Plex server port forwarding. In my LAN all devices including smart TVs are able to view/access the content/file from my Plex media server without any problem, but my pfsense firewall/router not allowing my plex server to go outside of my local area network. I've configured port forwarding on NAT rule, etc.

    How do you change this settings (MTU) from the pfsense firewall?

    "Finally, after finding this thread, I dropped my MTU from 9000 down to 1500 on the Open Media Vault interfaces, and BANG - connected right up."

  • LAYER 8 Global Moderator

    Had you modified the MTU… standard mtu is 1500.. You would have to changed that for it NOT to be 1500.

    I highly doubt that is your issue.  Did you go through the standard port forwarding on pfsense - it really is just click click.  Is your pfsense behind a NAT?

    I highly suggest you go through

    I run plex, and I can tell you it is 10 seconds to create the port forward.. Did you actually enable remote access in plex? Are you running on the standard 32400 port?

    If you want it to use UPnP then you would have to enable that in pfsense.

  • My MTU issue was related to the Open Media Vault installation and loading Plex as a package on there.  When I built my OMV machine, I set the MTU to 9000 on the interface, which worked fine on previous versions of PfSense.  For some reason, this install of 2.2.6 didn't like it at all and as soon as I reduced the MTU on my OMV box, Plex was able to connect.

    I had gone through the troubleshooting guide, reinstalled Pfsense, etc numerous times thinking I was missing a step along the way, but didn't get anywhere until I tried this trick on my OMV machine.  Once that was don't, the NAT rule confg was smooth as butter.

    Hope that clarifies a little.

  • LAYER 8 Global Moderator

    "When I built my OMV machine, I set the MTU to 9000 on the interface"

    For what possible reason - is every other device on your network using jumbo??  If not then its completely pointless and just causes more overhead and complexes up the network for no reason at all.

  • All wired devices on my network are set to jumbo frames.

  • LAYER 8 Global Moderator

    That is normally quite difficult to do since consumer grade hardware rarely supports the same jumbo size, even if they do support it.  But if so - guess your good then.  But that is going to be a very odd reason why port forwarding doesn't work for like every other user.. Your setup is clearly going to one in a million sort of setup.

  • I have no idea what happened but I had the same issue. The Firewall  / Port Forwarding was setup correctly but it just simply refused to work.

    Set MTU in FreeNAS to 1500, restarted my jails and everything just starting working suddenly.

  • i actually stopped using freenas and moved to Ubuntu server (headless) and find Plex works a lot better on it and other features are supported

Log in to reply