# Using PIA and Plex, remote access rarely woks

**URL:** https://forums.plex.tv/t/using-pia-and-plex-remote-access-rarely-woks/495797
**Category:** General Discussions
**Created:** [November 23, 2019, 11:11pm UTC](https://forums.plex.tv/t/using-pia-and-plex-remote-access-rarely-woks/495797 "2019-11-23T23:11:45Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![JohnnyDugan79](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/johnnydugan79/32/21546_2.png) [@JohnnyDugan79](https://forums.plex.tv/u/JohnnyDugan79)
#### Post date: [November 23, 2019, 11:11pm UTC](https://forums.plex.tv/t/using-pia-and-plex-remote-access-rarely-woks/495797/1 "2019-11-23T23:11:45Z")

</div>

I never had a problem with remote access while using my VPN (PIA) but it rarely works these days. I have to turn off my torrent client, turn off my vpn, refresh Plex about a dozen times… and even then it’s a 50/50 chance it’ll work. Anyone have any ideas? The simpler the explanation the better. LOL

---

<div class="post-metadata">

### Author: ![JasonNalley](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jasonnalley/32/24210_2.png) [@JasonNalley](https://forums.plex.tv/u/JasonNalley)
#### Post date: [November 24, 2019, 3:44am UTC](https://forums.plex.tv/t/using-pia-and-plex-remote-access-rarely-woks/495797/2 "2019-11-24T03:44:43Z")

</div>

@JuiceWSA uses or used to use PIA, so he may be helpful here…

I’m gonna keep an eye on this thread as I am planning on getting a VPN (though probably going to be PureVPN). Hopefully someone chimes in with a solution to run Plex on the same machine, but not behind a VPN at all… 🙂 that would be the ideal solution for me personally. VPNs are not generally fast enough for the connection I have.

---

<div class="post-metadata">

### Author: ![JuiceWSA](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/juicewsa/32/12253_2.png) [@JuiceWSA](https://forums.plex.tv/u/JuiceWSA)
#### Post date: [November 24, 2019, 4:58am UTC](https://forums.plex.tv/t/using-pia-and-plex-remote-access-rarely-woks/495797/3 "2019-11-24T04:58:43Z")

</div>

This is the latest news - waiting for PIA to invent the cure:

> [@Private internet access; NEW EXEMPTION METHOD](https://forums.plex.tv/t/private-internet-access-new-exemption-method/486570):
>
> Help with creating an exemption in PIA? Server Version#: 1.18.1.1973-0f4abfbcc Player Version#: 2.44.0.1018-8f77cbb9 PIA app: v1.5.1 (build 03605) Windows 10 (1903) I am running my plex server on a windows 10 machine. The server and player are on the same machine. I am running the Private Internet Access (PIA) app to manage my VPN. I Have the standard port forwarded on my router (32400). Without PIA running my server is available when I check the settings page and I can confirm access with …

---

<div class="post-metadata">

### Author: ![WilhelmStroker](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wilhelmstroker/32/85549_2.png) [@WilhelmStroker](https://forums.plex.tv/u/WilhelmStroker)
#### Post date: [November 24, 2019, 9:14am UTC](https://forums.plex.tv/t/using-pia-and-plex-remote-access-rarely-woks/495797/4 "2019-11-24T09:14:32Z")

</div>

I use [https://www.reddit.com/r/PleX/comments/62h6ae/want\_to\_use\_plex\_behind\_a\_vpn\_look\_here/](https://www.reddit.com/r/PleX/comments/62h6ae/want_to_use_plex_behind_a_vpn_look_here/) to bypass PIA for plex remote access.

---

<div class="post-metadata">

### Author: ![Indy1970](https://avatars.discourse-cdn.com/v4/letter/i/91b2a8/32.png) [@Indy1970](https://forums.plex.tv/u/Indy1970)
#### Post date: [November 29, 2019, 5:13pm UTC](https://forums.plex.tv/t/using-pia-and-plex-remote-access-rarely-woks/495797/5 "2019-11-29T17:13:02Z")

</div>

this works for me on windows 10 latest plex version with Tor guard vpn running  
full remote access  
copy below create a batch file… run it if you have success then schedule it to run every 30 min

@echo off  
setlocal  
set PATH=%SystemRoot%\system32;%SystemRoot%\system32\wbem;%SystemRoot%  
chcp 437\>nul

echo VPN Bypass for Plex Media Server  
echo by XFlak  
echo.

::get Default Gateway  
ipconfig|findstr /I /C:“Default Gateway”|findstr /I /C:“1” \>"%temp%\gateway.txt"  
set /p gateway= \<"%temp%\gateway.txt" set gateway=%gateway:\*: =% ::echo %gateway%

echo Getting [plex.tv](http://plex.tv) current IP addresses…  
echo echo Note: Log of [plex.tv](http://plex.tv)’s routed IP’s saved here:  
echo %userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt  
echo.  
nslookup “[plex.tv](http://plex.tv)”|findstr /I /V “Server: Address: Name: timeout” \>"%temp%\temp.txt"  
findstr /I /C:" " “%temp%\temp.txt” \>"%temp%\plex.tv.txt"  
echo.

cd /d “%temp%”  
for /F “tokens=\*” %%A in (plex.tv.txt) do call :list %%A  
goto:donelist

:list  
set PlexIP=%\*  
set PlexIP=%PlexIP:\* =%  
echo %PlexIP%  
if not exist “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt” goto:skipcheck

findstr /I /C:"%PlexIP%" “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt”\>nul  
IF NOT ERRORLEVEL 1 (echo IP already routed, skipping…) & (goto:EOF)  
:skipcheck

echo route -p add %PlexIP% mask 255.255.255.255 %gateway%  
route -p add %PlexIP% mask 255.255.255.255 %gateway%  
echo.  
echo %PlexIP% \>\>"%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt"  
goto:EOF

:donelist

::clean no longer used IPs  
echo.  
echo Removing routed IPs no longer used by [plex.tv](http://plex.tv)  
echo.

if exist “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs2.txt” del “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs2.txt”\>nul  
if not exist “%userprofile%\AppData\Local\Plex Media Server” goto:doneclean  
if not exist “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt” goto:doneclean

cd /d “%userprofile%\AppData\Local\Plex Media Server”

for /F “tokens=\*” %%A in (PermittedPlexIPs.txt) do call :clean %%A  
goto:doneclean

:clean  
set PlexIP=%\*  
findstr /I /C:"%PlexIP%" “%temp%\plex.tv.txt” \>nul  
IF ERRORLEVEL 1 goto:remove

echo IP still used: %PlexIP%  
echo %PlexIP% \>\>"%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs2.txt"  
goto:EOF

:remove  
echo IP no longer used: route delete %PlexIP%  
route delete %PlexIP%  
goto:EOF

:doneclean  
if exist “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt” del “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt”\>nul  
if exist “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs2.txt” move /y “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs2.txt” “%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt”\>nul

echo.  
echo Finished, exiting…  
@ping 127.0.0.1 -n 3 -w 1000\> nul  
exit

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [February 27, 2020, 5:13pm UTC](https://forums.plex.tv/t/using-pia-and-plex-remote-access-rarely-woks/495797/6 "2020-02-27T17:13:13Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
