Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

plex over vpn

Options
  • 11-09-2015 1:52pm
    #1
    Registered Users Posts: 5,328 ✭✭✭


    i use a plex media server to steam to my phone and other devices outside of my lan.

    i also use a vpn on that server but when i'm connected to the vpn plex cannot be accessed from outside the network

    i went googling and found this http://www.cuttingcords.com/home/2014/11/8/protecting-your-privacy-with-vpn

    there is a batch file which creates routes so it bypasses the vpn
    my question is does applying the batch file cause anything other than plex to bypass the vpn.

    heres what the batch files does
    @echo off
    setlocal
    set PATH=%SystemRoot%\system32;%SystemRoot%\system32\wbem;%SystemRoot%
    chcp 437>nul


    echo my.plexapp.com VPN Route Exception Builder
    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%

    ::set gateway=192.168.0.1


    echo Getting my.plexapp.com's current IP address
    echo.

    ping "my.plexapp.com"|findstr /I /C:"my.plexapp.com" >"%temp%\my.plexapp.com.txt"

    set /p PlexIP= <"%temp%\my.plexapp.com.txt"
    set PlexIP=%PlexIP:*[=%
    set PlexIP=%PlexIP:~0,-24%
    echo %PlexIP%
    echo.

    set zero=%PlexIP:*.=%
    set zero=%zero:*.=%
    echo set PlexIP=%%PlexIP:%zero%=0.0%%>"%temp%\plex.bat"
    call "%temp%\plex.bat"

    ::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, exiting...) & (goto:fin)
    :skipcheck

    echo route -p add %PlexIP% mask 255.255.0.0 %gateway%
    route -p add %PlexIP% mask 255.255.0.0 %gateway%
    echo.

    echo Adding IP to %userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt
    echo.
    echo %PlexIP% >>"%userprofile%\AppData\Local\Plex Media Server\PermittedPlexIPs.txt"



    :fin

    ::echo fin
    ::pause

    exit

    ::Other route commands
    ::route -p add 54.241.0.0 mask 255.255.0.0 192.168.0.1
    ::route delete 54.241.0.0 mask 255.255.0.0


Comments

  • Registered Users Posts: 36,167 ✭✭✭✭ED E


    It seems safe, only change it actually makes is adding a route to override the default route that your VPN provider/Client is adding to the routing table. Its always possible to clean out the routing table later if things went belly up.

    You may need to change the gateway value depending on your current default gateway.


  • Registered Users Posts: 5,328 ✭✭✭dunworth1


    ED E wrote: »
    It seems safe, only change it actually makes is adding a route to override the default route that your VPN provider/Client is adding to the routing table. Its always possible to clean out the routing table later if things went belly up.

    You may need to change the gateway value depending on your current default gateway.

    great i'll give it a go an see how it goes.

    thanks


  • Registered Users Posts: 5,328 ✭✭✭dunworth1


    well it worked anyway :D


Advertisement