Selectively routing Plex through your VPN
Plex’s all-in-one streaming and easy setup has made it the media server of choice for a lot of users, but having all of your movies and music in one place doesn’t mean much if you can’t connect.
Here’s everything you need in order to get your Plex server streaming through your VPN without sacrificing any protection.
Getting started routing Plex through your VPN
It takes a few steps to get Plex streaming over a VPN. Here’s what you can expect:
- Give your Plex server a static IP address
- Make a note of a few Plex settings
- Enable port forwarding in your router
- Configure your VPN to allow unrestricted access to plex.tv
After that, you can seamlessly connect to your private Plex server from anywhere in the world using the app or a web browser, regardless of how secure your home internet connection is.
This whole process is called selective routing, and it’s a powerful networking tool to know. If you want to know which VPN we recommend we’ll cover this a little later in the article.
Setting up Plex server
There are a few things you’ll need to do before you get started making changes to your network. Please note that all of these steps should take place on your Plex streaming media server.
Give your Plex server a static IP address
If you haven’t done so already, make sure to give your Plex server a static IP address. This will let you setup port forwarding properly, and ensure that any changes you make to the VPN configuration or your router will continue to work after a reboot.
To set a static IP address, first open the Control Panel.
Note that a good static IP address will be outside of your router’s DHCP range. In this case, my router hands out addresses from 192.168.1.150 to 192.168.1.254, so choosing 192.168.1.100 is safe.
When a router assigns an IP address that’s already in use on the network, it causes a conflict, so double-check your router’s DHCP settings before you assign a static address.
When choosing static DNS servers, it’s a good idea to use a mix. In this configuration, I use my router first, 192.168.1.1, which forwards DNS lookups to my internet service provider. As a backup, I chose a free and secure Google server at 18.104.22.168 or 22.214.171.124
You’re finished setting a static IP.
Make a note of your Plex settings
Before you configure your VPN to pass Plex traffic directly to your server, you’ll need to connect to Plex through the web interface in order to confirm your settings.
The Plex web client is accessible through this link, or by right-clicking the tray icon and selecting the Open Plex… menu item.
Now that your Plex server has a static IP address, OpenVPN has been installed, and you’re sure of the proper port settings, you can move on to setting up your local network.
Setting up your local network
The next step is to tell your router where to send incoming Plex connections. In this case, it will be to the static IP address of your Plex server.
Enable port forwarding in your router
Once you have logged in to your router, you’ll need to find the settings for port forwarding. In this Linksys router, it’s found under Security on the left sidebar, then on the Apps and Gaming tab. Your router may be different.
After finding the port forwarding settings for your router, fill it out with your Plex server information.
Application Name is meaningless, and only makes it easy to identify which application we’re working with. You can set it to anything, but Plex makes sense.
External Port tells the router exactly where to look for Plex traffic on the internet. It can be set to anything aside from a handful of reserved numbers. It’s convenient to use 32401.
Internal Port tells the router exactly where to send Plex traffic on the LAN. You made a note of this port while setting up the Plex server. The default is 32400.
Protocol dictates what kind of traffic is allowed to be forwarded. Set it to ‘TCP’ or ‘Both,’ but only TCP is needed.
Device IP specifies your Plex server’s static IP address. You made a note of this number while setting up your Plex server.
The Enabled check box allows you to turn port forwarding for Plex on and off. Make sure it’s on.
When you’re finished, click the OK button and exit the web interface for your router.
Setting up your VPN
Now that the router has been set to forward the proper port, you can configure your VPN.
IPVanish is a paid VPN service with with server locations all over the world.
We strongly recommend it for anyone who needs to be able to browse the web anonymously, and do it without slowdowns or complicated config files associated with many VPNs. IPVanish is one of the few VPNs that doesn’t keep any form of log files so your activity is truly private and you won’t have to worry about your ISP or others spying on your online activity.
Reader deal: Save up to 60% on IPVanish plans
If you have config files for another VPN server, you can connect using OpenVPN. We’ll show you how to set up Plex over VPN using both IPVanish and OpenVPN.
Install and configure IPVanish
IPVanish is much easier then OpenVPN to install and configure.
If it’s already installed on your Plex server, you can skip over the installation guide and download Comparitech’s edited version of IPVanish.config right here. Just make sure to save it to the proper place, usually C:\Program Files\IPVanish\OpenVPN\
To install IPVanish, visit this link and click the Download Now button. You will have to be logged in to your account in order to download the IPVanish installation.
Take note of the path, because you’ll need to edit a configuration file where you choose to install IPVanish. The default path in Windows is C:\Program Files\IPVanish and that’s where you should install it.
After restarting your computer, open an explorer window to the path that you installed IPVanish. If you’re following along step-by-step, it will be C:\Program Files\IPVanish and you’ll need to locate the OpenVPN directory in order to edit a file.
Then start IPVanish using the shortcut on your desktop, and connect to a VPN server as usual. The script that you saved in your IPVanish.config file will tell your VPN connection to ignore Plex traffic and route it as usual.
If you’re using IPVanish as your VPN provider, you can skip to the final step.
Install and configure OpenVPN
Installing OpenVPN is pretty straightforward. You’ll want to download the Windows installer here. Skip this section if you’re using IPVanish or another VPN provider’s app.
Make sure you get the OpenVPN Windows installer from the website, and not the source code.
After downloading, open up the file and give it permission to run. The install wizard will start, and it’s fine to click through using the default options. When the OpenVPN installer is done, click Finish and move on to the next step.
Once OpenVPN is installed, you can set it up. The process can be complicated, so we’ve pre-made a secure configuration file to be imported and used right away. It will automatically connect you to a free OpenVPN tunnel in the United States.
Our OpenVPN configuration file can be downloaded here. If necessary, the configuration file can be edited in Notepad. Once you’ve downloaded the configuration file, you need to make a few quick changes to OpenVPN and then you can import it.
Setting up your mobile device
The best part about this method is that there’s absolutely no setup to do on your device. Your Plex server will be able to browse the rest of the internet anonymously but, when it comes to streaming media, things will work as usual.