To connect 2 physical sites, to access local network resources, as well as remote network resources securely and transparently, you can create an IPsec VPN tunnel.
But, in this tutorial, we will use OpenVPN instead of IPsec. The goal remains the same.
Warning : to more easily learn how to configure a site-to-site OpenVPN tunnel, we will use a shared key.
However, as noted on the "OpenVPN Site-to-Site Configuration Example with Shared Key | pfSense Documentation" page, you should use SSL certificates and not a shared key. But, the use of certificates adds complexity to understanding the configuration of OpenVPN.
Note: as for the IPsec tunnel in our previous tutorial, we have virtualized an infrastructure with 2 sites: site 1 (Brussels) with the network ID "10.0.1.0/24" and site 2 (Paris) with the network ID " 10.0.2.0/24".
If a private (local) IP address is assigned to your WAN interface, network traffic will be blocked by default.
Which would also block the connection between the OpenVPN client and the OpenVPN server.
If this is your case, go to "Interfaces -> WAN" and uncheck the "Block private networks and loopback addresses" box located at the bottom of the page.
Next, click "Save", then "Apply Changes" (at the top of the page).
On site 1 (Brussels), go to: VPN -> OpenVPN.
On the "VPN / OpenVPN / Server" page that appears, click: Add.
On the OpenVPN server creation page, specify:
For the "Endpoint Configuration" section, indicate:
For the "Cryptographic Settings" section, leave the encryption settings at default and make sure to leave the "Automatically generate a shared key" box checked so that OpenVPN generates a new shared key.
The shared key generated by OpenVPN for the OpenVPN server must then be copied/pasted when configuring the OpenVPN client on the other physical site (in our case: site 2 in Paris).
Unlike IPsec, OpenVPN uses a subnet for its VPN tunnel.
The network ID used for the VPN tunnel doesn't really matter. The most important thing is that it is not used by any pfSense interface on the source site AND on the destination site so that there are no conflicts.
Indeed, the network ID that you indicate here for the OpenVPN tunnel must be the same on the OpenVPN server (of site 1) and on the OpenVPN client (of site 2).
This network ID will only be used to assign an IP address to OpenVPN peers. So, only 2 IP addresses will be used (1 IP for the pfSense machine hosting the OpenVPN server and 1 IP for the one hosting the OpenVPN client).
At the bottom of the page, click Save.
Your OpenVPN server on site 1 (Brussels) is created.
So that the remote site (in our case: site 2 in Paris) can connect to the OpenVPN server at site 1 in Brussels, you must add a rule in the pfSense firewall.
To do this, on site 1 (Brussels), go to "Firewall -> Rules".
Then, go to the "WAN" tab and click: Add.
Configure the firewall rule like this:
Next, configure:
Enter "OpenVPN traffic from site 2 (Paris)" as the description and click Save.
Click: Apply Changes.
The rule has been created.
For network traffic to pass through the OpenVPN tunnel, you need to go to the "OpenVPN" tab of the firewall and add a new rule.
Configure this rule like this:
In our case, we will allow all network traffic into this OpenVPN tunnel, regardless of the source and destination (which are internal IP addresses of the source or destination network).
So, select "any" for the source and for the destination.
Specify "Allow all protocols in OpenVPN tunnel" as the description.
Then, click Save.
Click: Apply Changes.
Network traffic is allowed in the OpenVPN tunnel.
Firewall 6/25/2025
Firewall 7/30/2025
Firewall 5/30/2025
Firewall 8/27/2025
Pinned content
Contact
® InformatiWeb-Pro.net - InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.
Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.
You must be logged in to post a comment