Using Plex Server with a VPN

Here is what finally worked for me. I am running the Plex server on Windows 10 PC. I have PureVPN, and also run Kodi on my PC. PureVPN has the option to use split tunneling, which essentially means that the Vpn is off unless you open a browser, such as internet explorer or chrome, through the settings in pure Vpn. Doing that hides what you do through that particular browser while keeping all other traffic on the computer off of the Vpn. There is an option to “add” apps (browsers) to the PureVPN split tunneling list. I clicked on “add” and navigated to Kodi.exe. By opening Kodi through PureVPN split tunneling, Plex server remained local and has no effect with remote access, while everything in Kodi is Vpn protected. I confirmed this by going to a sports game live that is blacked out in my area, which played with no problem. Plex showed in remote access that I was using my local ip. I have access remotely. Hopefully this will help someone with this frustrating problem. I know that it isn’t a one size fits all solution, but it works perfectly for my situation.

After working on this for several weeks i just got a second PC to do nothing but be a PLEX server. My regular PC has a VPN but the plex server doesn’t.

I fixed the “*** Request to UnKnown timed-out” error by manually setting my DNS servers to use google’s DNS rather than my ISP DNS servers. However even though the scripts now run without errors remote access still isn’t working for me.

This thread has been going for four years now, and I don’t understand 90% of the “answers” that have been posted here. I see people saying “thanks, that works great!” with no clue as to how or why it now works for them. Ideally I don’t want Plex to bypass the VPN, and I’ve seen just as many answers on the internet saying this is possible as those that say it isn’t.

I initially bought KeepSolid’s VPN Unlimited, soon after which I found out that there is virtually no support for this on any forum I could find. I bought Private Internet Access because that’s what most people seem to refer to, that didn’t work. I bought VersaVPN because somebody on here said they ran Plex successfully on it with port forwarding, that didn’t work.

I’m getting seriously, SERIOUSLY p***ed off with going round in circles and people posting pages and pages of code and IP addresses and command lines that I not only don’t understand, but don’t even know where they’re supposed to go. I’ve lost a lot of money this afternoon because there are no free trials with any of these services. I’m stuck between not knowing what VPN service I should use, what settings to put into my Plex server (which, helpfully, keeps switching remote access off at will) and what settings to put into my router.

I’ll probably get told off for my language or losing my temper or whatever, but this is ridiculous. I’ve been figuratively and almost literally banging my head against a brick wall for the past 6 hours.

@sapphirehollow said:
This thread has been going for four years now, and I don’t understand 90% of the “answers” that have been posted here. I see people saying “thanks, that works great!” with no clue as to how or why it now works for them. Ideally I don’t want Plex to bypass the VPN, and I’ve seen just as many answers on the internet saying this is possible as those that say it isn’t.

I initially bought KeepSolid’s VPN Unlimited, soon after which I found out that there is virtually no support for this on any forum I could find. I bought Private Internet Access because that’s what most people seem to refer to, that didn’t work. I bought VersaVPN because somebody on here said they ran Plex successfully on it with port forwarding, that didn’t work.

I’m getting seriously, SERIOUSLY p***ed off with going round in circles and people posting pages and pages of code and IP addresses and command lines that I not only don’t understand, but don’t even know where they’re supposed to go. I’ve lost a lot of money this afternoon because there are no free trials with any of these services. I’m stuck between not knowing what VPN service I should use, what settings to put into my Plex server (which, helpfully, keeps switching remote access off at will) and what settings to put into my router.

I’ll probably get told off for my language or losing my temper or whatever, but this is ridiculous. I’ve been figuratively and almost literally banging my head against a brick wall for the past 6 hours.

First I’ll start by saying I don’t necessarily have the “fix” for you, just information that may help you to fix the issue.

I get your frustration honestly, I went through much the same thing in August. I my self am a systems engineer and much of the stuff discussed in this forum are still above my head. That said there are a couple things to understand here going in… first this is a user based forum, PLEX personnel rarely reply to threads so you are left with users helping users which can some times be like the blind leading the blind.

The next thing to understand is that there isn’t a PLEX solution to this issue (although I sure which they would provide one). Basically the only thing Plex provides is the ability to provide a specific port that you can forward in your router. Although that will still be required to get past the NAT firewall on your router that won’t fix the issue of being behind a VPN.

The problem when you are behind a VPN is that your computer is no longer reachable by the public IP address being assigned to you by your ISP. Instead your PC needs to be contacted at the IP address you are being assigned by the VPN server. Most VPNS will not forward ports so the traffic is block at the VPN server and never gets to your router to then be forwarded to your PC. Some VPNs are capable of limited port forwarding… but it’s not typically a straight forward process and in the case of PIA they only support it on certain servers so you may need to connect to a city much farther from home. Even then though the forwarded port is decided by PIA and it changes each time you connect… which makes forwarding that port in your router a real pain cuz you need to set it up again each time you connect to VPN (not practical).

There are also issues with DNS when behind a VPN, sometimes you can resolve that by setting up your VPN to use specific DNS servers like I mentioned in my earlier post. This may solve some DNS issues experienced by scripts that people here have created to try to make Plex behind a VPN work.

I myself have PAI, I don’t use their port forward servers because they are too far from me and too slow and the port changes every connection. I have had success using XFlak VPN Bypass for Plex Media Server, I had it working perfect for over a year but then changed computers and had a hard time getting it to work on my new PC. For me my solution took several actions. 1st I had to setup port forwarding in my router, then I had to set my VPN connection and local network adapters to use Google’s DNS servers rather than the ones from my ISP. Finally I setup XFlak VPN Bypass for Plex Media Server on a scheduled task scheduler task to run every hour. With those 3 actions I got my Plex to give the Green Check for Remote Access behind my PIA VPN about 90% of the time. Occasionally I’ll notice it has went back to a red-X and I need to delete and re-setup the port forwarding in my router and/or manually kick off the XFak script.

Unfortunately there is no easy turn key solution to this issue, it may be different for you than it is for me and others. It takes time, patients and understanding that the people here are just trying to help, they are not paid, they are just users like you.

Alternatively you could choose to run your Plex on a VM without a VPN or on a stand alone computer that is not connected to a VPN.

I wish you the best.

@sapphirehollow said:
This thread has been going for four years now, and I don’t understand 90% of the “answers” that have been posted here. I see people saying “thanks, that works great!” with no clue as to how or why it now works for them. Ideally I don’t want Plex to bypass the VPN, and I’ve seen just as many answers on the internet saying this is possible as those that say it isn’t.

I initially bought KeepSolid’s VPN Unlimited, soon after which I found out that there is virtually no support for this on any forum I could find. I bought Private Internet Access because that’s what most people seem to refer to, that didn’t work. I bought VersaVPN because somebody on here said they ran Plex successfully on it with port forwarding, that didn’t work.

I’m getting seriously, SERIOUSLY p***ed off with going round in circles and people posting pages and pages of code and IP addresses and command lines that I not only don’t understand, but don’t even know where they’re supposed to go. I’ve lost a lot of money this afternoon because there are no free trials with any of these services. I’m stuck between not knowing what VPN service I should use, what settings to put into my Plex server (which, helpfully, keeps switching remote access off at will) and what settings to put into my router.

I’ll probably get told off for my language or losing my temper or whatever, but this is ridiculous. I’ve been figuratively and almost literally banging my head against a brick wall for the past 6 hours.

Here’s the rub…

  1. You can run your server THROUGH your VPN provider, IF you can set up port forwarding properly. Some of these providers using their own program/app/service.
  1. You can selectively route AROUND your VPN provider based on a number of options. One of these options is XFlak’s script which will route the client it is running on, around (not through…) the VPN. Another is running the VPN Client at the router level, thus providing all of your clients the protection of your VPN, and then selectively routing specific clients or specific sites around your VPN.

I chose the second one. I have no problems whatsoever, but it does require a router that can be ‘modified.’

-Jason

Thank you both for taking the time to write comprehensive answers. I’m trying option 1 in JasonMeudt’s comment first (tried this before). I’ve followed PIA’s instructions and entered the port number into “manually specify public port” for the Plex Server and clicked retry. First thing it does is switch off remote access itself (no idea, bug?), when I re-enable it and press Retry again, it attempts to connect, I get the green light, then about half a second later it turns red again and won’t connect.

Is there anything I need to change in my router setup to get this method to work? It already has UDP ports and stuff set up as per Plex’s instructions. If I switch the VPN off, Plex Server will connect with no problems so the router itself isn’t stopping anything getting through the normal way.

Ok so following on from above, tried turning off the VPN, leaving the Plex manually-specified port as it was (52586 - provided by PIA when the VPN was running) and re-attempting remote access. This worked, which I think it should have anyway as the public port is up to me, right? My router hasn’t stopped this coming through anyway (UPnP is enabled if that helps).

I then switched the VPN back on (without touching Plex Remote Access settings) and Remote Access is still working (green light still on and I’ve tested it from a remote location and it’s fine). The port number given by PIA has stayed the same. I know I shouldn’t complain that it’s working but…??

I’ve tried this on my phone and it tells me I have an “Indirect Connection” to the server. Could that mean it’s running behind the VPN?

Edit: well, what do you know, the moment I submitted this comment Remote Access stopped working again. Back to square one.

Edit 2: even though Plex is telling me Remote Access is not available, I can still “indirectly” access and stream remotely?

@sapphirehollow said:
Ok so following on from above, tried turning off the VPN, leaving the Plex manually-specified port as it was (52586 - provided by PIA when the VPN was running) and re-attempting remote access. This worked, which I think it should have anyway as the public port is up to me, right? My router hasn’t stopped this coming through anyway (UPnP is enabled if that helps).

I then switched the VPN back on (without touching Plex Remote Access settings) and Remote Access is still working (green light still on and I’ve tested it from a remote location and it’s fine). The port number given by PIA has stayed the same. I know I shouldn’t complain that it’s working but…??

I’ve tried this on my phone and it tells me I have an “Indirect Connection” to the server. Could that mean it’s running behind the VPN?

Edit: well, what do you know, the moment I submitted this comment Remote Access stopped working again. Back to square one.

Edit 2: even though Plex is telling me Remote Access is not available, I can still “indirectly” access and stream remotely?

Without knowing a ton on PIA’s port forwarding, I seem to remember that they ‘time’ it out after awhile, requiring you to ‘re-apply’ for the port. Are you using their own specific app for the port forward application? If so, I think this may be more suited to their forums.

I route around their servers in my use case. Plex, Hulu, Netflix, and the other various streaming sights generally do not like VPN’s.

-Jason

I’ve eventually got this to work by changing VPN provider. The key to all of this is the VPN provider giving you a public port which they will redirect to port 32400 (Plex Media Server port). Most VPN providers don’t seem to give you this, I signed up with AirVPN, who do. I know I’ve repeated what I and others have said with settings here, but this is really for the next me that turns up on here :smiley:

Before I start, I haven’t made any changes on my router. I can’t remember what I initially did to get my router to allow Plex connections through, think I enabled UPnP and Plex took care of the rest. If your Plex server works without a VPN running (mine did), then leave the router alone. If not, go through Plex troubleshooting to get this to work first, once you get the green light, then try with the VPN.

If you set up an AirVPN account (I only bought a few days worth of service to start with to make sure it worked), then install the software on the Plex server machine but you don’t need to start the VPN service yet. Sign into your account on the AirVPN website and click the Client Area tab, then Forwarded Ports on the left. You need to pick a static port (a lot of them are taken but there is a facility at the bottom of the page to show available ones, it doesn’t matter what you pick), and make a note of which port it is so you can enter it into Plex. You’ll see a mini box to fill in your port details. Set the public port number in the biggest box at the top, set protocol as TCP & UDP, local port as 32400, don’t need to fill in DDNS.

Start the VPN service running on the Plex host computer. Make sure all is running fine, may be worth Googling “what is my IP” and see what they think your location is. Now onto the Plex settings. In the Remote Access section, under “Manually specify public port”, enter the port number you’ve reserved with AirVPN and click Retry. For me, this failed. I quit running the Plex server on the host computer and restarted it, opened up settings again to Remote Access, and all was in green with my specified public port. I tested this on a mobile device outside of my server’s network and all worked fine.

1 Like

Since writing my reply above I started having problems again keeping the much sought after “green check” of goodness for remote access. BTW remote access will still work to some extent via indirect connections (without the green check) for Plex Pass subscribers but it is limited and slow.

So I discovered that if I don select the option to manually specify a port but I still use XFlak VPN Bypass for Plex Media Server I get the green check and it stays! Since I’m not specifying a specific port I also don’t need to mess with port forwarding on my router!

Not sure if it makes a difference but I should mention that although I use PIA service I don’t use their client software, instead I use OpenVpN.
https://www.privateinternetaccess.com/pages/client-support/windows-openvpn

I couldnt get this working in Windows 10 either using the SlickVPN client, but after switching to the Viscosity client it now works.
Follow this guide to setup the client for slickvpn.
Server locations can be found here to use in Viscosity.

Schedule Xflak VPN bypass (252 for SlickVPN) in windows and all is set!

@nsantalu said:
Since writing my reply above I started having problems again keeping the much sought after “green check” of goodness for remote access. BTW remote access will still work to some extent via indirect connections (without the green check) for Plex Pass subscribers but it is limited and slow.

So I discovered that if I don select the option to manually specify a port but I still use XFlak VPN Bypass for Plex Media Server I get the green check and it stays! Since I’m not specifying a specific port I also don’t need to mess with port forwarding on my router!

Not sure if it makes a difference but I should mention that although I use PIA service I don’t use their client software, instead I use OpenVpN.
PIA Support Portal

This works because you are bypassing the VPN completely so there is no need to specify a manual port (as the incoming connections will come through on your real IP, not your VPN IP, so Plex can find it and send it through to port 32400 for you). If you don’t mind bypassing the VPN then this XFlak solution seems an effective one. My setup actually has Plex running behind the VPN using port forwarding at the point of the VPN provider (no messing with the router).

Another vote for AirVPN remote port forwarding working flawlessly for over a year.

My only option for remote access due to Carrier Grade NAT

So the solution I was using seems to have stopped working for no good reason and even using PIA with their Port Forwarding servers doesn’t work. As such am afraid I may have to dump PIA and move to AirVPN or another VPN provider that works. It frustrates me to no end that I need to change VPN providers and pay more than twice the annual price to get this work again but it seems I have no choice.

I am tired of screwing with the flax scripts which used to work but now seem to do nothing. Trying to use PIA port fowarding which seems to do nothing etc…

Aside from changing VPN providers does anyone have another easier fix for this issue?

Hmm 1.9.3 works perfectly for me behind a VPN, no tricks or tweaks applied at all. Using Newshosting VPN client.

So I purchased a 3 day trial of AirVPN for $1.20 and sure enough with port forwarding Plex Remote Access works perfectly. It took a while to find a random port that wasn’t in use by another user but once I found one I was good to go. Guess I’ll need to cancel PIA and move to AirVPN permanently.

Well after 15 pages of comments over several years, this has obviously caused a lot of frustration and is also not near being resolved in any way. I have used PIA for this past 3 years, and have had some limited success using Xflak’s script. I spent hours trying to get it to work initially, without success. Then voila, one day the green check, and the remote connection became available outside my network. Then it worked for a few months, stopped for a bit, worked again, and has now stopped again for the past month or so. I have given up getting this to work as it is obviously sensitive to too many variables and not at all user friendly. The bottom line is that, with all of the issues, along with the increasing need for a VPN, I am not sure why Plex is missing from the equation and not providing more built in support, rather than leaving the issue unresolved for so many of its loyal followers.

@rootsnharmony said:
Well after 15 pages of comments over several years, this has obviously caused a lot of frustration and is also not near being resolved in any way. I have used PIA for this past 3 years, and have had some limited success using Xflak’s script. I spent hours trying to get it to work initially, without success. Then voila, one day the green check, and the remote connection became available outside my network. Then it worked for a few months, stopped for a bit, worked again, and has now stopped again for the past month or so. I have given up getting this to work as it is obviously sensitive to too many variables and not at all user friendly. The bottom line is that, with all of the issues, along with the increasing need for a VPN, I am not sure why Plex is missing from the equation and not providing more built in support, rather than leaving the issue unresolved for so many of its loyal followers.

It sounds like you and I have had identical experiences. Basically I think PIA port forwarding doesn’t work and the Xflak scripts worked for a good while but no longer do the trick consistently.

I can say however that using AirVPN with their port forwarding works great. Of course there are a few drawbacks, AirVPN is about twice the cost annually at about $66 US and although they have a ton of servers I find the speeds are considerably slower than PIA as well. I pay my ISP for 300MB down and 20MB up and that’s what I get without VPN. With PIA going throughout their Toronto server I get about 240MB down and 15MB up. With AirVPN the best I’ve found is a Miami server where I get about 110MB down and 10MB up. So twice the price and half the speed but without the frustration of Plex Remote Access not working.

On top of all that my PIA just renewed for another year a couple weeks ago while remote access was working so there goes that money down the drain.

Mine has never stopped working with PIA and Xflak scripts, so I consider myself very lucky.