pfSense guide
What you get from us
Replace these placeholders with the details you received with your FixedIP.be order.
PRIVATE_KEY | the private key of your tunnels (keep it secret) |
PORT | the UDP port of our tunnel servers |
ENDPOINT_1 | the address of our tunnel server in Antwerp |
SERVER_PUBLIC_KEY_1 | the public key of our tunnel server in Antwerp |
TUNNEL_IP_1 | the tunnel address of your router towards Antwerp |
SERVER_TUNNEL_IP_1 | the tunnel address on our side in Antwerp (gateway) |
ENDPOINT_2 | the address of our tunnel server in Zaventem |
SERVER_PUBLIC_KEY_2 | the public key of our tunnel server in Zaventem |
TUNNEL_IP_2 | the tunnel address of your router towards Zaventem |
SERVER_TUNNEL_IP_2 | the tunnel address on our side in Zaventem (gateway) |
FIXED_IP | your fixed IPv4 address |
FIXED_SUBNET | your IPv4 subnet, for example /29 |
IPV6_LAN | a /64 from your IPv6 subnet for your network |
TUNNEL_IP6_1 | the IPv6 tunnel address of your router towards Antwerp |
SERVER_TUNNEL_IP6_1 | the IPv6 tunnel address on our side in Antwerp |
TUNNEL_IP6_2 | the IPv6 tunnel address of your router towards Zaventem |
SERVER_TUNNEL_IP6_2 | the IPv6 tunnel address on our side in Zaventem |
LAN_HOST | the internal address of your server or NAS, for example 192.168.1.10 |
This guide sets up your fixed IP on a pfSense firewall (CE 2.7 or Plus 23.09 or later) with the official WireGuard package. The firewall builds two tunnels, one to each PoP, and fails over automatically if one of them drops. Only the traffic of your fixed IP runs through the tunnels; all other traffic keeps going over your regular WAN.
Your fixed IP arrives on the firewall and is forwarded to a device on your network (LAN_HOST). Do you have several addresses? Then also read Multiple addresses at the bottom.
1. The package
System › Package Manager › Available Packages: install WireGuard.
2. The tunnels
VPN › WireGuard › Tunnels → Add Tunnel, twice:
| Field | Tunnel 1 | Tunnel 2 |
|---|---|---|
| Enable | on | on |
| Description | fixedip1 |
fixedip2 |
| Listen port | 51821 |
51822 |
| Private key | PRIVATE_KEY |
PRIVATE_KEY |
| Interface addresses | leave empty | leave empty |
3. The peers (our tunnel servers)
VPN › WireGuard › Peers → Add Peer, twice:
| Field | Peer 1 | Peer 2 |
|---|---|---|
| Tunnel | tun_wg0 (fixedip1) |
tun_wg1 (fixedip2) |
| Endpoint | ENDPOINT_1 port PORT |
ENDPOINT_2 port PORT |
| Keep alive | 25 |
25 |
| Public key | SERVER_PUBLIC_KEY_1 |
SERVER_PUBLIC_KEY_2 |
| Allowed IPs | 0.0.0.0/0 and ::/0 |
0.0.0.0/0 and ::/0 |
pfSense does not create routes for Allowed IPs by itself, so your regular internet traffic keeps going over your WAN. Enable WireGuard in VPN › WireGuard › Settings.
4. Interfaces, gateways and the failover group
- Interfaces › Assignments: assign
tun_wg0andtun_wg1asFIXEDIP1andFIXEDIP2. - Enable them, IPv4 Configuration Type Static IPv4, address
TUNNEL_IP_1/32andTUNNEL_IP_2/32, MTU1420. - For each, click Add a new gateway next to IPv4 Upstream gateway:
FIXEDIP_GW1with addressSERVER_TUNNEL_IP_1, andFIXEDIP_GW2with addressSERVER_TUNNEL_IP_2. - System › Routing › Gateway Groups → Add: name
FIXEDIP_FAILOVER,FIXEDIP_GW1on Tier 1,FIXEDIP_GW2on Tier 2, Trigger Level Member down.
Because each interface has a gateway, pfSense automatically sends replies back through the tunnel the connection came in on (reply-to).
In System › Routing › Gateways, fix the Default gateway IPv4 to your regular WAN gateway (not Automatic), so pfSense never moves all your traffic to a tunnel.
5. Your fixed IP on the firewall
The fixed IP goes on the loopback, separate from both tunnels. Firewall › Virtual IPs → Add
| Field | Value |
|---|---|
| Type | IP Alias |
| Interface | Localhost |
| Address | FIXED_IP / 32 |
6. Forwarding to your server
Firewall › NAT › Port Forward → Add, once for FIXEDIP1 and once for FIXEDIP2:
| Field | Value |
|---|---|
| Interface | FIXEDIP1 (second rule: FIXEDIP2) |
| Protocol | TCP |
| Destination | Single host or alias: FIXED_IP |
| Destination port range | HTTPS (or the port you need) |
| Redirect target IP | LAN_HOST |
| Redirect target port | HTTPS |
| Filter rule association | Add associated filter rule |
Also add a rule on FIXEDIP1 and FIXEDIP2 that allows ping: protocol ICMP, subtype Echo request, source SERVER_TUNNEL_IP_1 and SERVER_TUNNEL_IP_2 respectively. Our tunnel servers ping each tunnel to know which one works; without a reply, we don't send your fixed IP to that tunnel.
7. Outgoing traffic from your fixed IP too (optional)
- Firewall › NAT › Outbound: choose Hybrid Outbound NAT and add two rules (interface
FIXEDIP1andFIXEDIP2): sourceLAN_HOST/32, translation addressFIXED_IP. - Firewall › Rules › LAN: add a rule at the top with source
LAN_HOSTand, under Advanced Options, gatewayFIXEDIP_FAILOVER.
8. IPv6
On FIXEDIP1 and FIXEDIP2, also set IPv6 Configuration Type Static IPv6 with TUNNEL_IP6_1 / 128 and TUNNEL_IP6_2 / 128, with SERVER_TUNNEL_IP6_1 and SERVER_TUNNEL_IP6_2 as the IPv6 Upstream gateway, and create a second gateway group for IPv6 with the same tiers. Set IPV6_LAN::1/64 as a static IPv6 address on a LAN interface and have the Router Advertisements announce that subnet. Use the IPv6 group as the gateway in a LAN rule with source IPV6_LAN::/64.
Multiple addresses
Do you have a subnet (FIXED_SUBNET)? Then you can use it in two ways:
- Through your firewall (all addresses usable): put each address as a Virtual IP on Localhost and create port forwards per address as in step 6.
- Directly on your network: put the subnet on its own interface or VLAN with the first usable address as the interface address. On that interface, add a rule with gateway
FIXEDIP_FAILOVER, and onFIXEDIP1/FIXEDIP2the rules for whatever may come in.
Checking
- Status › WireGuard: both peers should show a recent handshake.
- Status › Gateways: both gateways are Online.
- Test from outside, for example with your phone on mobile data:
https://FIXED_IPshould end up at your server.
Testing failover: briefly disable tunnel fixedip1. FIXEDIP_GW1 goes Offline and the traffic runs via PoP 2. Then enable the tunnel again.
Rolling back
Remove in reverse order: the NAT and firewall rules, the Virtual IP, the gateway group, the interface assignments and the gateways, and finally the peers and the tunnels.
Problems?
- No handshake: check
ENDPOINT_1/ENDPOINT_2,PORTand the keys. - Gateway stays Offline even though there is a handshake: check the gateway address (
SERVER_TUNNEL_IP_1/_2). - Handshake OK, but connections hang: set the MTU of both interfaces to 1360 and the MSS to 1320.
- All your traffic suddenly goes through a tunnel: the default gateway is set to Automatic; fix it to your WAN.
Stuck? E-mail us at info@fixedip.be
Ready for your fixed IP?
Start today and be reachable everywhere.