# OpenVPN Remote Access Configuration Example

#   


The OpenVPN wizard on pfSense® software is a convenient way to setup a remote access VPN for mobile clients. The wizard configures all of the necessary prerequisites for an OpenVPN remote access server:

- An authentication source (Local, RADIUS server, or LDAP server)
- A certificate authority (CA)
- A server certificate
- An OpenVPN server instance

At the end of the wizard the firewall will have a fully functioning sever, ready to accept connections from users. This server configuration can then be altered as needed.

This document uses an example setup to aide in explaining the options available in the wizard.

See also

[<span class="doc">Server Configuration Options</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/configure-server.html)

## Before Starting The Wizard

Before starting the wizard, plan the design of the VPN.

### Determine an IP addressing scheme

The OpenVPN server requires a dedicated subnet for communication between the server and the OpenVPN clients. This is the **Tunnel Network** in the server configuration. The server uses the first address in this subnet for itself to act as a gateway and it allocates IP addresses within this subnet to clients.

When selecting internal subnets for a single location, ideally choose subnets which can be CIDR summarized with other internal subnets. This example uses `<span class="pre">10.3.0.0/24</span>` for LAN and `<span class="pre">10.3.201.0/24</span>` for the remote access OpenVPN server. These two networks can be summarized with `<span class="pre">10.3.0.0/16</span>`, which makes routing easier to manage.

See also

[<span class="doc">CIDR Summarization</span>](https://docs.netgate.com/pfsense/en/latest/network/cidr-summarization.html)

### Example Network

Figure [<span class="std std-ref">OpenVPN Example Remote Access Network</span>](https://docs.netgate.com/pfsense/en/latest/recipes/openvpn-ra.html#figure-openvpn-remote-access-network) shows a depiction of this example deployment.

<div class="section" id="bkmrk--1"><div class="section"><div class="align-center figure align-default"><span id="bkmrk--2"></span>![../_images/diagrams-openvpn-server.png](https://docs.netgate.com/pfsense/en/latest/_images/diagrams-openvpn-server.png)</div></div></div><span class="caption-text">OpenVPN Example Remote Access Network</span>

<div class="section" id="bkmrk-openvpn-remote-acces"><div class="section" id="bkmrk-openvpn-remote-acces-1"><div class="align-center figure align-default" id="bkmrk--3"></div><span id="bkmrk--4"></span><div class="wy-table-responsive"><table class="docutils align-default" id="bkmrk-openvpn-remote-acces-2"><caption><span class="caption-text">OpenVPN Remote Access Server Settings</span></caption><colgroup><col></col><col></col></colgroup><thead><tr class="row-odd"><th class="head" colspan="2">Remote Access Server

</th></tr></thead><tbody><tr class="row-even"><td>WAN Address

</td><td>198.51.100.3

</td></tr><tr class="row-odd"><td>LAN Subnet

</td><td>10.3.0.0/24

</td></tr><tr class="row-even"><td>LAN Address

</td><td>10.3.0.1

</td></tr><tr class="row-odd"><td>Tunnel Net

</td><td>10.3.201.0/24

</td></tr></tbody></table>

</div></div></div>## OpenVPN Wizard Walkthrough

To start the OpenVPN Remote Access Server Setup wizard:

<div class="section" id="bkmrk-navigate-to%C2%A0vpn-%3E-op">- Navigate to **VPN &gt; OpenVPN**
- Click the **Wizards** tab

</div>The GUI presents the first step of the wizard automatically

Note

The option for [<span class="std std-ref">OpenVPN Data Channel Offload (DCO)</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/dco.html#openvpn-dco) is not included in this wizard. To use DCO on this server, run the wizard first then after completing the wizard, edit the server instance and enable the DCO option.

### Choose Authentication Type

On the first screen of the wizard, select the authentication backend server type. The choices available for **Type of Server** are *Local User Access*, *LDAP*, and *RADIUS*.

See also

[<span class="doc">Authentication Servers</span>](https://docs.netgate.com/pfsense/en/latest/usermanager/authentication-servers.html)

<div class="section" id="bkmrk-local-user-access-ma"><div class="section"><div class="admonition seealso">  
</div><dl class="field-list"><dt class="field-odd">Local User Access</dt><dd class="field-odd">Manage the users, passwords, and certificates using the [<span class="doc">User Manager</span>](https://docs.netgate.com/pfsense/en/latest/usermanager/index.html) on this firewall.

Sets the server mode to *Remote Access (SSL/TLS + User Auth)* which requires user authentication as well as per-user certificates.

*Local User Access* easily handles per-user certificates, managed completely in the GUI. This is much more secure, but depending on the number of users which will access the service, may be less convenient than using a central authentication system.

</dd><dt class="field-even">LDAP / RADIUS</dt><dd class="field-even">If the network has an existing authentication system already in place, such as Active Directory, pick *LDAP* or *RADIUS* depending on which method that system accepts.

*LDAP* and *RADIUS* both set the server mode to *Remote Access (User Auth)*, which does not require per-user certificates.

Note

The server mode can be adjusted later to require certificates, but administrators must manually create per-user certificates for *LDAP* or *RADIUS* users.

</dd></dl></div></div>Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Next** to continue.

For *Local User Access*, the wizard skips the LDAP and RADIUS configuration steps.

For *LDAP* or *RADIUS* the wizard will present appropriate authentication server configuration options next. This example uses *Local User Access*, but this document discusses the other options for completeness.

<div class="section" id="bkmrk--5"><div class="section" id="bkmrk--6"></div><div class="section">  
</div></div>### Choosing an LDAP Server

If the user manager configuration on this firewall contains one or more LDAP servers, the wizard offers these LDAP servers as options it can use for this VPN.

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Add new LDAP server** to create a different LDAP server entry.

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Next** to continue using the server selected in the **LDAP Servers** list.

If the firewall configuration does not contain any LDAP servers, the wizard skips this step.

See also

[<span class="doc">Authentication Servers</span>](https://docs.netgate.com/pfsense/en/latest/usermanager/authentication-servers.html)

### Adding an LDAP Server

If the user manager configuration on this firewall does not contain an LDAP server, or if the user chose to create a new LDAP server, the wizard presents a screen to define a new server.

The values for the options on this screen depend on the specific LDAP directory configuration and structure. For guidance, consult the LDAP server administrator, software vendor, or documentation.

Note

The details of LDAP servers are covered in [<span class="doc">LDAP Authentication Servers</span>](https://docs.netgate.com/pfsense/en/latest/usermanager/ldap.html).

This document omits some detail since the options are discussed in-depth by that other section.

The wizard offers the following LDAP authentication server parameters:

<div class="section" id="bkmrk-name-descriptive-nam"><div class="section"><dl class="field-list"><dt class="field-odd">Name</dt><dd class="field-odd">Descriptive name for this LDAP server, for reference.

</dd><dt class="field-even">Hostname or IP address</dt><dd class="field-even">The hostname or IP address of the LDAP server.

If the firewall will contact this server using an encrypted method, this value must match the contents of the LDAP server certificate.

</dd><dt class="field-odd">Port</dt><dd class="field-odd">The port on which the LDAP server is listening for requests.

The default port is `<span class="pre">389</span>` for standard TCP connections and `<span class="pre">636</span>` for SSL.

</dd><dt class="field-even">Transport</dt><dd class="field-even">Sets the method the firewall will use when performing LDAP queries to the server.

<dl class="field-list simple"><dt class="field-odd">Standard TCP</dt><dd class="field-odd">Unencrypted connections using plain TCP.

</dd><dt class="field-even">STARTTLS Encrypted</dt><dd class="field-even">Connects to the standard TCP port and then attempts to negotiate TLS encryption.

</dd><dt class="field-odd">SSL/TLS Encrypted</dt><dd class="field-odd">Secure connections using TLS encryption.

</dd></dl>A standard TCP connection is typically sufficient for initial testing, and potentially for local servers or those only accessible over secure connections. If the server is remote or crosses any untrusted network links, an encrypted method is essential. Using an encrypted method is always the best practice, but may not always be viable.

Warning

When the firewall uses an encrypted method to contact the LDAP server, the **Hostname or IP address** above must match a value in the LDAP server certificate.

</dd><dt class="field-even">Peer Certificate Authority</dt><dd class="field-even">To use SSL/TLS or STARTTLS transports, the firewall must trust the CA of the LDAP server. This can be accomplished by any of the following methods:

- Import the CA into the certificate manager and select it from the list in this option.
- Import the CA into the certificate manager with the **Trust Store** option set, which adds the imported CA into the list of CAs which the firewall trusts globally. Then select *global* from this list.
- If the LDAP server certificate is signed by a globally trusted CA, such as Let’s Encrypt, then select *global*.

</dd><dt class="field-odd">Search Scope Level</dt><dd class="field-odd">Selects how deep the firewall will search in the LDAP directory, *One Level* or *Entire Subtree*.

In almost all cases, *Entire Subtree* is the correct choice.

</dd><dt class="field-even">Search Scope Base DN</dt><dd class="field-even">The distinguished name (DN) upon which the firewall bases its search. For example `<span class="pre">DC=example,DC=com</span>`.

</dd><dt class="field-odd">Authentication Containers</dt><dd class="field-odd">These values specify where the directory stores user data. For example, `<span class="pre">CN=Users;DC=example</span>`.

</dd><dt class="field-even">LDAP Bind User DN</dt><dd class="field-even">If the LDAP server requires authenticated binds when performing queries, this field sets the distinguished name the firewall uses for this bind action.

If this is blank the firewall performs an anonymous bind without credentials.

</dd><dt class="field-odd">LDAP Bind Password</dt><dd class="field-odd">The password for authenticated binds. The firewall only uses this value if **LDAP Bind User DN** has a value.

</dd><dt class="field-even">User Naming Attribute</dt><dd class="field-even">Varies depending on the LDAP directory software and structure.

Typically `<span class="pre">cn</span>` for OpenLDAP and Novell eDirectory, and `<span class="pre">samAccountName</span>` for Microsoft Active Directory.

</dd><dt class="field-odd">Group Naming Attribute</dt><dd class="field-odd">Varies depending on the LDAP directory software and structure, but is most typically `<span class="pre">cn</span>`.

</dd><dt class="field-even">Member Naming Attribute</dt><dd class="field-even">Varies depending on the LDAP directory software and structure.

Typically `<span class="pre">member</span>` on OpenLDAP, `<span class="pre">memberOf</span>` on Microsoft Active Directory, and `<span class="pre">uniqueMember</span>` on Novell eDirectory.

</dd></dl><div class="admonition seealso">  
</div></div></div>See also

[<span class="doc">LDAP Authentication Servers</span>](https://docs.netgate.com/pfsense/en/latest/usermanager/ldap.html) explains the remaining options in detail, and when a server may require them.

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Add new server** to continue.

<div class="section" id="bkmrk--7"><div class="section" id="bkmrk--8"></div><div class="section">  
</div></div>### Choosing a RADIUS Server

If the user manager configuration on this firewall contains one or more RADIUS servers, the wizard offers these RADIUS servers as options it can use for this VPN.

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Add new RADIUS server** to create a different RADIUS server entry.

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Next** to continue using the server selected in the **RADIUS Servers** list.

If the firewall configuration does not contain any RADIUS servers, the wizard skips this step.

See also

[<span class="doc">Authentication Servers</span>](https://docs.netgate.com/pfsense/en/latest/usermanager/authentication-servers.html)

### Adding a RADIUS Server

If the user manager configuration on this firewall does not contain a RADIUS server, or if the user chose to create a new RADIUS server, the wizard presents a screen to define a new server.

The values for the options on this screen depend on the specific RADIUS configuration and structure. For guidance, consult the RADIUS server administrator, software vendor, or documentation.

Note

The details of RADIUS servers are covered in [<span class="doc">RADIUS Authentication Servers</span>](https://docs.netgate.com/pfsense/en/latest/usermanager/radius.html).

This document omits some detail since the options are discussed in-depth by that other section.

The wizard offers the following RADIUS authentication server parameters:

<div class="section" id="bkmrk-name-descriptive-nam-1"><div class="section"><dl class="field-list simple"><dt class="field-odd">Name</dt><dd class="field-odd">Descriptive name for this RADIUS server, for reference.

</dd><dt class="field-even">Hostname or IP address</dt><dd class="field-even">The hostname or IP address of the RADIUS server.

</dd><dt class="field-odd">Authentication Port</dt><dd class="field-odd">Port used by the RADIUS server for accepting authentication requests, typically `<span class="pre">1812</span>`.

</dd><dt class="field-even">Shared Secret</dt><dd class="field-even">The password the RADIUS server expects from this firewall when it submits authentication requests (e.g. password on the NAS entry.)

</dd></dl></div></div>Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Add new server** to continue.

<div class="section" id="bkmrk--9"><div class="section" id="bkmrk--10"></div><div class="section">  
</div></div>### Choosing a Certificate Authority

If the certificate manager configuration on this firewall contains one or more certificate authorities, the wizard offers these CA entries as options it can use for this VPN.

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Add new CA** to create a different certificate authority.

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Next** to continue using the certificate authority selected in the **Certificate authority** list.

If the firewall configuration does not contain any CA entries, the wizard skips this step.

See also

[<span class="doc">Certificate Management</span>](https://docs.netgate.com/pfsense/en/latest/certificates/index.html)

### Creating a Certificate Authority

If the certificate manager configuration on this firewall does not contain a CA, or if the user chose to create a new CA, the wizard presents a screen to define a new CA.

See also

For more information on creating and managing CAs, see [<span class="doc">Certificate Authority Management</span>](https://docs.netgate.com/pfsense/en/latest/certificates/ca.html).

This document omits some detail since the options are discussed in-depth by that other section.

The firewall uses this entry as a root CA which can sign server and user certificates. Clients can use this CA to validate the server, and the server can use this CA to validate clients. Because this CA is self-signed, only clients which are supplied with a copy of this CA certificate will trust other certificates signed by this CA.

The wizard offers the following CA parameters:

<div class="section" id="bkmrk-descriptive-name-exa"><div class="section"><dl class="field-list"><dt class="field-odd">Descriptive Name</dt><dd class="field-odd">`<span class="pre">ExampleCoCA</span>`

A name for reference to identify this certificate. This is the same as **Common Name** field for other certificates.

Note

Although this field can technically contain spaces, the best practice is to conform the contents of this field to the format allowed for fully qualified domain names.

Some clients have issues handling entries with spaces properly.

</dd><dt class="field-even">Key Length</dt><dd class="field-even">`<span class="pre">2048</span>`

Size of the CA private key which the wizard will generate.

Larger keys offer increased security but larger keys are generally slower to use.

</dd><dt class="field-odd">Lifetime</dt><dd class="field-odd">`<span class="pre">3650</span>`

The time, in days, for which this CA will remain valid.

For a self-signed CA such as this, the default of `<span class="pre">3650</span>` is acceptable, which is approximately 10 years.

</dd></dl></div></div>The remaining fields are optional but define additional identifying data for the CA “subject”/distinguished name. For small deployments this may not matter much, but for larger organizations with CA entries at multiple sites, this can help ensure each CA is easily identifiable.

<div class="section" id="bkmrk-country-code-us-%28opt"><div class="section"><dl class="field-list"><dt class="field-odd">Country Code</dt><dd class="field-odd">`<span class="pre">US</span>`

(Optional) Two-letter ISO country code (e.g. US, AU, CA).

ExampleCo is located in the United States which has an ISO country code of `<span class="pre">US</span>`.

To locate an appropriate ISO code for other countries, use the [ISO Online Browsing Platform](https://www.iso.org/obp/ui/#search) site.

</dd><dt class="field-even">State or Province</dt><dd class="field-even">`<span class="pre">Texas</span>`

(Optional) Full unabbreviated State or Province name (e.g. Texas, Indiana, California).

ExampleCo is located in `<span class="pre">Texas</span>`.

</dd><dt class="field-odd">City</dt><dd class="field-odd">`<span class="pre">Austin</span>`

(Optional) City or other Locality name (e.g. Austin, Indianapolis, Toronto).

ExampleCo headquarters is in `<span class="pre">Austin</span>`.

</dd><dt class="field-even">Organization</dt><dd class="field-even">`<span class="pre">ExampleCo</span>`

(Optional) Organization name, often the Company or Group name.

Warning

Do not use any special characters in this field, not even punctuation such as a period or comma.

</dd></dl></div></div>Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Add new CA** finish the CA creation process.

<div class="section" id="bkmrk--11"><div class="section" id="bkmrk--12"></div><div class="section">  
</div></div>### Choosing a Server Certificate

If the certificate manager configuration on this firewall contains one or more certificates, the wizard offers these certificate entries as options it can use for this VPN.

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Add new Certificate** to create a different certificate.

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Next** to continue using the certificate selected in the **Certificate** list.

If the firewall configuration does not contain any certificate entries, the wizard skips this step.

See also

[<span class="doc">Certificate Management</span>](https://docs.netgate.com/pfsense/en/latest/certificates/index.html)

### Adding a Server Certificate

If the certificate manager configuration on this firewall does not contain a certificate, or if the user chose to create a new certificate, the wizard presents a screen to define a new server certificate.

See also

For more information on creating and managing certificates, see [<span class="doc">Certificate Management</span>](https://docs.netgate.com/pfsense/en/latest/certificates/certificate.html).

This document omits some detail since the options are discussed in-depth by that other section.

This server certificate verifies the identity of the server to the clients. The CA set in the previous wizard steps will sign this certificate. In most cases, as with this example, the server certificate uses the same information from the previous step and the wizard pre-fills the form automatically.

<div class="section" id="bkmrk-descriptive-name-vpn"><div class="section"><dl class="field-list"><dt class="field-odd">Descriptive Name</dt><dd class="field-odd">`<span class="pre">vpn.example.com</span>`

This is the common name (CN) field of the server certificate and the firewall also uses this name to reference the certificate.

The best practice is to set this to the fully qualified hostname of the firewall.

Note

Although this field can technically contain spaces, the best practice is to conform the contents of this field to the format allowed for fully qualified domain names.

Some clients have issues handling entries with spaces properly.

</dd><dt class="field-even">Key Length</dt><dd class="field-even">`<span class="pre">2048</span>`

Size of the CA private key which the wizard will generate.

Larger keys offer increased security but larger keys are generally slower to use.

</dd><dt class="field-odd">Lifetime</dt><dd class="field-odd">`<span class="pre">398</span>`

The time in days that this certificate will be valid. The best practice is to set this to `<span class="pre">398</span>` days or less.

Note

Some current operating systems and software limit server certificates to a maximum lifetime of `<span class="pre">398</span>` days for security reasons. Clients on these platforms may reject a server certificate with a longer lifetime.

</dd></dl></div></div>The remaining fields are optional but define additional identifying data for the server certificate “subject”/distinguished name. For small deployments this may not matter much, but for larger organizations with many server certificates, this can help ensure each certificate is easily identifiable.

<div class="section" id="bkmrk-country-code-us-%28opt-1"><div class="section"><dl class="field-list"><dt class="field-odd">Country Code</dt><dd class="field-odd">`<span class="pre">US</span>`

(Optional) Two-letter ISO country code (e.g. US, AU, CA).

ExampleCo is located in the United States which has an ISO country code of `<span class="pre">US</span>`.

To locate an appropriate ISO code for other countries, use the [ISO Online Browsing Platform](https://www.iso.org/obp/ui/#search) site.

</dd><dt class="field-even">State or Province</dt><dd class="field-even">`<span class="pre">Texas</span>`

(Optional) Full unabbreviated State or Province name (e.g. Texas, Indiana, California).

ExampleCo is located in `<span class="pre">Texas</span>`.

</dd><dt class="field-odd">City</dt><dd class="field-odd">`<span class="pre">Austin</span>`

(Optional) City or other Locality name (e.g. Austin, Indianapolis, Toronto).

ExampleCo headquarters is in `<span class="pre">Austin</span>`.

</dd><dt class="field-even">Organization</dt><dd class="field-even">`<span class="pre">ExampleCo</span>`

(Optional) Organization name, often the Company or Group name.

Warning

Do not use any special characters in this field, not even punctuation such as a period or comma.

</dd></dl></div></div>Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Create New Certificate** to continue.

<div class="section" id="bkmrk--13"><div class="section" id="bkmrk--14"></div><div class="section">  
</div></div>### Configuring OpenVPN Server Settings

The options on this step of the wizard configure each aspect of how the OpenVPN server itself behave as well as options the server will pass on to clients.

See also

The options presented here are the same as those in [<span class="doc">Server Configuration Options</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/configure-server.html). Refer to that section for details.

Because the options are covered in detail in that section, this document only mentions the settings used by this example.

#### General OpenVPN Server Information

These options control how the OpenVPN instance operates.

<div class="section" id="bkmrk-interface-wan-protoc"><div class="section"><div class="section" id="bkmrk-interface-wan-protoc-1"><dl class="field-list"><dt class="field-odd">Interface</dt><dd class="field-odd">*WAN*

</dd><dt class="field-even">Protocol</dt><dd class="field-even">*UDP on IPv4 Only*

</dd><dt class="field-odd">Local Port</dt><dd class="field-odd">`<span class="pre">1194</span>`

The wizard suggests the first unused port number starting with port `<span class="pre">1194</span>`. If there is an existing OpenVPN server on that port, use a different port number.

</dd><dt class="field-even">Description</dt><dd class="field-even">`<span class="pre">ExampleCo</span> <span class="pre">Mobile</span> <span class="pre">VPN</span> <span class="pre">Clients</span>`

</dd></dl></div><div class="section">  
</div></div></div>#### Cryptographic Settings

These options control how the server encrypts and authenticates traffic in the tunnel.

<div class="section" id="bkmrk-tls-authentication-c"><div class="section"><div class="section" id="bkmrk-tls-authentication-c-1"><dl class="field-list"><dt class="field-odd">TLS Authentication</dt><dd class="field-odd">Check **Enable authentication of TLS packets**

Using TLS authentication is the best practice.

</dd><dt class="field-even">Generate TLS Key</dt><dd class="field-even">Check **Automatically generate a shared TLS authentication key**

</dd><dt class="field-odd">TLS Shared Key</dt><dd class="field-odd">Blank

The wizard disables this field when **Automatically generate a shared TLS authentication key** is checked.

</dd><dt class="field-even">DH Parameters Length</dt><dd class="field-even">*2048*

This value is a good balance of speed and strength.

</dd><dt class="field-odd">Data Encryption Negotiation</dt><dd class="field-odd">*Checked*

This allows the server to automatically negotiate encryption settings with clients.

Note

Disabling this option is deprecated, but still present on this version for compatibility.

</dd><dt class="field-even">Data Encryption Algorithms</dt><dd class="field-even">*AES-256-GCM*, *AES-128-GCM*, and *CHACHA20-POLY1305*

The best practice is to use the default suggested values as noted above.

</dd><dt class="field-odd">Fallback Data Encryption Algorithm</dt><dd class="field-odd">*AES-256-CBC*

This algorithm is used when negotiation fails, for example with a client that is too old to support negotiation.

</dd><dt class="field-even">Auth Digest Algorithm</dt><dd class="field-even">*SHA256 (256-bit)*

</dd></dl></div><div class="section">  
</div></div></div>#### Tunnel Settings

These options control how the server routes traffic from remote clients.

<div class="section" id="bkmrk-tunnel-network-10.3."><div class="section"><div class="section" id="bkmrk-tunnel-network-10.3.-1"><dl class="field-list"><dt class="field-odd">Tunnel Network</dt><dd class="field-odd">`<span class="pre">10.3.201.0/24</span>`

This is the tunnel network from the table at the start of this example ([<span class="std std-ref">OpenVPN Remote Access Server Settings</span>](https://docs.netgate.com/pfsense/en/latest/recipes/openvpn-ra.html#table-openvpn-ra-server-settings)).

</dd><dt class="field-even">Redirect Gateway</dt><dd class="field-even">*Unchecked*

For this example, The VPN will only carry traffic destined for subnets at the main office.

</dd><dt class="field-odd">Local Network</dt><dd class="field-odd">`<span class="pre">10.3.0.0/24</span>`

This is the server-side LAN subnet from the table at the start of this example ([<span class="std std-ref">OpenVPN Remote Access Server Settings</span>](https://docs.netgate.com/pfsense/en/latest/recipes/openvpn-ra.html#table-openvpn-ra-server-settings)).

</dd><dt class="field-even">Concurrent Connections</dt><dd class="field-even">Blank

This example does not limit the number of clients which can connect at the same time.

</dd><dt class="field-odd">Allow Compression</dt><dd class="field-odd">*Refuse any non-stub compression (Most secure)*

The best practice is to disable compression for security reasons.

</dd><dt class="field-even">Compression</dt><dd class="field-even">*Disable Compression \[Omit Preference\]*

The best practice is to disable compression for security reasons.

</dd><dt class="field-odd">Type-of-Service</dt><dd class="field-odd">*Unchecked*

There is no traffic on this example VPN which requires prioritization/QoS.

</dd><dt class="field-even">Inter-Client Communication</dt><dd class="field-even">*Unchecked*

The clients on this VPN have no need to connect to other VPN client hosts.

</dd><dt class="field-odd">Duplicate Connections</dt><dd class="field-odd">*Unchecked*

This example uses unique certificates for every client and does not allow multiple connections per client.

</dd></dl></div><div class="section">  
</div></div></div>#### Client Settings

These options control specific settings the server pushes to clients when they establish a connection.

<div class="section" id="bkmrk-dynamic-ip-checked-t"><div class="section"><div class="section"><dl class="field-list"><dt class="field-odd">Dynamic IP</dt><dd class="field-odd">*Checked*

The clients connect from all over the country and unknown mobile networks and their IP addresses are likely to change without notice.

</dd><dt class="field-even">Topology</dt><dd class="field-even">*Subnet*

The method the server uses to assign IP addresses to clients.

</dd><dt class="field-odd">DNS Default Domain</dt><dd class="field-odd">`<span class="pre">example.com</span>`

The domain name used by ExampleCo.

</dd><dt class="field-even">DNS Servers</dt><dd class="field-even">`<span class="pre">10.3.0.5</span>`

A list of internal DNS servers. ExampleCo has a Windows Active Directory Domain Controller which is configured to act as a DNS server at `<span class="pre">10.3.0.5</span>`.

</dd><dt class="field-odd">NTP Servers</dt><dd class="field-odd">`<span class="pre">10.3.0.6</span>`

A dedicated local NTP server exists at `<span class="pre">10.3.0.6</span>`.

</dd><dt class="field-even">Advanced</dt><dd class="field-even">Blank

At this time no additional tweaks are necessary.

</dd></dl></div></div></div>Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Next** to continue.

<div class="section" id="bkmrk--15"><div class="section" id="bkmrk--16"><div class="section" id="bkmrk--17"></div></div><div class="section">  
</div></div>### Firewall Rule Configuration

By default the firewall blocks all traffic from connecting to VPNs or passing over VPN tunnels. This step of the wizard adds firewall rules automatically to allow traffic to connect to the VPN and also so connected clients can pass traffic over the VPN.

<div class="section" id="bkmrk-traffic-from-clients"><div class="section"><dl class="field-list"><dt class="field-odd">Traffic from clients to server</dt><dd class="field-odd">*Checked*

When checked, the wizard adds a firewall rule on the chosen interface outside of the tunnel where the server is listening (e.g. *WAN*) which allows VPN clients to connect. The rule created by this option allows all clients from any source IP address to connect by default.

Since clients in this example are connecting from all over the country, the rule created by the wizard for this option is ideal.

Tip

To allow connections from a limited set of IP addresses or subnets, either make a custom rule or check this box and alter the rule it creates.

</dd><dt class="field-even">Traffic from clients through VPN tunnel</dt><dd class="field-even">*Checked*

This setting allows all traffic to cross inside the OpenVPN tunnel. This is desirable for this example.

</dd></dl></div></div>Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Next** to continue.

<div class="section" id="bkmrk--18"><div class="section" id="bkmrk--19"></div><div class="section">  
</div></div>### Finishing the Wizard

Click ![fa-angle-double-right](https://docs.netgate.com/pfsense/en/latest/_images/fa-angle-double-right.png) **Finish** to complete the wizard.

At this point, the firewall now contains a full OpenVPN remote access server configuration which is ready for client connections.

From here, the next steps are to add users and configure client devices.

If this setup requires adjustments to the automatically generated firewall rules, make them now.

<div class="section" id="bkmrk--20"><div class="section" id="bkmrk--21"></div></div>## Verifying the Setup

Look at firewall rules (**WAN** and **OpenVPN** tabs)

<div class="section" id="bkmrk-wan%C2%A0tab-rule-should-">- **WAN** tab rule should pass from any to the *OpenVPN* port on the *WAN address*
    
    ![../_images/openvpn_ra-wanrule.png](https://docs.netgate.com/pfsense/en/latest/_images/openvpn_ra-wanrule.png)
- **OpenVPN** tab rule should allow all traffic from any/to any
    
    ![../_images/openvpn_ra-ovpnrule.png](https://docs.netgate.com/pfsense/en/latest/_images/openvpn_ra-ovpnrule.png)

</div>## Adjustments

Numerous settings are not present in the wizard but might be a better fit for certain deployments than the defaults chosen by the wizard.

### Server Mode

The OpenVPN **Server Mode** allows selecting a choice between requiring Certificates, User Authentication, or both. The wizard defaults to *Remote Access (SSL/TLS + User Auth)* when using local users and *Remote Access (User Auth)* for RADIUS and LDAP. The possible values for this choice and their advantages are:

<div class="section" id="bkmrk-remote-access-%28ssl%2Ft"><div class="section" id="bkmrk-remote-access-%28ssl%2Ft-1"><dl class="field-list simple"><dt class="field-odd">Remote Access (SSL/TLS + User Auth)</dt><dd class="field-odd">- Requires both certificates **and** username/password
- Each user has a unique client configuration which includes their personal certificate and key
- Most secure as there are multiple factors of authentication (TLS Key and Certificate that the user has, and the username/password they know)

</dd><dt class="field-even">Remote Access (SSL/TLS)</dt><dd class="field-even">- Certificates only, no authentication
- Each user has a unique client configuration which includes their personal certificate and key
- Useful if clients should not be prompted to enter a username and password
- Less secure as it relies only on something the user has (TLS key and certificate)

</dd><dt class="field-odd">Remote Access (User Auth)</dt><dd class="field-odd">- Authentication only, no certificates
- Useful if the clients cannot have individual certificates
- Commonly used for external authentication (RADIUS, LDAP)
- All clients can use the same exported client configuration and/or software package
- Less secure as it relies on a shared TLS key plus only something the user knows (Username/password)

</dd></dl></div><div class="section">  
</div></div>### OpenVPN Data Channel Offload (DCO)

[<span class="std std-ref">OpenVPN Data Channel Offload (DCO)</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/dco.html#openvpn-dco), a pfSense<sup>®</sup> Plus exclusive feature, can potentially increase performance of OpenVPN well beyond the capabilities of traditional OpenVPN connections.

> Note
> 
> OpenVPN DCO is generally stable but still under development.
> 
> OpenVPN DCO has been successful in many scenarios in lab and production environments, but there is still a small potential for instability or undesirable behavior.
> 
> Some OpenVPN features and use cases are not compatible with DCO. See [<span class="std std-ref">Limitations</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/dco.html#openvpn-dco-limitations) for a list of known DCO limitations.
> 
> If a problem occurs with DCO, start a thread on the [Netgate Forum](https://forum.netgate.com/) to discuss and diagnose the issue.

### Certificate Revocation

Compromised certificates can be revoked by a Certificate Revocation List (CRL). CRL entries are managed at **System &gt; Cert Manager** on the **Certificate Revocation** tab. Create a new CRL, add the certificate to it, and then select that CRL on the OpenVPN server settings.

<p class="callout info">See also: [<span class="doc">Certificate Revocation List Management</span>](https://docs.netgate.com/pfsense/en/latest/certificates/crl.html)</p>

## Adding a User with a Certificate

If the server mode includes local user authentication, a user must be exist in the user manager for each client which will connect to the VPN.

See also

This is a simplified version of the process. For more detail, see:

<div class="section" id="bkmrk-adding-openvpn-remot"><div class="admonition seealso">- [<span class="doc">Adding OpenVPN Remote Access Users</span>](https://docs.netgate.com/pfsense/en/latest/recipes/openvpn-ra-users.html)
- [<span class="doc">Manage Local Users</span>](https://docs.netgate.com/pfsense/en/latest/usermanager/users.html)
- [<span class="std std-ref">User Certificates</span>](https://docs.netgate.com/pfsense/en/latest/certificates/certificate.html#certificates-certs-user)

</div>- Navigate to **System &gt; User Manager**
- Click ![fa-plus](https://docs.netgate.com/pfsense/en/latest/_images/fa-plus.png) To add a user
- Fill in the settings as follows:
    
    <dl class="field-list simple"><dt class="field-odd">Username</dt><dd class="field-odd">The username for this client.
    
    </dd><dt class="field-even">Password/Confirm password</dt><dd class="field-even">The password for this client.
    
    </dd><dt class="field-odd">Click to create a user certificate</dt><dd class="field-odd">*Checked*
    
    </dd><dt class="field-even">Descriptive Name</dt><dd class="field-even">Same value as the **Username**
    
    </dd><dt class="field-odd">Certificate Authority</dt><dd class="field-odd">The CA used by the OpenVPN server.
    
    </dd></dl>![../_images/openvpn_ra-usercert.png](https://docs.netgate.com/pfsense/en/latest/_images/openvpn_ra-usercert.png)
- Click **Save**

</div>## OpenVPN Client Export Package

The OpenVPN Client Export Package can export client configurations formatted for a wide variety of platforms. It can also export a pre-packaged Windows installer executable which includes the configuration bundled inside for a painless client installation.

See also