pfSense WireGuard Setup

WireGuard can be used to securely access the network remotely.


Package Installation

Click on the System dropdown.

Select Package Manager.


Click on the Available Packages tab.

It may take a moment for the package list to populate.


Scroll down to WireGuard.

Click +Install.

Click Confirm.

Once the installation completes, a success message will appear at the bottom of the Package Installation dialog.


Configuration

Click on the VPN dropdown.

Select WireGuard.


Click on the Tunnels tab.

Click +Add Tunnel.

Next to Description, give the tunnel a name.

Next to Interface Keys, click Generate.

Copy the public key and save it somewhere safe for later use.

Define the VPN tunnel network and subnet range.

Click Save Tunnel.


Click on the Settings tab.

Check the box next to Enable WireGuard.

Click Save.


Click Apply Changes.


Firewall Rules

Click on the Firewall dropdown.

Select Rules.

Click on the WireGuard tab.

Click Add.

Next to Action, select Pass from the dropdown.

Next to Protocol, select Any from the dropdown.

Next to Description, enter a description for the rule.

Click Save.


Click on the WAN tab.

Click Add.

Next to Action, select Pass from the dropdown.

Next to Protocol, select UDP from the dropdown.

Next to Destination, select WAN Address from the dropdown.

Next to Destination Port Range, set both From and To to 51820.

Next to Description, enter a description for the rule.

Click Save.


Click Apply Changes.


Client Setup

Open the WireGuard client on the device that will be used to connect to the VPN. This example uses the iOS application, though the process is similar across all clients.

Click +Add.

Select Create from scratch.

Give the connection a name.

Generate the key pair.

Enter the Tunnel Address, matching the subnet configured during the WireGuard tunnel setup.

Enter the preferred DNS servers. This example uses Quad9 and Google DNS.

Copy the public key.

Click Save.


pfSense Peer Management

Return to the pfSense webConfigurator.


Click on the VPN dropdown.

Select WireGuard.

Click on the Peers tab.

Click +Add Peer.

Next to Tunnel, select the appropriate tunnel from the dropdown.

Next to Description, enter a description for the connecting device.

Enter the public key copied from the client device.

Next to Pre-shared Key, click Generate.

Under Allowed IPs, enter the IP address or subnet assigned to the client device.

Copy the pre-shared key.

Save it somewhere safe for later use.

Click Save Peer.


Click Apply Changes.


Client Peer Management

Return to the WireGuard client on the device.

Edit the VPN configuration.

Select Add Peer.

Enter the public key copied earlier from the WireGuard tunnel configuration.

Enter the pre-shared key copied from the pfSense peer configuration.

Enter the public WAN IP address of the network as the Endpoint. This can be found on the pfSense dashboard under Interfaces next to WAN.

Ensure the port number is included at the end of the address (51820 in this example).

Click Save.


The home network can now be accessed remotely from the configured device.


Loading...