Setting up ProtonVPN with Opnsense with Ease
586 words
3 minutes
Setting up ProtonVPN with Opnsense with Ease
How to setup ProtonVPN with Opnsense using Wireguard
You’ll need a ProtonVPN Subscription and get your WireGuard Configuration
Select
- Router
- Block Malware Only / Doesn’t matter
- VPN Accelerator
- Region of choice.
The following setup will allow you to setup an Alias that will be the list of clients you want to forward via VPN. You can do a broad network-wide setup, but that isn’t ideal with my living situation.
Create your Aliases
- Firewall → Aliases
- RFC1918
- Type: Networks
- Content:
192.168.0.0/16172.16.0.0/1210.0.0.0/8
- VPNForwarding
- Type: Networks
- Content: The IP Subnets you want to forward:
192.168.53.23/32(<- if you want a specific IP) or something like192.168.0.0/12
- RFC1918
Configure Wireguard
- Wireguard Peer
- VPN → WireGuard → Peers
- Click
+and configure the Instance:- Enabled: Checked
- Name:
ProtonVPN_Peer(or similar) - Public Key: Copy the
PublicKeyfrom the[Peer]section of your ProtonVPN.conffile. - Allowed IPs:
0.0.0.0/0(and::/0for IPv6 if desired). This is what the VPN server expects, but we will control the routes on the OPNsense side. - Endpoint Address: Copy the server address (IP or hostname) from the
[Peer]section. - Endpoint Port: Copy the port number from the
[Peer]section. - Keepalive:
25(Recommended) - Pre-shared Key: (Optional) Copy if provided by ProtonVPN (Usually not).
- Click
- VPN → WireGuard → Instances
- Click
+and configure the Instance:- Enabled: Checked
- Name:
ProtonVPN_WG(or similar) - Private Key: Copy the
PrivateKeyfrom the[Interface]section of your ProtonVPN.conffile. - Public Key: Leave Empty (Will auto-populate after saving)
- Tunnel Address: Copy the IP address/CIDR from the
Addressline in the[Interface]section (e.g.,10.x.x.x/32). - Peers: Select the Peer you created in Step 1 (
ProtonVPN_Peer). - Disable Routes: ✓ CHECK THIS BOX. (This is essential for Policy-Based Routing/Selective Routing).
- Click
- VPN → WireGuard → Peers
Assign WireGuard Interface and Gateway
- Interfaces → Assignments
- At the bottom, Select your wireguard Device and Add.
- It should look something like
wg0 (WireGuard - ProtonVPN_WG)
- It should look something like
- Then go to Interfaces → Wireguard Device
[ProtonVPN_WG] - Enable Interface Checked and save.
- At the bottom, Select your wireguard Device and Add.
- System → Gateway → Configuration
- Click
+- Name:
Proton_VPN_GW(or similar). - Interface: Select the new WireGuard interface (
WG_PROT_VPN). - Address Family: IPv4.
- Gateway: Specify an IP address one number lower than your WireGuard Tunnel Address (e.g., if the tunnel address is
10.x.x.5/32, use10.x.x.4). This is an arbitrary “Far Gateway” IP that OPNsense uses for routing.- Ignore the Far Gateway checkbox. Leave it unchecked.
- Monitor IP: (Optional, but recommended for health check). You can use one of ProtonVPN’s DNS servers (e.g.,
10.2.0.1or10.2.0.2if provided in their config) or a public one like1.1.1.1. - Disable Gateway Monitoring: ✓ Check this box (because the Monitor IP is not directly on the WireGuard subnet).
- Name:
- Click
Firewall Rules
- LAN interface Rule
- Firewall → Rules → LAN or whatever your interface is called.
- Action: Pass
- Interface: OPT1 (or the interface where 192.168.3.0/24 resides)
- Direction: In (ChatGPT told me Out, but this should be In)
- TCP/IP Version: IPv4 (and add a separate rule for IPv6 if needed)
- Protocol: Any
- Source:
- Source:
**VPNForwarding**(Select the alias you created)
- Source:
- Destination:
- Invert match: ✓ Check this box
- Destination:
**RFC1918**(This ensures local network traffic is not routed through the VPN, allowing communication with your other LAN subnets, printer, etc.)
- Gateway:
**Proton_VPN_GW**(Select the WireGuard gateway you created)
- Firewall → Rules → LAN or whatever your interface is called.
- Outgoing Rule
- Firewall → NAT → Outbound. You’ll need to have Hybrid/Manual selected here.
- Interface:
**WG_PROT_VPN**(Select your WireGuard interface) - TCP/IP Version: IPv4
- Protocol: Any
- Source:
- Source network:
**VPNForwarding**(Select the alias you created)
- Source network:
- Destination: Any (or if you want to be extremely specific, you can use
**!RFC1918**to match the firewall rule, but Any is typically fine here). - Translation / Target: Interface address
- Interface:
- Firewall → NAT → Outbound. You’ll need to have Hybrid/Manual selected here.
Verify
Verifiy that the IP is not your original IP.
Modifying list of clients using VPN.
Go to Firewall -> Aliases and now you can modify VPNForwarding with whatever IPs you want to forward to your VPN.
You could even remove your current IP from the list to temporarily remove VPN if you want to see if your VPN is the reason why some sites don’t work.
Hopefully this guide is helpful. Thanks for reading!
Share Article
If this article helped you, please share it with others!
Setting up ProtonVPN with Opnsense with Ease
https://dahn.me/posts/opnsense-protonvpn/ Related Posts Smart
1
Hako - A Temporary Box Storage Solution
Self-Hosting A project for temporary file uploads.
2
Multi-Instanced AdGuardHome Setup Guide
Self-Hosting How to run multiple AdGuardHome Instances together.
3
Why You Should Use Valkey Instead of Redis
Self-Hosting Migrating from Redis to Valkey.
4
Setting up Textractor w/ VNs on Linux
Self-Hosting Using Textractor w/ VNs on Linux EZ.
Random Posts Random