--- title: "Setting up Site-to-Site VPN on pfSense" slug: "site-to-site-pfsense" description: "pfSense IPSEC tunnel creation Go to VPN -> IPsec Select +Add P1 Key Exchange Version: IKEv2 Internet Protocol: IPv4 Interface: Remote Gateway." updated: 2026-09-08T13:09:32Z published: 2026-09-08T13:09:32Z canonical: "help.nordlayer.com/site-to-site-pfsense" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.nordlayer.com/llms.txt > Use this file to discover all available pages before exploring further. # Setting up Site-to-Site VPN on pfSense **Note**: If your device/service supports SHA256 and DH group 14, it is recommended to use these settings instead. ## pfSense IPsec Site-to-Site VPN tunnel configuration 1. Go to VPN -> IPsec 2. Select +Add P1 - **Key Exchange Version**: [IKEv2](https://nordlayer.com/learn/vpn/ikev2/) - **Internet Protocol**: IPv4 - **Interface**: Your pfSense WAN Interface - **Remote Gateway**: the IP of your NordLayer server with a dedicated IP - **Authentication Method**: Mutual PSK - **Negotiation Mode**: Main - **My Identifier**: My IP Address - **Peer Identifier**: Peer IP Address - **Pre-Shared key**: generate a key (we will also need this value on our end) 1. Encryption Algorithm - **Algorithm**: AES - **Key Length**: 256 bits - **HASH**: SHA256 - **DH Group**: 14 - **Lifetime (Seconds)**: 28800 1. Advanced Options - **Disable rekey**: Unchecked - **Margintime (Seconds)**: Empty - **Responder Only**: Unchecked - **NAT Traversal**: Auto - **Dead Peer Detection**: Checked - **Delay**: 10 - **Max failures**: 5 1. Select **Save** ![FortiGate IPsec Phase 1 configuration showing IKEv1, IPv4, WAN interface, and mutual PSK settings](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.50.24(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=sf%2BJARq%2BPpRlw71NVfeXNsseVxej%2B45ouRrGoRESYOw%3D) ![FortiGate Phase 1 encryption settings with AES-128, SHA256, and DPD configurations](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.50.31(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=kmRsqMKc1rEUUOku39cHweh%2BvTPvgYnc4lXCAR7tW2M%3D) 1. Add phase 2: Select +Add p2 - **Mode**: Tunnel IPv4 - **Local Network**: Network: Put your local LAN network subnet - **Remote** Network: Network: 10.6.0.0/20 - **Phase 2**: Proposal - **Protocol**: ESP - **Encryption Algorithm-AES**: 256 bits - **Hash Algorithms**: SHA256 - **PFS Key Group**: 14 - **Lifetime (Seconds)**: 3600 1. Select Save ![FortiGate IPsec tunnel displaying Phase 1 configuration with WAN gateway and Add P2 button](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.50.38(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=TqNqf5D49Cf6YRU%2FFk2A1VSrSksoV4LMayEVdnOQOsc%3D) 1. Select Apply Changes ![FortiGate IPsec Phase 2 configuration showing local and remote network addresses with tunnel mode](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.50.44(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=%2BlpwFvwtBaVef%2Bm8MOqi1nUPNMewM4PfmuWB1xcSipk%3D) ![FortiGate Phase 2 encryption settings with ESP, AES-256, SHA256, and PFS group configurations](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.50.50(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=NUwdLnjl2m00iAz1MvjB0s921V04BlfmgRlleEg0q28%3D) ## pfSense Firewall Rules (Optional) ![pfSense firewall menu showing NAT, Rules, and Schedules options under Firewall dropdown](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.50.57(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=G8RAqlzyvp%2F%2BfQMfeRLZlKrXnLFx5sxSrsol52WEeNg%3D) 1. In the Menu Bar go to Firewall -> Rules 2. Under IPSEC add a new rule - **Action**: Pass - **Quick**: Mark v - **Interface**: WAN and IPSEC - **Source**: the IP of your NordLayer server with a dedicated IP - **Destination**: Either put any or you can limit to your FW external IP - Select **Save**. ![pfSense firewall rule editor with WAN IPsec interface, TCP protocol, and source IP configuration](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.51.04(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=2CLGMM%2F1NCkP7W7aaPyVr%2FxVx7eZe6uG88XG8uFmyo8%3D) ![pfSense firewall rule configuration showing destination, logging, and tracking ID settings with Save button](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.51.09(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=yQnJEaVO%2BTfRkyesIpWA7veSMOr4G6mo9HbMWAcWV3E%3D) ![pfSense Floating firewall rules table showing IPv4 TCP rule for source IP with action buttons](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.51.16(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=lwqbmMNckr96Wk%2FIYM02fHtSkh76GqNjj%2Foo7wz%2F0u0%3D) 1. Under IPSEC add a new rule: - **Action**: Pass - **Source**: the IP of your NordLayer server with a dedicated IP - **Destination**: Either put any or you can limit to your FW external IP - Select **Save**. ![pfSense IPsec firewall rules showing IPv4 TCP rule with source IP and action buttons](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.51.22(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=BbOXhWeSrt7RITFh1cd8KSVNub%2FxoOnAB8WrbzccYvM%3D) ![pfSense firewall rule editor with IPsec interface, IPv4, TCP protocol, and source IP configuration](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.51.27(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=u8%2Fvy53K8G6ryU3%2FpJe4yDufpq0ItOqWbIAwPF7UN5Y%3D) ![pfSense firewall rule form showing destination, port range, logging, and tracking ID configuration fields](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.51.32(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=82JGVteEs5PXivbLYIo61Rvfqo6pzCN24FYlCk%2Fyvq8%3D) 1. Select Apply Changes ## Bringing the tunnel up 1. In the Menu Bar go to Status:-> IPsec 2. On the tunnel, you created select: Connect VPN ![pfSense IPsec status overview showing disconnected tunnel with local and remote IP addresses](https://cdn.document360.io/fc1049cd-8f71-4b89-b9b8-dbca9fdcdd16/Images/Documentation/Screenshot%202021-05-26%20at%2015.51.37(1).png?sv=2026-02-06&spr=https&st=2026-11-21T16%3A06%3A39Z&se=2026-11-21T17%3A06%3A39Z&sr=b&sp=r&sig=VJfJL%2BgRDuU6d%2FKevKrn2OMl4iKtmkr7BLl82NaqeKw%3D) ## Ending note: In order to finalize the site-to-site tunnel, please create a setup in [Sites tab of the NordLayer Control Panel](/v1/docs/site-to-site). - Pre-shared key - you can generate it or we can provide it - Encryption  details (AES, SHA and DH group) - AES256, SHA256 and DH group 14 are recommended (also must support IKEv2) - Remote gateway/router public IP (must be reachable while connected to the server with a dedicated IP) - Remote subnet and mask (the subnet is used in your local network) --- **Note**: In case you have any questions or issues, press '**Chat with support**' at the bottom of the page.