Using Plex Server with a VPN

I recently installed a VPN in my case CyberGhost VPN.  When it was activated I could no longer publish my server.  I searched far and wide for a solution, but could not find out how to exclude a port from a VPN.  It can be done with an IP address, but could not find instructions to exclude a port even with OpenVPN.  I was in Plex chat trying to help someone else with the same problem. He was using Private Internet Access and got a list of ports not forwarded by his VPN.  I remembered that my VPN did not run outgoing email through it's servers to prevent spammers from using their service to send anonymous email.  I set the Plex Server to use Port 110 and now it works when my VPN is running!  I did not even have to port forward the port.  You need to have advanced settings selected in your server settings and be in the MyPlex section to see the option to select a port. if you specify Manually specify port. then you won't even have to port forward the port though using port forwarding is still recommended.   Just add TCP port 110 to the list of Ports to Forward in your modem/router setup.  There may be a side benefit to this.  You may gain access to your server from work where many ports are blocked.  To date this has only been tested with CyberGhost VPN and Private Internet Access, but most VPN's should have a list of ports that do not run through the VPN.  if you get it working with a different VPN please post and say what port you used. Note: Changing the port to 110 does not effect the port Plex uses on your local LAN it is always 32400.

Hey Bruce, I struggled with the same issue and posted an alternative approach here:

http://forums.plexapp.com/index.php/topic/52551-plexsync-and-server-publishing/?p=373271

I have the same problem, posted here

I use Private Internet Access as well, changed port to 110, says server published successfully, though still unable to access library remotely. Unable to try with port forwarding 110 at this time as it is somebody else's router.

I've found this post on another forum which is a bit over my head

Thanks for any help 

https://www.privateinternetaccess.com/pages/client-support/

Port Forwarding

  • Enable port forwarding in the application by entering the Advanced area, enabling port forwarding and selecting one of the following gateways:

    Netherlands
    Switzerland
    Canada
    Romania

    After enabling port forwarding and re-connecting to one of the above gateways, please hover your mouse over the System Tray or Menu Bar icon to reveal the tooltip which will display the port number. You can then enter this port into your software.

    Port Forwarding reduces privacy. For maximum privacy, please keep port forwarding disabled.

Thanks cdevinely - have been doing that since the beginning, however.

I am currently struggling with this. I just signed up with Private Internet Access. Now my friend can no longer view my shared server. I've gone through all the steps above with no success. I'm on a MacMini running the latest version of OSX. I've set up port forwarding in Airport Utility using the port number I got from the steps on the PIA website

In Airport Utility, when setting up the port mapping, it asks for: Public UDP Ports, Public TCP Ports, Private IP Address, Private UDP Ports, Private UDP Ports. All of them I have set to the number I got from PIA except the Private IP, which is set to my computers static IP that I had previously assigned.

I feel like there should be other numbers in some of those boxes, but I am not a genius when it comes to networks. 

Any help would be greatly appreciated. I'm at the point where I'm ready to just cancel the VPN.

Having the same issue here since changing over to pfSense and running my Private Internet Access VPN (connected to the US server) directly on the router.  

Would like to raise a feature request of adding to the Advanced Section of myPlex the option of using a DynDNS address to publish one's IP address.

I am currently struggling with this. I just signed up with Private Internet Access. Now my friend can no longer view my shared server. I've gone through all the steps above with no success. I'm on a MacMini running the latest version of OSX. I've set up port forwarding in Airport Utility using the port number I got from the steps on the PIA website.
In Airport Utility, when setting up the port mapping, it asks for: Public UDP Ports, Public TCP Ports, Private IP Address, Private UDP Ports, Private UDP Ports. All of them I have set to the number I got from PIA except the Private IP, which is set to my computers static IP that I had previously assigned.
I feel like there should be other numbers in some of those boxes, but I am not a genius when it comes to networks.

Any help would be greatly appreciated. I'm at the point where I'm ready to just cancel the VPN.

https://www.privateinternetaccess.com/pages/client-support/

private internet access Port Forwarding

Enable port forwarding in the application by entering the Advanced area, enabling port forwarding and selecting one of the following gateways:

Netherlands
Switzerland
Canada
Romania

After enabling port forwarding and re-connecting to one of the above gateways, please hover your mouse over the System Tray or Menu Bar icon to reveal the tooltip which will display the port number. You can then enter this port into your software.

Did you type this port number into Plex in "Manually specify port", unplug/replug router & cable modem, then click "Publish Server"?

I use Toronto, CA.

Did you type this port number into Plex in "Manually specify port", unplug/replug router & cable modem, then click "Publish Server"?

I use Toronto, CA.

So you've gotten it to work? Weird that we're having trouble duplicating it. Do you put 32400 as the internal port in the PIA application or do you leave it blank? I still have hope!

So you've gotten it to work? Weird that we're having trouble duplicating it. Do you put 32400 as the internal port in the PIA application or do you leave it blank? I still have hope!

When I hover the mouse over the green PIA icon in the tray, it currently displays "Connected - CA Toronto [Port: 24050].

I type that port number into Plex ""Manually specify port", then click "Publish Server".  Wait  several seconds and it says it is published.

I do not type anything in the "Local Port" box in the PIA client.

I do not have any special setting in my router, like port forwarding, enable UPnP, etc.  Although I DID try everything in various forum suggestions for folks who couldn't get Plex to publish...like turn off all security software (especially firewall), etc.  nothing helped.  It was very frustrating.

I have only 'published' Plex twice, in case I ever wanted to use it.  Currently, I just use it at home on a Roku.

Afterthought:

I just tried it this morning and it wouldn't publish, even after 5-6 tries with the above settings!  I was trying to think what was 'different' the first two times that it worked?

Previously, I also had Vuze running (torrent-file sharing software), so I ran it and BAM...Plex would publish.

In Vuze, tools/options/connection there are two boxes to type in listening port number port.  Then 'advanced network settings' ...see attached files.

Maybe Vuze is opening up the port, which allows Plex to publish?

I really don't know...but the three times that I have been able to publish, Vuze was running.

EDIT:

Further 'experimenting' reveals...if Vuze is running I can publish, but NOT without Vuze running.

I hope this is helpful.

NOTE:

Others with this same problem.

https://www.privateinternetaccess.com/forum/index.php?p=/discussion/comment/3148#Comment_3148

https://www.privateinternetaccess.com/forum/index.php?p=/discussion/comment/3823#Comment_3823

Maybe submit a ticket to PIA Support?

I submitted a ticket to PIA customer service and this is their reply:

Thanks for contacting us. It is not possible to access a Plex server remotely when the Plex server is connected to our service. I apologize for the inconvenience.

Thanks,
Calien M, Level 1 Tech Support
Private Internet Access™

If anyone tries the Vuze program with the settings posted above, please share your findings?

I had to cancel my PIA service because their port forwarding service didn't work for Plex and my VNC server. I've been using VersaVPN for a little while now and they allow you to forward up to 4 ports as part of their paid service. Works perfectly with Plex so far. If you check it out and wish to sign up, use my affiliate link below. It would help me out :)

https://orders.versavpn.com/aff.php?aff=178

I've discovered that there is another way to get Plex to work with your VPN if you don't require Plex traffic to flow through your VPN. It requires creating a static route for the web address myPlex uses to resolve your machine's IP, effectively allowing Plex to bypass your VPN and use the IP of your ISP instead.

*Edit

This seems to work if you add a static route in the routing table of your PMS machine from my.plexapp.com to your default gateway.

*Edit 2

The static route to my.plexapp.com does NOT actually work as far as I can tell. What happens is that at boot, PMS connects to myPlex and maps to my ISP address and that IP sticks. It would be nice to know the IP or IP range that myPlex uses to resolve and publish PMS' IP so that static routing would work in this case. Devs?

I've discovered that there is another way to get Plex to work with your VPN if you don't require Plex traffic to flow through your VPN. It requires creating a static route for the web address myPlex uses to resolve your machine's IP, effectively allowing Plex to bypass your VPN and use the IP of your ISP instead.

*Edit

This seems to work if you add a static route in the routing table of your PMS machine from my.plexapp.com to your default gateway.

*Edit 2

The static route to my.plexapp.com does NOT actually work as far as I can tell. What happens is that at boot, PMS connects to myPlex and maps to my ISP address and that IP sticks. It would be nice to know the IP or IP range that myPlex uses to resolve and publish PMS' IP so that static routing would work in this case. Devs?

can you supply directions for this? thank you!!

can you supply directions for this? thank you!!

The directions are different based on what OS you are using. Google something like "permanent static route windows 7" for detailed instructions on static routing. The idea is to route requests from myPlex to resolve your server's IP to your default gateway (in my case, my router). We will also need the list of IPs myPlex uses to resolve PMS' IP as creating a static route for my.plexapp.com did not work as I originally thought.

I'm scouring the forums to see if this list exists, but any help from the Devs or someone in the know would be most appreciated.

Okay. Through some helpful suggestion on Plex Chat, I pinged my.plexapp.com repeatedly and collected IPs. If I find any more I'll update this list, but as of now adding static routes on my server machine that point the following IPs to my default gateway allows myPlex to bypass my VPN and resolve my server's IP correctly. I hope this helps some of you.

184.169.174.153

184.169.137.36

184.169.154.22

I sure can't get it to work. I tried using Vuze, and everything else suggested above with PIA VPN. ;(

Okay. Through some helpful suggestion on Plex Chat, I pinged my.plexapp.com repeatedly and collected IPs. If I find any more I'll update this list, but as of now adding static routes on my server machine that point the following IPs to my default gateway allows myPlex to bypass my VPN and resolve my server's IP correctly. I hope this helps some of you.

184.169.174.153

184.169.137.36

184.169.154.22

 @kidamnesiac  I did this using this tutorial for mountain lion http://nellen.it/blog/2012/01/permanent-static-routes-for-mac-os-x/

Rebooted router, rebooted media server that runs PMS, republished server, then connected VPN...

still unable to connect from outside my local network, say for example my ios device on 4g

I'm posting in case anyone wanted to try and duplicate my results...

Those instructions look good aside from some of the unnecessary arguments they use with their route commands. Try making your AddRoutes file like this.
#!/bin/sh

Set static routing tables

. /etc/rc.common

StartService ()
{
sleep 10
ConsoleMessage “Adding Static Routing Table”

Static routes for myPlex

sudo /sbin/route add 184.169.174.153 YOUR.GATEWAY.IP.HERE
sudo /sbin/route add 184.169.137.36 YOUR.GATEWAY.IP.HERE
sudo /sbin/route add 184.169.154.22 YOUR.GATEWAY.IP.HERE
}

StopService ()
{
return 0
}

StopService ()
{
return 0
}

RestartService ()
{
return 0
}

RunService “$1”

thanks @kidamnesiac , though still no dice

Changed AddRoutes to the above, rebooted router, rebooted media server that runs PMS, republished server (which still works fine with 32400 manually specified in advanced settings and also forwarded on my router). No luck after connecting to VPN.

I'm testing on the iOS app using 4g only - just to make sure that wasn't the problem have done multiple combinations of logging in/out of myplex and refreshing on the app to no avail.