Remote Plex Access via Synology NAS using Wireguard VPS: Tech Support Guide
In this comprehensive tech support guide, we will discuss the steps required to set up remote Plex access via Synology NAS using a Wireguard VPS. This method is particularly useful for those who are behind a CG NAT and cannot perform port forwarding. Additionally, this setup allows you to access your Plex server faster by creating a static IP tunnel through a VPS.
Prerequisites
Here is a list of what you will need before starting:
- A Synology NAS with Plex installed
- A VPS (Virtual Private Server) with Wireguard installed, such as from a provider like DigitalOcean, Vultr, or Linode
- Basic knowledge of how to use SSH, as well as how to edit configuration files
Setting Up Wireguard on the VPS
First, log into your VPS via SSH and install Wireguard.
sudo apt-get install wireguard
Next, generate a private and public key for the Wireguard interface.
wg genkey | tee privatekey | wg pubkey > publickey
Save the private and public keys somewhere safe, as you will need them later.
Setting Up Wireguard on the Synology NAS
On the Synology NAS, install the Wireguard package from the Synology Package Center.
Next, create a new Wireguard interface and add the interface address and private key that you generated on the VPS.
[Interface]
Address = [VPS IP Address]/24
PrivateKey = [Private Key]
ListenPort = 51820
Save the file and start the Wireguard service.
systemctl start wg-quick@wg0
Setting Up Route-Allowed on the Synology NAS
To allow all traffic from the VPS to pass through the Wireguard interface, add the following lines to the route-allowed file.
/etc/wireguard/route-allowed
[0.0.0.0/0]
Save the file and allow the Wireguard service to reload the routes.
systemctl restart wg-quick@wg0
Setting Up Plex on the Synology NAS to Listen on the Wireguard Interface
To allow Plex to listen on the Wireguard interface, edit the Plex configuration file (/usr/local/plex/Plex Media Server.xml) and add the following lines.
Save the file and restart the Plex service.
systemctl restart plexmediaserver
Testing the Connection
To test the connection, SSH into the VPS and connect to the Wireguard interface.
wg-quick up wg0
Next, test the Plex connection by attempting to access it from a remote location.
-
Installed Wireguard on the VPS and Synology NAS
-
Set up Wireguard interfaces and added the necessary keys
-
Configured Plex to listen on the Wireguard interface
-
Tested the connection and verified that remote access was successful
Allowed all traffic from the VPS to pass through the Wireguard interface
References
-
Synology Inc.. "Wireguard Package." Synology, 2021. Web.
-
Vig, Jannis.. "Configure a Wireguard VPN Server - Debian/Ubuntu Tutorial." Linode, 2021. Web.
-
"How to Forward Ports on Your Router." Port Forward, 2021. Web.