🔒
← All setup guides

pfSense WireGuard Setup Guide

Manual gateway Works as a gateway for one LAN with no extra steps. Extra VLANs need a few rules added on the device by hand, explained below.

pfSense is FreeBSD-based. WireGuard is available via the package manager. Like OPNsense, NAT is configured through the firewall UI — not via PostUp scripts.

1

Install the WireGuard package

Go to System → Package Manager → Available Packages. Search for and install pfSense-pkg-WireGuard.

2

Create a tunnel in ProxyLink

Go to Devices → + Add → Router / LAN site, select Router / Gateway, enter your LAN subnet, and note all values from the downloaded config. On the gateway page, switch the download picker to 🌐 Router (MikroTik / pfSense / OpenWRT) before clicking Activate, otherwise you get a RouterOS .rsc script instead of a .conf file.

3

Create the WireGuard tunnel

Go to VPN → WireGuard → Tunnels → Add Tunnel.

  • Description: ProxyLink
  • Private Key: from your config
  • Listen Port: leave default
4

Add the ProxyLink server as a peer

Under the tunnel, go to the Peers tab → Add Peer:

  • Public Key: server public key
  • Endpoint: server IP + port
  • Allowed IPs: 10.100.0.0/16
  • Keepalive: 25
5

Assign the interface

Go to Interfaces → Assignments. Assign tun_wg0 as a new interface. Enable it and name it PROXYLINK. Set the IP to your VPN IP with /16.

6

Configure outbound NAT

Go to Firewall → NAT → Outbound. Switch to Manual mode.

Add a rule: Interface = PROXYLINK, Source = your LAN subnet, Translation = Interface address.

Good to know

pfSense is FreeBSD — PostUp lines are irrelevant. All NAT must be configured via the pfSense firewall UI.
Without assigning tun_wg0 as an interface, you cannot apply firewall rules or NAT to WireGuard traffic.

Reaching more than one VLAN

One LAN needs nothing beyond this guide. If the site has several VLANs (a camera VLAN, a PBX VLAN, a guest network), there is one more thing to know.

ProxyLink gives every gateway its own private address range and translates between that range and your real LAN addresses. That is what lets two different clients both use 192.168.1.0/24 without colliding. The translation rules live in the PostUp and PostDown lines of the config we generate.

pfSense cannot run those rules for itself, so extra VLANs are routed directly instead of being translated. Two consequences worth knowing:

If a site has several VLANs and you would rather not maintain that by hand, put a small Linux box (a Raspberry Pi is plenty) or a MikroTik beside the router and use it as the gateway. Both are managed, so every VLAN is handled automatically and the existing router is left alone. See the Linux and MikroTik guides.

What you get once the tunnel is up

Ready to connect?

Create a free account and set up your first tunnel in minutes. Free during early access — no card required.

Setup guides for other platforms