Using Plex Server with a VPN

@Iceman1199 said:
Has anyone had an issues with the bat file not working all of a sudden? Was working great til a few days ago.

My bat file stopped working as well. I can see in the cmd window that is says “*** Request to UnKnown timed-out”. I tried searching for that, but it didn’t bring up anything. I can confirm that my bat file searches for “plex.tv” in the nslookup command. Anybody have any clue what is going on?

Ah, I think I’ve found the problem - unfortunately, I don’t know the solution.

I found that if I am connected to my VPN, it can’t properly do an nslookup to plex.tv. Once I disconnect from my VPN, it brings up the IPs immediately. Connect back to the VPN, it times out.

To test it out, open a command prompt and type in “nslookup plex.tv” while connected to your VPN.

Is PIA blocking this command or something? Or this URL?

WORKAROUND: This is only a workaround, not a solution. I have found that if I turn off the VPN, then run the XFlak script as administrator, then turn the VPN back on, it will work.

I will keep this thread updated if I find a solution.

@jrossh21 said:
Ah, I think I’ve found the problem - unfortunately, I don’t know the solution.

I found that if I am connected to my VPN, it can’t properly do an nslookup to plex.tv. Once I disconnect from my VPN, it brings up the IPs immediately. Connect back to the VPN, it times out.

To test it out, open a command prompt and type in “nslookup plex.tv” while connected to your VPN.

Is PIA blocking this command or something? Or this URL?

WORKAROUND: This is only a workaround, not a solution. I have found that if I turn off the VPN, then run the XFlak script as administrator, then turn the VPN back on, it will work.

I will keep this thread updated if I find a solution.

Hey jrossh…thanks for looking into this. I’m not sure if my outputs are right, but I tried nslookup to plex.tv and it returned PIA servers, IP, plex.tv, and IP addresses. I’m going to try your workaround and see if that works. In the meantime, I’ve been contemplating just moving all my activities to a different server (VM), riding PIA over it, and just using Plex on a different machine. I’m reading that this is preferred anyways.

I don’t know if it is a limitation of PIA or what, but here’s what I did to get around it. I have both PIA Manager and the XFlak script as scheduled tasks. I have them both set to run at user log on. But I delay the PIA Manager for 2 minutes to give time for the XFlak script to run before the VPN gets set. This seems to be working correctly for now.

@jrossh21 said:
I don’t know if it is a limitation of PIA or what, but here’s what I did to get around it. I have both PIA Manager and the XFlak script as scheduled tasks. I have them both set to run at user log on. But I delay the PIA Manager for 2 minutes to give time for the XFlak script to run before the VPN gets set. This seems to be working correctly for now.

would you share your task setup for the pia manager? i cant get it to run… its a batch file but prompts for UAC access.
thanks

Trying the Mac version posted a couple of pages back on a mid 2012 iMac w/ Sierra 10.12.3. Not working for me. I noticed when I ran the .app file it doesn’t work, but if you open the contents of the app file and run the PlexVPN script (inside PlexVPN.app/Contents/MacOS/ PlexVPN --why on earth would you do this btw? is this what you intend?) it works and outputs the following…

add host 52.214.149.31: gateway 192.168.1.1
add host 52.210.223.97: gateway 192.168.1.1
add host 54.229.174.245: gateway 192.168.1.1
add host 52.17.240.145: gateway 192.168.1.1
add host 54.77.213.127: gateway 192.168.1.1
add host 52.210.15.168: gateway 192.168.1.1

…which is just my Router internal IP (local gateway). So, not sure that is what’s intended (?) or should this be my WAN IP instead?

Right now, even though it runs, it’s not working. Plex is not visible outside of my LAN. Any help appreciated. Someone please start a gofundme account so we can put 4 or 5 brainiacs on this issue full time for us. I’ve got $100 ready to chip in right now. I hate this issue still exists with all these wonky half-baked solutions that require tons of investigation and configuration. Not a knock on these awesome guys providing these free solutions here. Great job and thanks. Just need to get it working.

I have 4 friends using xflak’s script still with no problem. It may be an issue with your router or server’s configuration.

jerry, if you mean me, I’m not using his… I’m using the Mac one from gadgeypop

@shpankey said:
jerry, if you mean me, I’m not using his… I’m using the Mac one from gadgeypop

Ah ok. I know some others are using his.

@shpankey - have you been able to get this to work?

@jerry121802 - you say others have gotten this working for the Mac. Any specific people we can ask?

@sleake said:
@shpankey - have you been able to get this to work?

@jerry121802 - you say others have gotten this working for the Mac. Any specific people we can ask?

Nope, sorry, we are all using either Windows 7 or Windows 10.

14 pages of posts in this thread. I’ll be honest-I have read all of it. Is there a wiki or something that shows how to make this work? The first few pages that I have read seem to indicate that the solution has changed as Plex has made changes over the years. I tried reading backwards from the latest post and I am still not sure of the best way to make this work. It does seem that some folks are just giving up and/or moving plex to a stand-alone box.

I want my plex server remote access, and couchpotato/SAB & Sonarr to all work remotely when my VPN is running. These are all running on a Ubuntu box if that helps.

I can only speak to one VPN - PIA.

The other day PIA was a PITA and running really slow. I updated it’s application and all was well, but before I started it I added the port I forwarded in the router (years ago) to the empty slot right next to the check box that read: ‘Forwarded Port’ in it’s teenie little client. I had never done that and while PMS still worked fine while PIA was on it did take a few seconds for the green light to come on when visiting the server settings page in Plexweb… no longer… instant green light.

I guess the moral of this story is if your VPN is making life difficult for you, it may be time to change VPNs. You shouldn’t need a degree in Rocket Science to get your VPN working with PMS and when using PIA it was easy enough for even me to figure out. I don’t know the first thing about Rocket Science other than they’re loud and leave a pretty smoke trail (it took me 8 hours to get that port forwarded in my router - and the page I was on had pictures even).

Weeeeeeee!

:slight_smile:

I’m running openvpn on my ubuntu server, which is also hosting my PlexMediaServer. After setting up openvpn I found that my plex server was no longer available. This is obvious because the VPN will block all outgoing traffic through its firewall. The solution was simple. I just needed to allow traffic comming out of plex’s private port. You can accomplish this by typing these lines in the command line with root access:

sudo ufw allow 32400/tcp
sudo ufw allow 32400/udp

@MrGibbage
Take a look at this: https://forums.plex.tv/discussion/comment/1139715#Comment_1139715

I’ve got plex running on a synology nas, my vpn provider is pia

@mcmax said:
my vpn provider is pia

Disconnect PIA.
Server and All Remote Clients must be signed in - how will Plex TV know where your server is? Answer: It won’t.

  1. Forward a port (non-standard, preferably) in your router.
    1a) Go to Plexweb/Settings/Server/Remote Access/:
    …These lines should appear similar:
    …Private 192.168.1.249 : 32400 Public ... : ***** <— your forwarded port after your IP (Public IP should be there already)
    …In the event no forwarded port is shown, enter it manually below these lines and check the box (Manual) then click …‘Apply’ - that should do it and you should have a Green Checkmark, but if not you can’t proceed. If you can proceed, proceed…

  2. upgrade to newest PIA client version.

  3. open PIA Client, but do not yet connect.

  4. check box next to the Words: Request Port Forwarding (Advanced Tab, of course)

  5. put forwarded port numbers in empty space near the words: ‘Local port’

  6. click ‘Save’

  7. Connect VPN - Ensure Green Checkmark.

That’s pretty much it - unless your ISP has a special deal for you, like the ‘Wont Work No Matter What You Do’ Deal. If you have that deal I’d call 'em up and complain.

:slight_smile:

For me, it really was as easy as falling off your bike. It’s almost idiot-proof ('cause I did it in 5 minutes - well known in my Village as the ranking idiot).

All -

I recently read @Grimshad 's post (see page 13) in how to update XFlak’s bat file for the new Plex addresses (Plex.TV and App.Plex.TV) but I’m not having much luck. For me, when the task runs at windows login, it stays “Running” indefinitely. Is anyone aware of a way to update the .bat so that it resolves these IPs?

@jerry121802 said:
I have 4 friends using xflak’s script still with no problem. It may be an issue with your router or server’s configuration.

Did you check Task status on the bat file? My Remote Access to my Plex Server still works as well with PIA up - however I believe that’s because the current list of IPs is solid. If the IPs change, I think it’ll now break as it has no way to lookup/update them.

FYI, updated versions of my script can always be found at xflak40.wordpress.com. It references plex.tv and includes a different silent launcher which plays nice with most antiviruses. Last update was ages ago but recent posts in this forum (and emails I’ve received) still reference my.plexapp.com which was updated long ago so thought I would mention it.

@XFlak said:
FYI, updated versions of my script can always be found at xflak40.wordpress.com. It references plex.tv and includes a different silent launcher which plays nice with most antiviruses. Last update was ages ago but recent posts in this forum (and emails I’ve received) still reference my.plexapp.com which was updated long ago so thought I would mention it.

Thanks man