# OpenVPN Site-to-Site Configuration Example with SSL/TLS

# OpenVPN Site-to-Site Configuration Example with SSL/TLS

A site-to-site connection using **SSL/TLS** in client/server mode is convenient for managing a large number of remote sites connecting back to a central site in a hub-and-spoke fashion.

## Example Configuration Overview

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

<div class="section" id="bkmrk--2"><div class="align-center figure align-default" id="bkmrk--3"></div></div>When configuring a site-to-site OpenVPN connection using SSL/TLS one firewall will be the server and the others will be clients.

Tip

Usually the main location will be the server and the remote offices will act as clients, though if one location has a static IP address and more bandwidth than the main office that may be a more desirable location for the server.

This style of VPN requires a dedicated subnet for the OpenVPN interconnection between networks in addition to the subnets on both ends. Figure [<span class="std std-ref">OpenVPN Example Site-to-Site SSL/TLS Network</span>](https://docs.netgate.com/pfsense/en/latest/recipes/openvpn-s2s-tls.html#figure-openvpn-site-to-site-ssl-tls) shows a depiction of this layout, using `<span class="pre">10.3.101.0/24</span>` as the IPv4 VPN Tunnel Network. This can be any subnet so long as it does not overlap another subnet currently in use on the network.

OpenVPN allocates IP addresses the same way it does for remote access clients. When using a **Topology** style of *subnet*, each client obtains one IP address in a common subnet. When using a **Topology** style of *net30*, each connecting client gets a /30 subnet to interconnect itself with the server.

See also

The *subnet* topology style uses address space more efficiently and has less quirks with its behavior in general, but certain very old clients may not be compatible. See [<span class="std std-ref">Topology</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/configure-server-client.html#openvpn-configuration-topology) for more details.

The following sections describe how to configure the server and client sides of the connection.

<div class="section" id="bkmrk--4"></div><div class="section" id="bkmrk--5"><span id="bkmrk--6"></span></div>## Example Configuration Settings

<div class="section" id="bkmrk-openvpn-endpoint-set"><span id="bkmrk--7"></span><div class="wy-table-responsive"><table class="docutils align-default" id="bkmrk-openvpn-endpoint-set-1"><caption><span class="caption-text">OpenVPN Endpoint Settings - Site A - Server</span></caption><colgroup><col></col><col></col></colgroup><thead><tr class="row-odd"><th class="head" colspan="2">Site A - Server

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

</td><td>Austin Office

</td></tr><tr class="row-odd"><td>WAN Address

</td><td>198.51.100.3

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

</td><td>10.3.0.0/24

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

</td><td>10.3.0.1

</td></tr><tr class="row-even"><td>CA Name

</td><td>S2SCA

</td></tr><tr class="row-odd"><td>Cert CN

</td><td>serverA

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

</td><td>10.3.101.0/24

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

</div><span id="bkmrk--8"></span><div class="wy-table-responsive"><table class="docutils align-default" id="bkmrk-openvpn-endpoint-set-2"><caption><span class="caption-text">OpenVPN Endpoint Settings - Site B - Client</span></caption><colgroup><col></col><col></col></colgroup><thead><tr class="row-odd"><th class="head" colspan="2">Site B - Client

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

</td><td>London Office

</td></tr><tr class="row-odd"><td>Cert CN

</td><td>clientB

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

</td><td>203.0.113.5

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

</td><td>10.5.0.0/24

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

</td><td>10.5.0.1

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

</div><span id="bkmrk--9"></span><div class="wy-table-responsive"><table class="docutils align-default" id="bkmrk-openvpn-endpoint-set-3"><caption><span class="caption-text">OpenVPN Endpoint Settings - Site C - Client</span></caption><colgroup><col></col><col></col></colgroup><thead><tr class="row-odd"><th class="head" colspan="2">Site C - Client

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

</td><td>Colorado Office

</td></tr><tr class="row-odd"><td>Cert CN

</td><td>clientC

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

</td><td>198.51.100.7

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

</td><td>10.7.0.0/24

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

</td><td>10.7.0.1

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

</div></div>## Configuring SSL/TLS Server Side

The server **requires** two items to reach the networks behind each client:

<div class="section" id="bkmrk-a%C2%A0route%C2%A0to-tell-the-">- A `<span class="pre">route</span>` to tell the operating system that OpenVPN knows about a remote network
- An internal route (`<span class="pre">iroute</span>`) in an OpenVPN Client-Specific Override to tell OpenVPN how to route that subnet to a specific client certificate

</div>More detail on this will follow in the example.

See also

<div class="section" id="bkmrk-client-specific-over"><div class="admonition seealso">- [<span class="doc">Client Specific Overrides</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/configure-overrides.html)
- [<span class="std std-ref">Troubleshooting OpenVPN Internal Routing (iroute)</span>](https://docs.netgate.com/pfsense/en/latest/troubleshooting/openvpn-iroute.html#troubleshooting-openvpn-iroute)
- [<span class="doc">Tunnel Settings</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/configure-server-tunnel.html)

</div><div class="section">  
</div></div>### Create Certificate Structure

The first step is to create a certificate structure for this VPN.

This example uses the names listed in [<span class="std std-ref">Example Configuration Settings</span>](https://docs.netgate.com/pfsense/en/latest/recipes/openvpn-s2s-tls.html#recipe-openvpn-s2s-tls-examplesettings) – The CA is named `<span class="pre">S2SCA</span>`, the Server CN is named `<span class="pre">serverA</span>`, and the clients are `<span class="pre">clientB</span>` and `<span class="pre">clientC</span>`.

See also

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

#### Create a Certificate Authority

Create a CA unique to this VPN:

<div class="section" id="bkmrk-navigate-to%C2%A0system-%3E"><div class="section"><div class="section" id="bkmrk-navigate-to%C2%A0system-%3E-1">- Navigate to **System &gt; Cert Manager**, **CAs** tab
- Click **Add** to create a new a CA
- Enter the settings as follows:
    
    <dl class="field-list simple"><dt class="field-odd">Descriptive Name</dt><dd class="field-odd">`<span class="pre">S2SCA</span>`
    
    </dd><dt class="field-even">Method</dt><dd class="field-even">*Create an internal Certificate Authority*
    
    </dd><dt class="field-odd">Randomize Serial</dt><dd class="field-odd">*Checked*
    
    </dd><dt class="field-even">Key Type</dt><dd class="field-even">*RSA*, *2048* (or higher)
    
    </dd><dt class="field-odd">Digest Algorithm</dt><dd class="field-odd">*sha256* (or higher)
    
    </dd><dt class="field-even">Lifetime (days)</dt><dd class="field-even">`<span class="pre">3650</span>`
    
    </dd><dt class="field-odd">Common Name</dt><dd class="field-odd">`<span class="pre">S2SCA</span>`
    
    </dd><dt class="field-even">Subject Component Fields</dt><dd class="field-even">The remaining fields are optional, but can be set to reflect the location of the CA.
    
    </dd></dl>
- Click **Save**

</div><div class="section">  
</div></div></div>#### Create a Server Certificate

Create a server certificate signed by the VPN CA:

<div class="section" id="bkmrk-navigate-to%C2%A0system-%3E-2"><div class="section"><div class="section" id="bkmrk-navigate-to%C2%A0system-%3E-3">- Navigate to **System &gt; Cert Manager**, **Certificates** tab
- Click **Add** to create a new certificate
- Enter the settings as follows:
    
    <dl class="field-list"><dt class="field-odd">Method</dt><dd class="field-odd">*Create an internal Certificate*
    
    </dd><dt class="field-even">Descriptive Name</dt><dd class="field-even">`<span class="pre">serverA</span>`
    
    </dd><dt class="field-odd">Certificate Authority</dt><dd class="field-odd">*S2SCA*
    
    </dd><dt class="field-even">Key Type</dt><dd class="field-even">*RSA*, *2048* (or higher)
    
    </dd><dt class="field-odd">Digest Algorithm</dt><dd class="field-odd">*sha256* (or higher)
    
    </dd><dt class="field-even">Lifetime (days)</dt><dd class="field-even">`<span class="pre">398</span>`
    
    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><dt class="field-odd">Common Name</dt><dd class="field-odd">`<span class="pre">serverA</span>`
    
    </dd><dt class="field-even">Subject Component Fields</dt><dd class="field-even">The fields contain data copied from the CA and are optional, but can be set to reflect the location of the server.
    
    </dd><dt class="field-odd">Certificate Type</dt><dd class="field-odd">*Server Certificate*
    
    Warning
    
    This setting is critical, do not forget to set this value.
    
    </dd><dt class="field-even">Alternative Names</dt><dd class="field-even">Optional extra entries, if needed, which specify alternate ways to identify the server. This can be left blank if the certificate will only be used by OpenVPN. Otherwise, add fields with additional information such as alternate hostnames, static IP addresses, and so on which are relevant to this server.
    
    </dd></dl>
- Click **Save**

</div><div class="section">  
</div></div></div>#### Create User Certificates

Create user certificates for each remote site signed by the VPN CA.

<div class="section" id="bkmrk-navigate-to%C2%A0system-%3E-4"><div class="section"><div class="section">- Navigate to **System &gt; Cert Manager**, **Certificates** tab
- Click **Add** to create a new certificate
- Enter the settings as follows:
    
    <dl class="field-list"><dt class="field-odd">Method</dt><dd class="field-odd">*Create an internal Certificate*
    
    </dd><dt class="field-even">Descriptive Name</dt><dd class="field-even">`<span class="pre">clientB</span>`
    
    </dd><dt class="field-odd">Certificate Authority</dt><dd class="field-odd">*S2SCA*
    
    </dd><dt class="field-even">Key Type</dt><dd class="field-even">*RSA*, *2048* (or higher)
    
    </dd><dt class="field-odd">Digest Algorithm</dt><dd class="field-odd">*sha256* (or higher)
    
    </dd><dt class="field-even">Lifetime (days)</dt><dd class="field-even">`<span class="pre">3650</span>`
    
    </dd><dt class="field-odd">Common Name</dt><dd class="field-odd">`<span class="pre">clientB</span>`
    
    </dd><dt class="field-even">Subject Component Fields</dt><dd class="field-even">The fields contain data copied from the CA and are optional, but can be set to reflect the location of the client.
    
    </dd><dt class="field-odd">Certificate Type</dt><dd class="field-odd">*User Certificate*
    
    Warning
    
    This setting is critical, do not forget to set this value.
    
    </dd><dt class="field-even">Alternative Names</dt><dd class="field-even">Optional extra entries which specify alternate ways to identify the client. These can be left blank if the certificate will only be used by OpenVPN. Otherwise, add fields with additional information such as alternate hostnames, static IP addresses, and so on which are relevant to this client.
    
    </dd></dl>
- Click **Save**

</div></div></div>Repeat this process for every client (e.g. `<span class="pre">clientC</span>` and any future clients).

<div class="section" id="bkmrk--10"><div class="section" id="bkmrk--11"><div class="section" id="bkmrk--12"></div></div><div class="section">  
</div></div>### Export Certificates

The next task is to export the certificates and keys which the client requires when connecting to the OpenVPN server.

<div class="section" id="bkmrk-navigate-to%C2%A0system-%3E-5"><div class="section">- Navigate to **System &gt; Cert Manager**, **CAs** tab
- Click ![fa-certificate](https://docs.netgate.com/pfsense/en/latest/_images/fa-certificate.png) on the row for the CA to export its certificate
- Navigate to **System &gt; Cert Manager**, **Certificates** tab
- Click ![fa-certificate](https://docs.netgate.com/pfsense/en/latest/_images/fa-certificate.png) on the row for each client certificate to export the certificates
- Click ![fa-key](https://docs.netgate.com/pfsense/en/latest/_images/fa-key.png) on the row for each client certificate to export the private key for the client certificates.

<div class="admonition warning">  
</div></div></div>Warning

**Do not** export the CA key, server certificate, or server key. The client does not need these and copying them unnecessarily significantly weakens the security of the VPN.

### Configure the OpenVPN Server Instance

<div class="section" id="bkmrk-navigate-to%C2%A0vpn-%3E-op"><div class="section" id="bkmrk-navigate-to%C2%A0vpn-%3E-op-1">- Navigate to **VPN &gt; OpenVPN**, **Servers** tab
- Click ![fa-plus](https://docs.netgate.com/pfsense/en/latest/_images/fa-plus.png) **Add** to create a new server
- Fill in the fields as described below, with everything else left at defaults.
    
    Use values appropriate for this network, or the defaults if unsure.
    
    See also
    
    See [<span class="doc">Server Configuration Options</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/configure-server.html) for details on each of these options.
    
    <dl class="field-list"><dt class="field-odd">Description</dt><dd class="field-odd">Enter text to describe the connection, e.g. `<span class="pre">Site-to-Site</span> <span class="pre">VPN</span>`.
    
    </dd><dt class="field-even">Server Mode</dt><dd class="field-even">*Peer to Peer (SSL/TLS)*
    
    </dd><dt class="field-odd">DCO (Plus Only)</dt><dd class="field-odd">Check this box to activate the [<span class="std std-ref">OpenVPN Data Channel Offload (DCO)</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/dco.html#openvpn-dco) feature for the server if desired.
    
    See also
    
    See [<span class="std std-ref">OpenVPN Data Channel Offload (DCO)</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/dco.html#openvpn-dco) for additional information.
    
    </dd><dt class="field-even">Device Mode</dt><dd class="field-even">*tun*
    
    </dd><dt class="field-odd">Protocol</dt><dd class="field-odd">*UDP on IPv4 only*
    
    </dd><dt class="field-even">Interface</dt><dd class="field-even">*WAN*
    
    </dd><dt class="field-odd">Local Port</dt><dd class="field-odd">`<span class="pre">1194</span>`
    
    </dd><dt class="field-even">TLS Configuration</dt><dd class="field-even">Check the **Use a TLS Key** box to enable TLS authentication which provides protection for the tunnel control channel.
    
    Leave **Automatically generate a TLS Key** checked so the firewall will generate a new key automatically the first time this entry is saved.
    
    </dd><dt class="field-odd">Peer Certificate Authority</dt><dd class="field-odd">Select the CA created at the beginning of this process (`<span class="pre">S2SCA</span>`)
    
    </dd><dt class="field-even">Peer Certificate Revocation List</dt><dd class="field-even">Select a CRL for the CA, if one exists.
    
    </dd><dt class="field-odd">Server Certificate</dt><dd class="field-odd">Select the server certificate created at the beginning of this process (`<span class="pre">serverA</span>`)
    
    </dd><dt class="field-even">IPv4 Tunnel Network</dt><dd class="field-even">Enter the chosen tunnel network, `<span class="pre">10.3.101.0/24</span>`
    
    </dd><dt class="field-odd">IPv4 Local Network(s)</dt><dd class="field-odd">Enter the LAN subnets for all sites including the server: `<span class="pre">10.3.0.0/24,</span> <span class="pre">10.5.0.0/24,</span> <span class="pre">10.7.0.0/24</span>`
    
    Note
    
    If there are more networks on the server side that clients need to reach, such as networks reachable via static routes, other VPNs, and so on, add them as additional entries in the **IPv4 Local Network** box.
    
    </dd><dt class="field-even">IPv4 Remote Network(s)</dt><dd class="field-even">Enter **only** the client LAN subnets: `<span class="pre">10.5.0.0/24,</span> <span class="pre">10.7.0.0/24</span>`
    
    </dd><dt class="field-odd">Inactive</dt><dd class="field-odd">`<span class="pre">0</span>` to disable disconnecting idle clients, so that site-to-site connections can stay up indefinitely.
    
    </dd></dl>
- Click Save.
- Click ![fa-pencil](https://docs.netgate.com/pfsense/en/latest/_images/fa-pencil.png) to edit the new server instance
- Find the **TLS Authentication** box
- Select all of the text inside
- Copy the text to the clipboard
- Save this to a file or paste it into a text editor such as Notepad temporarily

</div><div class="section">  
</div></div>### Create Client-Specific Overrides

Now add **Client Specific Overrides** for each client site. These tie a client subnet to a particular certificate so that OpenVPN can properly route a subnet to the correct site.

<div class="section" id="bkmrk-navigate-to%C2%A0vpn-%3E-op-2"><div class="section">- Navigate to **VPN &gt; OpenVPN**, **Client Specific Overrides** tab
- Click ![fa-plus](https://docs.netgate.com/pfsense/en/latest/_images/fa-plus.png) to add a new override
- Fill in the fields on this screen as follows:
    
    <dl class="field-list"><dt class="field-odd">Common Name</dt><dd class="field-odd">Enter the CN of the first client site. In this example, that is `<span class="pre">clientB</span>`.
    
    </dd><dt class="field-even">IPv4 Remote Network/s</dt><dd class="field-even">The clientB LAN subnet, `<span class="pre">10.5.0.0/24</span>`.
    
    Note
    
    This field sets up the internal route (`<span class="pre">iroute</span>`)
    
    </dd></dl>
- Click **Save**

</div></div>Add an override for the second site, adjusting the **Common Name** and **IPv4 Remote Network** to match. In the example for site C, these values would be `<span class="pre">clientC</span>` and `<span class="pre">10.7.0.0/24</span>` respectively.

See also

<div class="section" id="bkmrk-client-specific-over-1"><div class="section" id="bkmrk-client-specific-over-2"><div class="admonition seealso">- [<span class="doc">Client Specific Overrides</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/configure-overrides.html)
- [<span class="std std-ref">Troubleshooting OpenVPN Internal Routing (iroute)</span>](https://docs.netgate.com/pfsense/en/latest/troubleshooting/openvpn-iroute.html#troubleshooting-openvpn-iroute)
- [<span class="doc">Tunnel Settings</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/configure-server-tunnel.html)

</div></div><div class="section">  
</div></div>### Firewall Rules

#### External Traffic (WAN)

Next, add a firewall rule for the WAN interface which allows access to the OpenVPN server.

<div class="section" id="bkmrk-navigate-to%C2%A0firewall"><div class="section"><div class="section" id="bkmrk-navigate-to%C2%A0firewall-1">- Navigate to **Firewall &gt; Rules**, **WAN** tab
- Click ![fa-level-up](https://docs.netgate.com/pfsense/en/latest/_images/fa-level-up.png) **Add** to create a new rule at the top of the list
- Set the options as follows:
    
    <dl class="field-list"><dt class="field-odd">Protocol</dt><dd class="field-odd">*UDP*
    
    </dd><dt class="field-even">Source</dt><dd class="field-even">*any* (since multiple sites must connect)
    
    Tip
    
    For extra security, if the clients have static IP addresses, create an alias containing these addresses, then set it as the source on this rule.
    
    </dd><dt class="field-odd">Destination</dt><dd class="field-odd">*WAN Address*
    
    </dd><dt class="field-even">Destination port</dt><dd class="field-even">`<span class="pre">1194</span>`
    
    </dd><dt class="field-odd">Description</dt><dd class="field-odd">`<span class="pre">OpenVPN</span> <span class="pre">Multi-Site</span> <span class="pre">VPN</span>`
    
    </dd></dl>
- Click **Save**
- Click **Apply Changes**

</div><div class="section">  
</div></div></div>#### Tunneled Traffic

Now add a rule to the **OpenVPN** tab to pass traffic over the VPN from the Client-side LAN to the Server-side LAN. This can be an “Allow all” style rule or a set of stricter rules. This example allows all traffic using this rule:

<div class="section" id="bkmrk-navigate-to%C2%A0firewall-2"><div class="section"><div class="section">- Navigate to **Firewall &gt; Rules**, **OpenVPN** tab
- Click ![fa-level-up](https://docs.netgate.com/pfsense/en/latest/_images/fa-level-up.png) **Add** to create a new rule at the top of the list
- Set the options as follows:
    
    <dl class="field-list"><dt class="field-odd">Protocol</dt><dd class="field-odd">*any*
    
    </dd><dt class="field-even">Source</dt><dd class="field-even">*any*
    
    Tip
    
    For extra security, create an alias containing only the remote hosts or subnets which must initiate contact with hosts on the sever LAN, then use that alias as the source on this rule.
    
    </dd><dt class="field-odd">Destination</dt><dd class="field-odd">*any*
    
    Tip
    
    For extra security, create an alias containing only the local hosts or subnets on the server LAN which must accept connections from remote hosts across the VPN, then use that alias as the destination on this rule.
    
    </dd><dt class="field-even">Description</dt><dd class="field-even">`<span class="pre">Allow</span> <span class="pre">all</span> <span class="pre">on</span> <span class="pre">OpenVPN</span>`
    
    </dd></dl>
- Click **Save**
- Click **Apply Changes**

</div></div></div>That completes the server setup, next, now move on to configure the clients.

<div class="section" id="bkmrk--13"><div class="section" id="bkmrk--14"><div class="section" id="bkmrk--15"></div></div></div>## Configuring SSL/TLS Client Side

### Import CA and Certificate

On the client, import the CA certificate along with the client certificate and key for that site. This is the same CA and client certificate created earlier in this document.

See also

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

Import these items at **System &gt; Cert Manager**.

First import the CA:

<div class="section" id="bkmrk-navigate-to%C2%A0system-%3E-6"><div class="section">- Navigate to **System &gt; Cert Manager**, **CAs** tab
- Click **Add** to create a new certificate authority
- Enter the settings as follows:
    
    <dl class="field-list simple"><dt class="field-odd">Descriptive Name</dt><dd class="field-odd">`<span class="pre">S2SCA</span>`
    
    </dd><dt class="field-even">Method</dt><dd class="field-even">*Import an existing Certificate Authority*
    
    </dd><dt class="field-odd">Certificate Data</dt><dd class="field-odd">Open the CA certificate file in a text editor on the client PC, select all of the text, and copy it to the clipboard. Then paste it into this field.
    
    </dd></dl>
- Click **Save**

</div></div>Next, import the client certificate:

<div class="section" id="bkmrk-navigate-to%C2%A0system-%3E-7"><div class="section">- Navigate to **System &gt; Cert Manager**, **Certificates** tab
- Click **Add** to create a new certificate
- Enter the settings as follows:
    
    <dl class="field-list simple"><dt class="field-odd">Method</dt><dd class="field-odd">*Import an existing Certificate*
    
    </dd><dt class="field-even">Descriptive Name</dt><dd class="field-even">`<span class="pre">clientB</span> <span class="pre">VPN</span> <span class="pre">Certificate</span>`
    
    </dd><dt class="field-odd">Certificate Type</dt><dd class="field-odd">*X.509 (PEM)*
    
    </dd><dt class="field-even">Certificate Data</dt><dd class="field-even">Open the client certificate file in a text editor on the client PC, select all of the text, and copy it to the clipboard. Then paste it into this field.
    
    </dd><dt class="field-odd">Private Key Data</dt><dd class="field-odd">Open the client certificate private key in a text editor on the client PC, select all of the text, and copy it to the clipboard. Then paste it into this field.
    
    </dd></dl>
- Click **Save**

</div></div>Repeat these steps on each client firewall.

<div class="section" id="bkmrk--16"><div class="section" id="bkmrk--17"></div><div class="section">  
</div></div>### Configure the OpenVPN Client Instance

After importing the certificates, create the OpenVPN client:

<div class="section" id="bkmrk-navigate-to%C2%A0vpn-%3E-op-3"><div class="section">- Navigate to **VPN &gt; OpenVPN**, **Client** tab
- Click ![fa-plus](https://docs.netgate.com/pfsense/en/latest/_images/fa-plus.png) **Add** to create a new client
- Fill in the fields as follows, with everything else left at defaults:
    
    See also
    
    See [<span class="doc">Client Configuration Options</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/configure-client.html) for details on each of these options.
    
    <dl class="field-list"><dt class="field-odd">Description</dt><dd class="field-odd">Text to describe the connection (e.g. `<span class="pre">Site</span> <span class="pre">A</span> <span class="pre">VPN</span>`)
    
    </dd><dt class="field-even">Server Mode</dt><dd class="field-even">*Peer to Peer (SSL/TLS)*
    
    </dd><dt class="field-odd">DCO (Plus Only)</dt><dd class="field-odd">Check this box to activate the [<span class="std std-ref">OpenVPN Data Channel Offload (DCO)</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/dco.html#openvpn-dco) feature for the client if desired.
    
    See also
    
    See [<span class="std std-ref">OpenVPN Data Channel Offload (DCO)</span>](https://docs.netgate.com/pfsense/en/latest/vpn/openvpn/dco.html#openvpn-dco) for additional information.
    
    </dd><dt class="field-even">Device Mode</dt><dd class="field-even">*tun*
    
    </dd><dt class="field-odd">Protocol</dt><dd class="field-odd">*UDP on IPv4 only*
    
    </dd><dt class="field-even">Interface</dt><dd class="field-even">*WAN*
    
    </dd><dt class="field-odd">Server host or address</dt><dd class="field-odd">The public IP address or hostname of the OpenVPN server (`<span class="pre">198.51.100.3</span>` in this example)
    
    </dd><dt class="field-even">Server Port</dt><dd class="field-even">`<span class="pre">1194</span>`
    
    </dd><dt class="field-odd">Enable authentication of TLS packets</dt><dd class="field-odd">*Checked*
    
    </dd><dt class="field-even">Automatically generate a shared TLS authentication key</dt><dd class="field-even">Unchecked
    
    </dd><dt class="field-odd">TLS Key</dt><dd class="field-odd">Paste in the TLS key copied from the server instance
    
    </dd><dt class="field-even">Peer Certificate Authority</dt><dd class="field-even">The CA imported at the beginning of this process
    
    </dd><dt class="field-odd">Client Certificate</dt><dd class="field-odd">The client certificate imported at the beginning of this process
    
    </dd></dl>
- Click Save

<div class="admonition note">  
</div></div></div>Note

With remote access PKI configurations such as this example, routes and other configuration options are typically pushed from the server and thus not present in the client configuration. If the client side must reach additional networks, configure them in the **server** settings or a client-specific override as **Local Networks**.

### Firewall Rules

This next step is optional depending on whether or not hosts on the server network or other client sites need to initiate contact with hosts on the client network. If the other sites do not need to initiate contact with this client, then no action is necessary.

If the other sites needs to initiate contact, then this traffic requires a firewall rule on the **OpenVPN** tab on the *client* firewall to allow traffic from other VPN sites to reach the Client-side LAN. An “Allow all” style rule is OK in some cases, but a set of stricter rules is the best practice.

This example allows all traffic:

<div class="section" id="bkmrk-navigate-to%C2%A0firewall-3"><div class="section" id="bkmrk-navigate-to%C2%A0firewall-4">- Navigate to **Firewall &gt; Rules**, **OpenVPN** tab
- Click ![fa-level-up](https://docs.netgate.com/pfsense/en/latest/_images/fa-level-up.png) **Add** to create a new rule at the top of the list
- Set the options as follows:
    
    <dl class="field-list"><dt class="field-odd">Protocol</dt><dd class="field-odd">*any*
    
    </dd><dt class="field-even">Source</dt><dd class="field-even">*any*
    
    Tip
    
    For extra security, create an alias containing only the remote hosts or subnets which must initiate contact with hosts on the client LAN, then use that alias as the source on this rule.
    
    </dd><dt class="field-odd">Destination</dt><dd class="field-odd">*any*
    
    Tip
    
    For extra security, create an alias containing only the local hosts or subnets on the client LAN which must accept connections from remote hosts across the VPN, then use that alias as the destination on this rule.
    
    </dd><dt class="field-even">Description</dt><dd class="field-even">`<span class="pre">Allow</span> <span class="pre">all</span> <span class="pre">on</span> <span class="pre">OpenVPN</span>`
    
    </dd></dl>
- Click **Save**
- Click **Apply Changes**

</div></div>## Testing the Connection

The configuration is now complete. The OpenVPN client instance automatically starts when created, so it should already be attempting to connect at this point and if the configuration is correct, it will be connected.

Try to ping across to the remote end LAN to verify connectivity.

<div class="section" id="bkmrk--18"></div>