How To Use Plex With Private Internet Access

We do not currently offer Split Tunneling as an option within our app or offer support on Split Tunneling, however your operating system can be configured to allow applications to bypass your Private Internet Access service. This can be useful when dealing with certain services which geoblock content (such as Netflix).

How to Split Tunnel to Use Plex with Private Internet Access:

You can use a script (.bat) file in order to allow your Plex server to bypass the Private Internet Access server. This will configure your windows client to bypass the Private Internet Access service for Plex.

This script can be run on startup automatically via the Windows Startup options.

You will need to copy and paste the code into a text file and rename as Plex.bat  as well as change the default gateway (highlighted in red) to your router IP address.


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

echo VPN Bypass for Plex Media Server

::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% ::If gateway is detected incorrectly, override it by uncommenting the below like (delete : and input your correct gateway ::set gateway= echo Getting current IP addresses... echo. echo Note: Log of's routed IP's saved here: echo %userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt echo. nslookup ""|findstr /I /V "Server: Address: Name: timeout" >"%temp%\temp.txt"
findstr /I /C:" " "%temp%\temp.txt" >"%temp%\"

cd /d "%temp%"
for /F "tokens=*" %%A in ( do call :list %%A

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)

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


::clean no longer used IPs
echo Removing routed IPs no longer used by

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

set PlexIP=%*
findstr /I /C:"%PlexIP%" "%temp%\" >nul
IF ERRORLEVEL 1 goto:remove

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

echo IP no longer used: route delete %PlexIP%
route delete %PlexIP%

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 Finished, exiting...
@ping -n 3 -w 1000> nul


Please Note: We do not currently offer Split Tunneling as a feature and as such do not offer support. The guide is purely for information and is carried out at your own risk.

PIA sends all your traffic over a secure encrypted tunnel. The traffic for those apps will not be encrypted or protected by the VPN as tt also provides a direct link from the outside network to your machine.

Because of the complexity of the setup and the possibility of leaking data outside the VPN connection (which can introduce security risks), we do not support split tunneling at this time.

Have more questions? Submit a request