In our journey so far, we have accomplished something monumental. We have replaced the flimsy, untrustworthy consumer-grade router with a powerful, open-source digital fortress. We have configured its core services, establishing a stable and intelligent foundation for our entire sovereign cloud. Our network is secure, but it is also an island. All of its power and potential is locked within the four walls of your home.
This post changes everything. Today, we build the secret passage.
We are about to implement the single most critical security architecture of this entire series: a hardened Virtual Private Network (VPN) gateway. This will be our secure, encrypted tunnel, allowing us to connect back to our home network from anywhere in the world—a coffee shop, a hotel, a friend’s house—and access our services as if we were sitting on our own couch.
This is not merely a feature; it is a fundamental shift in how you interact with your digital life. The concept is simple but profound. Instead of punching dozens of individual holes in our firewall for every new service we want to access remotely (a practice akin to leaving multiple windows open in your house), we will fortify our defenses and open just one, heavily guarded front door. Every remote connection, without exception, will come through this single, encrypted, and heavily scrutinized gateway. This is the “trusted perimeter” model, and it is the key to both security and simplicity.
This guide will be an exhaustive, step-by-step walkthrough of this entire process. We will solve the problem of a changing home IP address with Dynamic DNS. We will become our own certificate authority to establish a chain of trust. We will configure a battle-hardened OpenVPN server, create users, and export their configurations with a single click. There is no other guide you will need. Let’s begin.

Solving the Moving Target Problem with Dynamic DNS
Before we can build our gateway, we must first address a fundamental challenge of most residential internet connections: your public IP address is not permanent. Your Internet Service Provider (ISP) typically assigns you a “dynamic” IP address from a pool, and it can change at any time—when your modem reboots, during a network outage, or simply on a schedule.
This is a problem. If your home’s address keeps changing, how can you reliably find it from the outside world to connect your VPN? It’s like trying to find a friend’s house when they move every few days without telling you.
The solution is a service called Dynamic DNS (DDNS). A DDNS provider gives you a permanent, memorable hostname (like my-fortress-123.some-ddns.com), and you run a small client on your pfSense router that constantly checks your public IP. Whenever it changes, the client automatically tells the DDNS provider, “Hey, I’ve moved! Here’s my new address.” The DDNS provider instantly updates its records.
For us, this means we can always connect to my-fortress-123.some-ddns.com, and it will always point to our home, no matter how many times our ISP changes our IP address.
Setting Up a Free DDNS Account
There are many DDNS providers, but for this guide, we will use a long-standing free service called afraid.org (FreeDNS).
- Create an Account: Go to
https://freedns.afraid.org/and sign up for a free account. - Add a Subdomain: Once logged in, click on “Subdomains” in the left-hand menu, then click “Add a Subdomain.”
- Configure Your Hostname:
- Type: Leave this as
A. - Subdomain: This is the unique name you want. Choose something memorable and unique to you (e.g.,
my-digital-fortress). - Domain: Choose one of the many public domains offered by the service. There are thousands. Pick one you like.
- Destination: Your current public IP address should be automatically filled in. Don’t worry if it’s not perfect; our router will update it.
- Solve the Captcha and click Save.
- Type: Leave this as
You now have a DDNS hostname. But how do we automate the updates? For that, we need a special link.
- Get Your Update Link: Go back to the main FreeDNS page and click on “Dynamic DNS” in the left menu. You will see your new record listed. Right-click on the “Direct URL” link for your record and copy the link address. It will look something like
http://freedns.afraid.org/dynamic/update.php?SOME_VERY_LONG_TOKEN. This token is secret! Do not share it. Paste this link into a text file for the next step.
Step 2: Configuring the Dynamic DNS Client in pfSense
Now, let’s teach pfSense how to automatically update our new hostname.
- In the pfSense web GUI, navigate to Services > Dynamic DNS.
- Click the Add button to create a new client.
- Configure the Client:
- Service Type: Select
FreeDNS. - Interface to Monitor: Select
WAN. This tells pfSense to monitor the IP address of your internet-facing connection. - Hostname: Enter the full hostname you created, including the subdomain and domain (e.g.,
my-digital-fortress.mooo.com). - Username: This field is not needed for FreeDNS’s token-based update. You can leave it blank.
- Password: This is also not needed.
- Update URL: This is the critical part. Paste the “Direct URL” you copied from the FreeDNS website.
- Description: Give it a descriptive name, like “FreeDNS for Home.”
- Service Type: Select
- Click Save.
- After saving, you will be returned to the Dynamic DNS client list. You will see your new entry. The “Cached IP” column might show “N/A” or an old IP at first.
- Click the Save & Force Update button at the bottom of the page. This will trigger the first update.
- Verification: After a few moments, the page should reload, and you should see a green IP address under the “Cached IP” column. This means pfSense successfully contacted FreeDNS and updated your record with your current public IP. You can also check the logs by going to Status > System Logs > System > Dynamic DNS.
You have now solved the moving target problem. Your hostname will always point to your home. We are ready to build the gate.

Building the Trust Infrastructure
OpenVPN is built on a foundation of cryptographic trust using digital certificates. Before we can configure the server, we must first create our own internal “passport office”—a Certificate Authority (CA)—that can issue trusted identity documents (certificates) to our server and our users.
Creating Your Certificate Authority (CA)
- Navigate to System > Cert. Manager.
- You will be on the CAs tab. Click the Add button.
- Create the CA:
- Descriptive name: Give your CA a clear name, like
Home Network CA. - Method: Choose
Create an internal Certificate Authority. - Key type:
RSAis fine. - Key length (bits):
2048offers a great balance of security and performance. - Digest Algorithm:
sha256is the modern standard. - Lifetime (days): The default of
3650(10 years) is appropriate for a root CA. - Common Name: This can be the same as the descriptive name, e.g.,
Home Network CA. - Fill in your Country, State, and City if you wish.
- Descriptive name: Give your CA a clear name, like
- Click Save.
You are now your own authority. You have created a root of trust for your entire network.
Issuing a Certificate for the OpenVPN Server
Now that our “passport office” is open, we need to issue the first passport—an identity certificate for the OpenVPN server itself.
- While still in the Cert. Manager, click on the Certificates tab.
- Click the Add button.
- Create the Server Certificate:
- Method: Choose
Create an internal Certificate. - Descriptive name: Give it a clear name, like
OpenVPN Server Cert. - Certificate Authority: Ensure your newly created
Home Network CAis selected. - Key type, length, and digest algorithm: Match the settings you used for the CA (
RSA,2048,sha256). - Lifetime: A shorter lifetime, like
825days (a little over two years), is good practice for server certificates. - Common Name: This can be anything you like, but a descriptive name like
pfsense-openvpn-serveris good practice. - Certificate Type: This is CRITICAL. From the dropdown menu, select
Server Certificate.
- Method: Choose
- Click Save.
Our infrastructure of trust is now in place. We have an authority and a valid, signed certificate for our server. We are ready to use the wizard.
The OpenVPN Server Wizard
pfSense provides a convenient wizard that walks you through the initial setup and automates the creation of the necessary firewall rules.
- Navigate to VPN > OpenVPN.
- Click on the Wizards tab.
- Step 1: Type of Server: Leave the
Type of ServerasLocal User Access. Click Next. - Step 2: CA Selection: From the
CA Certificatedropdown, select yourHome Network CA. Click Next. - Step 3: Server Certificate Selection: From the
Server Certificatedropdown, select yourOpenVPN Server Cert. Click Next. - Step 4: Server Setup (The Most Important Screen)
- Interface:
WAN. - Protocol:
UDP on IPv4 only. This is a deliberate, expert choice. As recommended by the FUTO guide, sticking to IPv4-only for the VPN avoids a huge range of complex, difficult-to-diagnose problems with buggy residential IPv6 deployments, Carrier-Grade NAT, and Path MTU Discovery issues. This choice prioritizes reliability. - Local Port:
1194(the standard OpenVPN port). - Description:
Home OpenVPN Server.
- Interface:
- Step 5: Cryptographic Settings
- TLS Configuration: Uncheck the legacy
Use a TLS Keyoption. - TLS Authentication: Check the box for
Enable authentication of TLS packets. This is a modern security feature. - Peer Certificate Authority: Ensure your
Home Network CAis selected. - DH Parameter Length:
2048bits. - Encryption Algorithm: Choose a modern, secure cipher.
AES-256-GCMis an excellent choice. It is fast and secure. - Auth Digest Algorithm: When using a GCM cipher, this is handled automatically. Select
(none). - Hardware Crypto: Leave as
No Hardware Crypto Accelerationfor maximum compatibility.
- TLS Configuration: Uncheck the legacy
- Step 6: Tunnel Settings
- Tunnel Network: This is the virtual IP address network for your VPN clients. It MUST NOT overlap with your LAN. A good, isolated choice is
10.0.8.0/24. - Redirect IPv4 Gateway: Check this box. This is a critical setting for a “full tunnel” VPN. It forces all traffic from connected clients (including all their web browsing) through the VPN. This protects them on untrusted networks (like public Wi-Fi) and gives them full access to your home network.
- Local Network: Enter your home LAN network here. For our guide, this is
10.0.0.0/24. This tells the VPN server to allow clients to reach devices on your LAN. - Concurrent connections: Set a reasonable number, like
5.
- Tunnel Network: This is the virtual IP address network for your VPN clients. It MUST NOT overlap with your LAN. A good, isolated choice is
- Step 7: Client Settings
- DNS Servers: Check
Provide a DNS server list to clientsand enter the LAN IP of your pfSense router in theServer 1box:10.0.0.1. This is essential for clients to be able to resolve local hostnames likeserver.home.arpa. - DNS Default Domain: Check
Provide a default domain name to clientsand enter the domain you set up in the last guide:home.arpa.
- DNS Servers: Check
- Step 8: Firewall Rule Configuration: The wizard will offer to create the firewall rules for you. Ensure both checkboxes (
Firewall RuleandOpenVPN rule) are checked. This is a huge time-saver. Click Next. - Step 9: Finish: Click Finish. The wizard will save your configuration and create the rules.
Verifying the Firewall Rules
The wizard should have done its job, but a good administrator always verifies.
- Navigate to Firewall > Rules > WAN. You should see a new rule at the top that allows traffic on
UDPport1194from any source. This is the rule that opens the front door for your VPN. - Navigate to Firewall > Rules > OpenVPN. You should see a new rule that allows traffic from any source to any destination. This rule gives your connected VPN clients permission to access your LAN and the internet.
Your OpenVPN server is now configured and running.
User Management and Client Deployment
A server is useless without clients. Now we need to create user accounts and provide them with the necessary configuration files to connect.
Create a User Account
- Navigate to System > User Manager.
- On the Users tab, click Add.
- Create the User:
- Username: Choose a username (e.g.,
john). - Password: Set a new, strong password for this user.
- Full name:
John Doe.
- Username: Choose a username (e.g.,
- Issue a User Certificate: In the “User Certificates” section, check the box
Click to create a user certificate. - Certificate Details:
- Descriptive name: A name will be auto-generated (
john's cert). This is fine. - Certificate Authority: Ensure your
Home Network CAis selected.
- Descriptive name: A name will be auto-generated (
- Click Save.
You have now created a user who has both a password and a unique digital certificate signed by your CA.
The Easy Button – Client Export Package
Manually creating OpenVPN configuration files is tedious and error-prone. Instead, we will use a fantastic pfSense package that does all the work for us.
- Navigate to System > Package Manager > Available Packages.
- In the search box, type
openvpnand press Enter. - Find
openvpn-client-exportin the list and click the Install button. Confirm the installation. - Once it’s finished, navigate to the new menu item: VPN > OpenVPN > Client Export.
- Configure Export Settings:
- Host Name Resolution: This is critical. Change this from
Interface IP AddresstoOther. - Host Name: In the box that appears, enter the Dynamic DNS hostname you created earlier (e.g.,
my-digital-fortress.mooo.com).
- Host Name Resolution: This is critical. Change this from
- Click Save as default.
- Export the Configuration: Scroll down to the bottom of the page. You will see a list of your users and several download options. For most desktop and mobile clients, the Most Clients option is the best. Click the link for your user (e.g.,
john (user certificate)) under the “Most Clients” section to download a.ovpnconfiguration file.

Connecting Your First Client
You are now ready to connect.
- For Windows/macOS/Linux: Install an OpenVPN client like the official OpenVPN Connect or the popular Viscosity client. Then, simply import the
.ovpnfile you downloaded. Enter the username and password you created when prompted. - For iOS/Android: Install the official “OpenVPN Connect” app from the app store. The easiest way to get the profile on your phone is to email the
.ovpnfile to yourself, open the email on your phone, and tap the attachment to import it into the app.
Final Verification
How do you know it’s working?
- Check the Status in pfSense: Go to Status > OpenVPN. Under “Client Connections,” you should see your user connected, with a virtual IP from the
10.0.8.0/24range. - Check Your Public IP: On your connected device (e.g., your phone on cellular data), open a web browser and go to a site like
ifconfig.me. The IP address it shows should be your home network’s public IP address, not your cellular provider’s IP. This confirms you are in the “full tunnel.” - Test Local DNS: On your connected device, try to open your pfSense web GUI by its name:
http://pfsense.home.arpa. If it loads, it proves that the VPN DNS settings are working perfectly.
What’s Next?
Take a moment to appreciate what you have just built. You have a secure, private, and encrypted gateway into your sovereign cloud, accessible from anywhere in the world. You can now manage your server, access your files, and use your home internet connection on any device, all while being protected from the dangers of untrusted public networks.
This is the key that unlocks the true potential of self-hosting. Now that our fortress is built and we have a secure way in, we can start filling it with valuable services. In the next post, “A Quieter Internet: Network-Wide Ad & Tracker Blocking with pfBlockerNG,” we will implement our first major quality-of-life improvement—a service that will benefit every single device in your household and provide a tangible, immediate reward for your efforts.








