In our "pfSense 2.6 - Create a VPN server (remote access) via OpenVPN (L3 mode)" tutorial, we explained to you how to allow your users to access the company network securely via an OpenVPN server created under pfSense.
However, it was an L3 tunnel (which is what is used most of the time). OpenVPN therefore used another subnet for its tunnel.
If you want your users connected via the VPN to be on the same subnet as the machines present in the company, you must configure OpenVPN to use "tap" (L2 connectivity) instead of "tun" (L3 connectivity) .
Note that in the case of "tap" (L2 connectivity), there is no longer a subnet used for the VPN tunnel.
IP addresses assigned to users connected via the VPN will therefore receive an IP address from the DHCP server of your company's LAN network (usually).
Important : to follow this tutorial, you must first follow our previous tutorial (cited above) up to and including step "7.1 Install the OpenVPN Client Export package".
Note that the subnet to use in the "Tunnel Network" box when following our previous tutorial is required by the OpenVPN wizard. Although you will then remove it in the tutorial below. So temporarily indicate a fictitious subnet that does not conflict with the subnets used by pfSense in your case.
To get started, go to: VPN -> OpenVPN.
Click on the small pencil to the right of your OpenVPN server.
In the "Configuration Mode" section, change the value of the "Device mode" parameter to "tap - Layer 2 Tap Mode".
In the "Tunnel Settings" section, configure these settings:
Source : Tunnel Settings | pfSense Documentation.
At the bottom of the page, click Save.
To create the bridge requested by pfSense for this L2 mode, you must first assign the virtual interface of your OpenVPN server as a logical interface (default: OPT1).
To do this, go to: Interfaces -> Assignments.
In the "Interface Assignments" tab, you will see that a new network port is available (Available network ports).
Select the port "ovpns1 (OpenVPN server for remote access)" displayed and click: Add.
In our case, a new logical interface "OPT1" appears for our virtual interface "ovpns1...".
Now that your OpenVPN server's virtual interface has been assigned as logical interface "OPT1", you must activate this new logical interface in order to use it.
To do this, go to "Interfaces -> OPT1" or click on its name (in the "Interface Assignments" tab where you are currently).
Check the "Enable interface" box.
At the bottom of the page, click on: Save.
At the top of the page, click: Apply Changes.
Your OPT1 interface corresponding to your OpenVPN server is enabled.
So that users connected to your OpenVPN server can communicate transparently with machines physically connected to the LAN network, you must create a bridge between the logical interface "OPT1" (which corresponds to the virtual interface of the OpenVPN server) and the logical interface "LAN".
To do this, go to: Interfaces -> Assignments.
In the "Bridges" tab, click: Add.
Select the "LAN" and "OPT1" interfaces (holding down CTRL when clicking on their names to select several).
Provide a description for information purposes if you wish, then click: Save.
The network bridge appears, by default, under the name "BRIDGE0".
Source : Bridging OpenVPN Connections to Local Networks | pfSense Documentation.
Firewall 7/30/2025
Firewall 7/25/2025
Firewall 6/18/2025
Firewall 6/20/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