The NAS That Needed a Fence
Date: August 13, 2023 Issue: Accessing Synology NAS from work Approaches: VPN (safe) vs WAN exposure (risky) Result: VPN with firewall restrictions
The Problem
I had files on my Synology NAS at home that I needed to access from work. Scripts, documentation, the occasional ISO that lived on the array.
The NAS was at 192.168.1.10. Work was⦠not on my home network.
Simple question: how do I get to those files?
Option 1: VPN (The Right Way)
I already had OpenVPN running on pfSense. The VPN was for pentesting lab access, but nothing stopped me from using it for NAS access too.
The setup was straightforward:
- Create a share on the Synology (DSM ā Control Panel ā Shared Folder)
- Export an OpenVPN client config from pfSense
- Connect from work, access the share like itās local
But I wanted to be surgical about it. VPN clients shouldnāt have access to my entire home network. Just the NAS.
Restricting VPN Access
In pfSense (Firewall ā Rules ā OpenVPN):
PASS: VPN subnet ā 192.168.1.10 (TCP 445)
BLOCK: VPN subnet ā Any
This meant VPN clients could only talk to the NAS on the SMB port. Nothing else. Canāt SSH to my workstation. Canāt reach the IoT garbage. Canāt pivot anywhere.
Also adjusted the OpenVPN server config:
IPv4 Local network(s): 192.168.1.10/32
Donāt push routes for the whole LAN. Just push a route for the NAS.
Option 2: WAN Exposure (The Risky Way)
I also asked: what if I skip the VPN entirely and just expose the NAS to the internet?
This is where the conversation got educational.
The āJust Forward Port 5001ā Approach
Port 5001 is DSMās HTTPS interface. Forward that, access the web UI from anywhere.
Problems:
- Anyone can hit the login page
- Brute-force attacks are trivial
- Zero-days in DSM = instant compromise
The Security Mitigations
If I had to expose it (I didnāt), hereās what the hardening would look like:
-
Random external port. Donāt use 5001 externally. Pick something obscure (like 7293). Security through obscurity isnāt security, but it stops the casual scanner.
-
HTTPS only. Get a real certificate via Letās Encrypt. No HTTP. Ever.
-
Dedicated user. Never expose admin. Create a read-only user that can only see the specific share.
-
Synology firewall. Built into DSM. Restrict by geography or IP range.
-
Auto-block. 5 failed logins = IP blocked for 24 hours. Brute-force becomes impractical.
-
2FA. Obviously.
Why I Didnāt Do This
Because VPN exists.
All that hardening? Itās work. Itās maintenance. Itās attack surface. The VPN approach gives me encrypted traffic, no public exposure, and identical functionality.
Thereās no scenario where āexpose SMB to the internetā is the right choice.
The Actual Config
Hereās what I ended up with:
pfSense OpenVPN Server:
Local network(s): 192.168.1.10/32
Tunnel network: 10.8.0.0/24
pfSense Firewall (OpenVPN tab):
Rule 1: PASS - Source: 10.8.0.0/24, Dest: 192.168.1.10, Port: 445/TCP
Rule 2: BLOCK - Source: 10.8.0.0/24, Dest: Any
Work laptop:
# Connect VPN
sudo openvpn --config home.ovpn
# Access share
# \\192.168.1.10\WorkFiles
Thatās it. Files accessible. Everything else locked down.
What I Learned
VPN is always the answer. For remote access to home resources, thereās no scenario where exposing services directly beats encrypted tunneling.
Firewall rules are about restriction, not permission. The default should be āblock everything.ā Then allow whatās needed.
Users are scoped to resources. The work VPN connection uses credentials that only allow SMB access. Even if someone stole those creds, they couldnāt do anything but list files.
Security is layers. VPN + restricted routing + firewall rules + limited user permissions. Each layer assumes the previous one failed.
Later Evolution
This setup lasted about six months. Then Tailscale happened.
One binary. Mesh networking. Automatic encryption. No port forwarding. No firewall rules. Just⦠it works.
But in August 2023, I didnāt know about Tailscale. OpenVPN and pfSense firewall rules were the tools I had. And they worked.
The question isnāt ācan I expose this to the internet?ā Itās āshould I?ā