WireGuard is a fast, modern, and secure VPN tunnel protocol that is rapidly gaining popularity. In this tutorial, we’ll walk you through setting up WireGuard VPN on pfSense firewall and connecting to it using Linux Mint as the client. This setup provides encrypted communication between your devices with minimal configuration.
Whether you’re an IT enthusiast or a system administrator, setting up WireGuard will boost your network security and remote access capabilities. Let’s dive in.
Prerequisites
- pfSense firewall (version 2.5.0 or later)
- WireGuard package installed on pfSense
- A Linux Mint machine with WireGuard installed
- Basic understanding of networking and firewall rules
Configure WireGuard on pfSense
-
Login to pfSense
-
Go to System > Package Manager > Available Packages
-
Search and install the WireGuard package
-
-
Go to VPN > WireGuard
-
Click Add Tunnel
-
Enter a description
-
Click Generate to create a public and private key pair
-
Assign a Tunnel Address (172.16.0.1/24)
-
Save and enable the tunnel
-
-
Add a Peer
-
Description: LinuxMint or whatever
-
Allowed IPs: (172.16.0.2/32)
-
Enter the client’s public key (will be generated later)
-
Save changes
-
Firewall and NAT Rules on pfSense
-
Firewall Rule
-
Go to Firewall > Rules > WAN
-
Add a rule to allow UDP traffic to the port you assigned in WireGuard (default: 51820)
-
-
NAT (If Needed)
-
Go to Firewall > NAT > Outbount
-
Select Hybrid NAT, Save and apply
-
Add a rule to NAT traffic from 172.16.0.0/24 to the WAN interface
-
Configure WireGuard on Linux Mint
-
Install WireGuard
-
Generate Keys
Run the following in the terminal:-
Save the generated keys securely.
-
Share the public key with pfSense peer configuration.
-
-
Create the Configuration File
Create a new file
-
cd /etc/wireguard/
- nano wg0.conf
- Paste this code into wg0.conf
[Interface]
PrivateKey = YOUR_PRIVATE_KEY
Address = 172.16.0.2/24
[Peer]
PublicKey = PF_SENSE_PUBLIC_KEY
AllowedIPs = 172.16.0.0/24, 0.0.0.0/0
Endpoint = YOUR_PFSENSE_PUBLIC_IP:51820 -
Replace placeholders with actual values.
-
Start and Enable WireGuard Tunnel
-
Bring up the VPN Tunnel
-
Check the VPN Status
-
Enable WireGuard to Start at Boot
With the VPN tunnel active, your Linux Mint system can securely connect to the internal network behind your pfSense firewall.
Comment below if you have any question 🙂