[vc_row css=”.vc_custom_1567441651052{margin-top: 30px !important;}”]

Objective of this guide:

[vc_separator css=”.vc_custom_1567441743182{margin-top: -20px !important;}”]In this guide we see how to configure a RW (Road Warrior) VPN server via OpenVPN on pfSense®. The aim is to create a basic configuration to allow a correct functioning of our VPN.JTVCYWRyb3RhdGUlMjBiYW5uZXIlM0QlMjIzJTIyJTVE

Used Hardware:

[vc_separator css=”.vc_custom_1567441743182{margin-top: -20px !important;}”]This guide can be applied to all the hardware certified by us of the firewall line that you can find here: https://www.miniserver.it/firewall

Software environment:

[vc_separator css=”.vc_custom_1567441743182{margin-top: -20px !important;}”]pfSense® 2.4.x

Let’s configure OpenVPN:

[vc_separator css=”.vc_custom_1567441743182{margin-top: -20px !important;}”]First of all, from our top menu, go to VPN/OpenVPN/Servers.

We also proceed from the convenient Wizard that will allow us to easily create our CA (Certification Authority), the Server Certificate and the configuration of the RW VPN Server; these components can also be created individually.

Let’s start by selecting Local User Access[vc_single_image image=”19767″ img_size=”full” onclick=”link_image”]At this point it is time to create our CA, as a necessary parameter we must enter a “Descriptive name” that will allow us to identify it, while all the other parameters can be left by default.[vc_single_image image=”19769″ img_size=”full” onclick=”link_image”]Let’s move on to creating the Server Certificate to be associated with our VPN server, as perl the CA will require a “Descriptive name” and leave the other default parameters.[vc_single_image image=”19771″ img_size=”full” onclick=”link_image”]Now the actual VPN server configuration.

In the “Interface” item we select the interface on which we want our service to listen, if we have more than one WAN interface we choose the one we want to dedicate to the service, if we want later we can select multiple interfaces for greater redundancy.

It is appropriate to consider that the port that we will choose for the VPN must be open on the listening interface, therefore if we are behind a Router of some ISP it will be necessary to be able to open the door to the interface of our Firewall, if instead we have the possibility of having a Public IP address directly configured on the Firewall interface will be sufficient to create an associated rule (as we will see later).

We choose the protocol to be used and the port dedicated to the service (default for OpenVPN is UDP 1194).

In the “Description” item we choose the name with which we want to identify the server.

In the “Cryptographic Settings” section we can leave everything by default.[vc_single_image image=”19773″ img_size=”full” onclick=”link_image”]In the “Tunnel Settings” section it will be necessary to indicate a “Tunnel Network” that we could choose at random, making sure that it is not the same as other known networks or public networks, in fact it is the virtual network that will use the VPN.

In “Local Network” instead we will indicate the LAN network to which you want to give remote access, if there are multiple LAN networks to which we want to give access, you can enter them by separating them with a comma.[vc_single_image image=”19775″ img_size=”full” onclick=”link_image”][vc_single_image image=”19777″ img_size=”full” onclick=”link_image”]At this point the wizard asks us if we want to insert the Firewall Rule associated with the WAN interface and the one with the OpenVPN virtual interface, by ticking both will automatically create.[vc_single_image image=”19779″ img_size=”full” onclick=”link_image”]Let’s now see in detail the completed server configuration, as anticipated it is a basic configuration but we can always restrict security, for example by setting the maximum number of client accesses in “Concurrent connections”, or increase the level of encryption. These adjustments can affect the performance of the equipment and the connection.[vc_single_image image=”19781″ img_size=”full” onclick=”link_image”][vc_single_image image=”19783″ img_size=”full” onclick=”link_image”][vc_single_image image=”19785″ img_size=”full” onclick=”link_image”][vc_single_image image=”19787″ img_size=”full” onclick=”link_image”]Below is the detail of the Firewall Rules created:

  • For the WAN interface
[vc_single_image image=”19789″ img_size=”full” onclick=”link_image”][vc_single_image image=”19791″ img_size=”full” onclick=”link_image”]
  • For the OpenVPN interface
[vc_single_image image=”19793″ img_size=”full” onclick=”link_image”][vc_single_image image=”19795″ img_size=”full” onclick=”link_image”]The CA.[vc_single_image image=”19797″ img_size=”full” onclick=”link_image”]Now let’s see how to create the users we want to connect to in VPN.

Position ourselves under System / User Manager / Users and create the username and password and User Certificate associated with the user by checking the “Certificate” “Click to create a user certificate”, you must enter a “descriptive name” to the created certificate. In this way we will have created both the user and the associated certificate in a single operation[vc_single_image image=”19964″ img_size=”full” onclick=”link_image”][vc_single_image image=”19966″ img_size=”full” onclick=”link_image”]In the “Certificate Manager” section we will see the certificate associated with the VPN server and all those associated with the users created.[vc_single_image image=”19968″ img_size=”full” onclick=”link_image”]At this point we can export the configuration files and certificates for individual users who will use the VPN clients to connect.

First of all it is necessary to install the package “openvpn-client-export”, to do this we can search for it by going to System/Package Manager/Available Packages.[vc_single_image image=”19970″ img_size=”full” onclick=”link_image”]Once installed we will see the option added under OpenVPN / Client Export.

Under “Remote Access Server” we select our created VPN server.

In the Client Connection Behavior section we will enter the parameters with which the .ovpn configuration file will be generated for the user, in particular we recommend configuring as follows:

  • “Host Name Resolution” on “Other”
  • “Host Name” we will have to enter the Public IP address of our network
  • “Verify Server CN” we can leave it by default on “Automatic” or if we have problems set it on “Do not verifythe CN server”.
[vc_single_image image=”19972″ img_size=”full” onclick=”link_image”]Once the parameters are configured, we can export our users configuration file to be installed on the clients.
To do this we have various choices, the most recommended below:

  • “Most Clients”: genera un file .ovpn contenete sia la configurazione che i certificati e le chiavi facilmente importabile, compatibile con i client: OpenVPN per Windows, Tunnelblick per OS X
  • “OpenVPN Connect”: generates an .ovpn file compatible with OpenVPN Connect Apps for Android and iOS
  • “Archive”: compatible with Windows, generates an archive containing, in 3 separate files, the configuration (.ovpn), certificates (.p12) and the key (.key)
  • Under the “Current Windows Installer” section we can generate self-installing and preconfigured files for Windows clients
[vc_single_image image=”19974″ img_size=”full” onclick=”link_image”]