In this guide, we walk you through the steps so you can get Plex working with Mullvad.
First add a Port to be forwarded to your Mullvad account
- Log in to your Mullvad account on our website and then click on ADD PORT to add a port that you can use for Plex.
- Reconnect to a VPN server.
- In the Mullvad VPN app click on the Settings icon, preferences and then enable Local network sharing
Change Plex to listen on the added port
- Open Plex
- Click on Settings
- Click on Remote access
- Enable remote acces
- Check the Manually specify public port checkbox and enter the port number you were previously assigned and click on APPLY.
Add a firewall rule
- Click on the Windows key (Start)
- Type wf.msc and hit enter
- Click on Inbound Rules to select it
- Click on New Rule...
- Select Port and then Next
- Select TCP and Specific local ports and enter the port number you were assigned previously and then click Next
- Select Allow the connection and then Next
- Select both Private and public networks and click Next
- Enter a name, for instance "Plex port XXXXX" and then click on Finish
Add a forwarding rule
- Open a command prompt and run it as Administrator (Windows key type CMD and then click on "Run as Administrator")
- Write the following (on a single line) and then press enter (replace xxxxx with the port you were assigned) :
netsh interface portproxy add v4tov4 listenport=xxxxx listenaddress=0.0.0.0 connectport=32400 connectaddress=127.0.0.1
Start the forwarding rule
These steps will start the forwarding rule when you log in to Windows.
- Open notepad and paste the netsh command into it.
- Save the file as plex.bat
- Click on the Windows key and type taskschd.msc and then hit enter
- Click on Create basic task,
- Name it Plex and click on Next
- Select When I log on then Next.
- Select Start a program and click on Next.
- In the Program/script field click on browse and add the plex.bat that you previous created and click on Next
- Click on Finish
- Click on Task Scheduler library
- Double click on Plex
- Select Run with highest privileges found under General
- Save the changes by clicking on OK
- Enable forwarding by opening a terminal and running
sudo sysctl -w net.inet.ip.forwarding=1.
- To add a forwarding rule, run
echo "rdr pass inet proto tcp from any to any port xxxxx -> 127.0.0.1 port 32400" | sudo pfctl -ef -(replace xxxxx with the port you were assigned).
- To add a persistant redirect rule, run
echo "rdr pass inet proto tcp from any to any port xxxxx -> 127.0.0.1 port 32400" > /etc/pf.anchors/plex
(replace xxxxx with the port you were assigned).
Add to following to /etc/sysctl.conf
- To create a com.plex.pfctl.plist file, run
sudo nano /Library/LaunchDaemons/com.plex.pfctl.plist
- Paste the following into the file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
- Then press ctrl + x and then Y to save.
Add a redirect rule by running the following code (replace xxxxx with the port you were assigned):
sudo iptables -t nat -I PREROUTING -p tcp --dport xxxxx -j REDIRECT --to 32400