Skip to content

Stefcho's Tech Blog

Software Development, Cloud, DevOps and PfSense

pfSense 2.0 RC1 configuration of OpenVPN Server for Road Warrior with TLS and User Authentication

Posted on 17/04/2011 - 18/02/2019 by Stefan

VPN is very important service nowadays. The possibility to connect to remote network is very powerful feature used by single user accessing files at home to thousands of business users working remotely with applications and services available previously only on their desktops in the office.  Because of that there are many alternative on the market providing such service. In this post I will focus on the OpenVPN running on the new version of pfSense 2.0 RC1. The goal is to compare the new features with the capabilities of the older 1.2.3 version.

One of the reasons choosing OpenVPN was for the rich feature set, small system requirements the level of control. You can easily setup is up on virtual machine or on SoHo router. The possibility to authenticate users not by insecure usernames and passwords, but by certificates was very compelling.

On 1.2.3 version of pfSense, instead of generating the certificates on the router, I was generating them on a Windows Machine. Following guidance from this sources:

http://www.runpcrun.com/howtoopenvpn

http://openvpn.net/index.php/open-source/documentation/howto.html#pki

After generating all the required certificates, it was just a matter of copy / paste in the configuration.

In the new 2.0 version of pfSense there is a Cert Manager. Using it you can manage your certificate on the box, not just pasting pre-generated certificates.

The other new feature that we will use is User Manager. You have three options for central location of your users: local database, LDAP and RADIUS.For this post we will use local database, as it is the easiest way.

 

As a first  step, let’s install the “OpenVPN Client Export Utility” package, from System > Packages. We will need it later.

Then go to System > Cert Management. On the CA (Certificate Authority) leaf, create new one. Take a note of the Descriptive and Common names you give it, we will need them later. Enter the rest of the details for the CA.

Now under System > User Management, create new user account.Tick in the Certificate section “Click to create a user certificate.”, or after the user is created, enter the newly created user account and generate a certificate for the user. As a Method select “Create an Internal Certificate”, enter the Distinguished name details.

Now is time to configure the OpneVPN server. Go under VPN > OpenVPN, select the Wizard leaf.

For type of Server, select Local User Access

For Certificate Authority Select the name of the one we created earlier, in our case Road Warrior CA

For Server Certificate, select Add New Certificate, type in something memorable for Descriptive name, because we will use it right away.

 

Now edit the configuration of the OpenVPN server. On this page you can enable TLS.

Select the size of DH, Encryption Algorithm.for Tunnel Network choose a subnet that different from your LAN subnet. In the Local Network enter your LAN subnet. Decide on the number of Concurrent Connections, and if you want to use compression.

As this is a very basic configuration, we won’t enter DNS servers, and Default Domain, but you should consider these options, depending on your environment.

Now go to VPN > OpenVPN, select the Client Export leaf. The package that we have installed in the beginning gives us the possibility to automatically export archive with the user configuration files.

Find the user for whom you want to export configuration, and click on the Configuration archive link.

If you haven’t already download the OpenVPN client, download and install OpenVPN Client with GUI from Here

Now open the Configuration Archive and extract the files in this location on the machine from which you are going to establish the VPN connection.

C:\Program Files\OpenVPN\config\

 

You should be able to successfully connect to your VPN from outside.
The management of users and certificate is much easier in pfSense 2.0. You don’t have to keep a Certificate Authority on separate box, and the discomfort with transferring the CRLs is gone. The utility that generates bundles with the required certificates and configuration for each user automate most of the tedious manual work from the previous version.

As a bonus I have recorded the process of configuration, you can check it out here:

 

Posted in TechnicalTagged OpenVPN, pfSense

Post navigation

1 : 1 NAT in pfSense and DD-WRT
OpenVPN with LDAP authentication on pfSense 2.0 RC1

28 Comments

  1. Pingback: OpenVPN with LDAP authentication on pfSense 2.0 RC1
  2. Pingback: OpenVPN with RADIUS authentication on pfSense 2.0 RC1
  3. Pingback: Routing Road Warrior’s clients through a Site-To-Site VPN with pfSense 2.0 RC1 and OpenVPN
  4. Trooper says:
    28/07/2011 at 05:21

    Stefan, great tutorial, thanks!
    But in my scenario I want access other internal subnets in interfaces OPT1 and OPT2. In your tutorial the VPN access only LAN subnet.

    How I can access computers on ALL subnets?
    Thanks.

  5. Pingback: OpenVPN on pfSense 2.0 RC3 with OpenLDAP Authentication on CentOS 5.6
  6. Иван says:
    15/08/2011 at 17:27

    Стефчо, голямо благодаря, спести ми сума ти време! Имаш няколко бири от мен. Поздрави!

  7. Momo says:
    19/08/2011 at 03:34

    Hi Trooper,
    If you need to access other internal subnets, try to add them in advanced section:
    push “route XXX.XXX.XXX.XXX MMM.MMM.MMM.MMM”;push “route YYY.YYY.YYY.YYY MMM.MMM.MMM.MMM”;
    each internal should be followed by its mask (example: push “route 10.10.20.0 255.255.255.0”;

    Good luck.

  8. Ry says:
    21/08/2011 at 06:35

    Awesome thanks been looking for something like this.

  9. Pingback: Using your OpenVPN Road Warrior setup as a Secure Relay
  10. Jean says:
    21/11/2011 at 22:52

    THANKS! Saved me like 2 days to figure it out.

  11. Raiko says:
    19/01/2012 at 21:23

    Hallo

    Nice tutorial (y)
    I can connect OpenVPN, but i can’t get a connection to my lan gateway and servers (ping, ssh).Wan rule is ok and OpenVPN Lan rules also. All should be fine.
    Maybe ISP OpenVPN passthrough configuration problem?
    PPTP connects fine and i can ping my internal hosts.
    should i change config file ?

  12. mohan says:
    13/02/2012 at 07:31

    i have successfully configured pfsene open vpn road warrior client is connected properly but not able to access my lan any body can guide me what i do my settings.
    if my lan network is 172.16.0.0/16 so what is do configuration of pfsense open vpn Tunnel Network and Local Network.
    Thanks
    mohanrao83@gmail.com

  13. benj says:
    01/03/2012 at 09:13

    hi sir! i have followed this instructions and when i get to the last part i don’t see the the export configuration .. what am i doing wrong?

  14. benj says:
    01/03/2012 at 09:19

    and it has problem runnning with lusca cache?

  15. Stefan says:
    01/03/2012 at 10:33

    Check if the “OpenVPN Client Export Utility” package is installed.

  16. benj says:
    01/03/2012 at 14:34

    Sir Stefan it is installed

  17. Pingback: Setting up OpenVPN with pfsense firewall… « JesseVaughn.com
  18. Jake Bloomfield says:
    15/05/2012 at 15:09

    Works fantastically for me!

  19. NIko says:
    01/06/2012 at 08:49

    Здравей, при мен всичко се получа свързвам се към VPN-а но имам само пинг към клиентите в LAN-a но немога да отворя някоя споделена папка или мрежов принтер например. Интересното е че този проблем е само когато се опитам да вляза в някои комп с Windows. Ако някои може да даде някаква идея 🙂

  20. Moh J.H says:
    05/07/2012 at 21:40

    @Stefa,
    Your setup is not working! even though I was able to export the configuration I kept getting TLS connection error! in your case i’m assuming you’re doing this virtually and within the same network that’s why u’re able to connect without any issues!

    for anyone who have such an issue visit this link
    http://forum.pfsense.org/index.php/topic,34714.msg180818.html#msg180818

  21. mohan says:
    07/10/2012 at 13:27

    Still no body post any positive answer. Pls what i do when i properly connected from internet to pfsense road warrior openvpn. But not able to access lan network or other servr like application server..

  22. Daniel says:
    04/05/2015 at 15:52

    hmmmmm. my client export userlist is empty?

  23. xxx says:
    05/12/2015 at 17:53

    It’s actually vᥱry cοmplеx
    іn tҺіѕ fսⅼl
    օf actiѵіty ⅼіfe tο ⅼіstеn neԝѕ օn ТV, tҺeгеfⲟгe ӏ оnlу սѕе tҺе ѡᥱb
    fог tҺat геaѕօn, and tɑκе thе
    ɦοttеst neѡѕ.

  24. หนัง says:
    26/12/2015 at 10:45

    Ηᥱllo tһerе! Ⅾօ уߋu ᥙѕe Twіttеr?
    Ӏ’d ⅼіҝe tߋ
    fⲟlⅼߋա ʏⲟս іf
    tҺat wօulɗ Ье οκ.
    I’m սndοᥙbtеԀⅼʏ ᥱnjоyіng үοսг bⅼoց and ⅼⲟߋκ fοгѡaгԀ to
    neᴡ ρߋѕtѕ.

  25. หนังx says:
    27/12/2015 at 09:25

    I’m not that muсh οf а іntегnet гᥱаⅾег tօ Ье hоneѕt Ьᥙt уօᥙг Ьⅼоցѕ геаⅼⅼү niϲе, ҝеᥱρ
    it սр! Ι’ⅼⅼ gօ ɑҺеɑɗ ɑnd ƅoокmɑrк үοuг sitе
    tо cοmе baϲк ɗοաn tҺe гоаԁ.
    Aⅼl tɦе ƅᥱѕt

  26. Stefan says:
    04/03/2016 at 09:10

    Thanks

  27. Stefan says:
    04/03/2016 at 09:12

    Hello,
    Thanks, and for Twitter – nope, at least I’m not an active user there.
    Cheers

  28. Pingback: Sharing a Port with OpenVPN and a Web Server - Stefcho's Tech Blog

Comments are closed.

Tags

ADDS AES-NI Asterisk ASUS Azure Captive Portal Cell Phone CentOS Certification Creative DD-WRT DNS Hyper-V LDAP Learning Linksys Microsoft Mikrotik RouterBoard RB250G Network OpenLDAP OpenVPN OpenWrt pfCenter pfSemse pfSense pfSense 2.0 RC1 pfSense 2.0 RC3 pfSense 2.2 PKI RADIUS Raspberry Pi Routing Site To Site Technical Uncategorized VLAN VMWare VoIP Vyatta Web Sites Windows Server 8 Windows Server 2008 R2 Windows Server 2012 R2 Wireless Workstation 8

Archives

  • April 2020
  • July 2019
  • May 2019
  • March 2019
  • February 2019
  • October 2018
  • August 2018
  • March 2016
  • April 2015
  • March 2015
  • January 2015
  • February 2012
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • July 2010
Proudly powered by WordPress | Theme: micro, developed by DevriX.