Setup SSL VPN site to site tunnel — OPNsense documentation (2024)

  • »
  • Virtual Private Networking »
  • Setup SSL VPN site to site tunnel

Site to site VPNs connect two locations with static public IP addresses and allowtraffic to be routed between the two networks. This is most commonly used toconnect an organization’s branch offices back to its main office, so branch userscan access network resources in the main office.

Index

Before you start

Before starting with the configuration of an OpenVPN SSL tunnel you need to have aworking OPNsense installation with a unique LAN IP subnet for each side of yourconnection (your local network needs to be different than that of the remotenetwork).

Note

For the sample we will use a private IP for our WAN connection.This requires us to disable the default block rule on WAN to allow private traffic.To do so, go to Interfaces ‣ [WAN] and uncheck “Block private networks”.(Don’t forget to save and apply)

Setup SSL VPN site to site tunnel — OPNsense documentation (2)

Network topology

The schema below describes the situation we are implementing. Two networks (A,B) and a transit network (10.10.8.0/24)to peer both firewalls. We will create a tunnel network 10.1.8.0/24 between both sites.

Preparations

Trust

In order to setup a tunnel on both ends, we need to configure certificates to warrant trust between both machines.We have chosen to setup the server on “Site B”, so we start with Trust configuration there.

  • First we need an Authority which we are going to create in System ‣ Trust ‣ Authorities

    • Select Create an internal Certificate Authority

    • Choose cryptographic settings and a lifetime (you may want to increase the default as after this time you do need to redistribute certificates to both server and client).

    • Add descriptive information for this CA (Descriptive name, City, Email, ..`)

    • Set the Common Name to something descriptive for this certificate, like “Office-ovpn”

  • Next generate a Certficate for the server using System ‣ Trust ‣ Certificates

    • Select Create an internal Certificate

    • Choose the just created authority in Certificate authority

    • Add descriptive information for this CA (Descriptive name, whereabouts are copied from the CA)

    • Set Type to Server

    • Choose cryptographic settings, lifetime determines the validaty of the server certificate (you do need to track this yourself), it’s allowed to choose a longer period here

    • Set the Common Name to the fqdn of this machine.

  • As the client (Site A) will also need a Certificate, we need to create a certificate, also using System ‣ Trust ‣ Certificates

    • Select Create an internal Certificate

    • Choose the just created authority in Certificate authority

    • Add descriptive information for this CA (Descriptive name, whereabouts are copied from the CA)

    • Set Type to Client

    • Choose cryptographic settings, lifetime determines the validaty of the server certificate (you do need to track this yourself), it’s allow to choose a longer period here

    • Set the Common Name to username the other end will use for identification. For this example we use test-client

Note

It’s a best practice to offer each user it’s own certificate using the same common name as the username, althoughit is also possible to clients to share a certificate. When adding a certificate from the user manager the CN is automaticallyset to its name. In this example we will only authenticate using the certificate, no additional user or password will be required.

Static keys

We create a static key and define it’s use in VPN ‣ OpenVPN ‣ Instances ‣ Static Keys, for this exampleselect auth as mode and click the gear button to generate one. Provide a description for this key.

Prepare Site A

  • Copy the public part of the certificate authority to the firewall at Site A (use the download button and copy the contents into a new CA on this host)

  • Copy the public and private part of the client certificate into a new one on Site A

  • Copy the contents of the static key to a new entry and select the same type

Create a server instance (Site B)

Now the generic setup is done, we can configure a new server type instance via VPN ‣ OpenVPN ‣ Instances

Property

site B

Role

Server

Description

MyServer

Protocol

UDP (IPv4)

Port number

1194

Bind address

10.10.8.2 1

Server (IPv4)

10.1.8.0/24 (the tunnel network used)

Certificate

choose the prepared server certificate

TLS static key

choose the prepared static key

Local Network

192.168.8.0/24

Remote Network

10.0.8.0/24 2

Note 1

Leave empty to bind to all addresses assigned to this machine or use a loopback address combined with a port forward whenthe external address is not static.

Note 2

The network(s) served by this openvpn instance, after startup routes will be created. In order to bindthe network to the correct client a Client Specific Overwrite is also needed.

Hit the apply button when the instance is configured and add a client specific overwrite in VPN ‣ OpenVPN ‣ Client Specific Overrides

Property

site B

Servers

leave empty or select our server

Common name

test-client

Remote Network

10.0.8.0/24 1

Note 1

The remote network bound to this common name, without this entry the traffic will not be routed between hosts.

Next go to Firewall ‣ Rules ‣ WAN and add a rule to allow traffic on port 1194/UDP from the otherhost. At minimum we should add a rule similar to this one:

Property

site B

Interface

WAN

Protocol

UDP

Destination port range

1194

Finally we are going to allow traffic on the tunnel itself by adding a rule to Firewall ‣ Rules ‣ OpenVPN,for this example we keep it simple and add one to allow all, in which case we can save the defaults when adding a rule.

Create a client instance (Site A)

With the server in place it’s time to setup the client on OPNsense, for this we go to VPN ‣ OpenVPN ‣ Instancesand add a new instance using the following settings.

Property

site A

Role

Client

Description

MyClient

Protocol

UDP (IPv4)

Remote

10.10.8.2

Certificate

choose the prepared client certificate

TLS static key

choose the prepared static key

Remote Network

192.168.8.0/24

Test connectivity

Use the VPN: OpenVPN: Connection Status page to watch the status of both server and client, whenpassing traffic over the link on both ends the counters should increase.

Now try to ping from Site A (10.0.8.20) to Site B (192.168.8.20).

Setup SSL VPN site to site tunnel — OPNsense  documentation (2024)

FAQs

Setup SSL VPN site to site tunnel — OPNsense documentation? ›

With site-to-site SSL VPN, you can provide access between internal networks over the internet using point-to-point encrypted tunnels. The tunnel endpoints act as either client or server. The client initiates the connection, and the server responds to client requests.

How to setup a VPN on OPNsense? ›

OPNsense 21 setup with NordVPN
  1. In order to setup OPNsense with OpenVPN please access your OPNsense via browser.
  2. Navigate to System -> Trust -> Authorities and click on the +Add button. You should see this screen:
  3. Navigate to VPN -> OpenVPN -> Clients and press + Add button.
  4. Fill in the fields: GENERAL INFORMATION.

Is SSL VPN site to site? ›

With site-to-site SSL VPN, you can provide access between internal networks over the internet using point-to-point encrypted tunnels. The tunnel endpoints act as either client or server. The client initiates the connection, and the server responds to client requests.

Is WireGuard good for site to site? ›

Why should we set up site to site VPN with WireGuard®? If you're required to share information or resources between intranets from different locations, such as offices, chain stores, using site to site VPN with WireGuard® can quickly help you build up your private network to connect all these places.

What is road warrior VPN? ›

Road Warrior refers to a specific configuration of the OpenVPN VPN tailored for remote users, allowing them secure access to a private network from anywhere on the internet.

How to configure VPN tunneling? ›

  1. Overview.
  2. Step 1: Create a VPN Gateway.
  3. Step 2: Create a Customer Gateway.
  4. Step 3: Create a VPN Tunnel.
  5. Step 4: Load the Configuration of the Local Gateway.
  6. Step 5: Configure a Routing Table.
  7. Step 6: Activate a VPN Tunnel.
Jan 9, 2024

Which is better, OPNsense or pfSense? ›

If you want high customizability and a large support community, pfSense is a good option. If you prioritize an easy-to-use interface and frequent updates, instead, OPNsense may be better. Ultimately, pfSense offers more flexibility for seasoned users, but OPNsense provides a more polished out-of-box experience.

How to create a site-to-site VPN? ›

For more information, see Tunnel options for your Site-to-Site VPN connection.
  1. Step 1: Create a customer gateway. ...
  2. Step 2: Create a target gateway. ...
  3. Step 3: Configure routing. ...
  4. Step 4: Update your security group. ...
  5. Step 5: Create a VPN connection. ...
  6. Step 6: Download the configuration file.

What is the difference between IPsec tunnel and SSL VPN? ›

IPsec provides network-layer security, encrypting entire data packets, making it a popular choice for full network communications. On the other hand, SSL VPNs focus on application-layer security, ensuring only specific application data is encrypted. The "more secure" label depends on the context.

What are the risks of SSL VPN? ›

General Security Risks

VPN security is only as strong as the methods used to authenticate the users (and the devices) at the remote end of the VPN connection. Simple authentication methods based on static passwords are subject to password “cracking” attacks, eavesdropping, or even social engineering attacks.

Why not to use WireGuard? ›

Why you shouldn't use WireGuard. WireGuard prioritizes speed, ease of use, and network security, but, some might say, at the expense of privacy. WireGuard does lack some standard features and practices many other protocols offer to enhance user privacy protection, such as: Dynamic IP addresses.

Which is safer WireGuard or OpenVPN? ›

The biggest notable differences between WireGuard and OpenVPN are speed and security. While WireGuard is generally faster, OpenVPN provides heavier security. The differences between these two protocols are also what make up their defining features.

Which is better site to site WireGuard or IPsec? ›

Compared to IPsec, the WireGuard connection has a 20% lower latency and a 15% higher throughput. When it comes to performance, WireGuard usually performs better than IPSec and even quicker than other VPN protocols like OpenVPN.

Which VPN for OPNsense? ›

Comparison of the best VPNs for pfSense routers
BrandPriceCompatible with pfSense
SurfsharkFrom $2.19/monthYes
PureVPNFrom $2.11/monthYes
ExpressVPNFrom $6.67/monthYes
Ivacy VPNFrom $1.17/monthYes
1 more row
Dec 12, 2023

How do I tunnel traffic through VPN? ›

Main Steps
  1. Configure VPN Settings in the Firewall Properties.
  2. Create a Policy-Based VPN Element.
  3. Enable the Any Network Site in the Firewall Properties.
  4. Add Access Rules and NAT Rules for the VPN Client Traffic.

What is WarpSpeed VPN? ›

Product Overview. WarpSpeed is a simple web-based VPN server powered by the open source WireGuard® protocol. WarpSpeed makes it easy for anyone to access their cloud infrastructure securely.

How do I configure a VPN connection? ›

Create a VPN profile
  1. Select Start > Settings > Network & internet > VPN > Add VPN.
  2. Under Add a VPN connection, do the following: For VPN provider, choose Windows (built-in). In the Connection name box, enter a name you'll recognize (for example, My Personal VPN). ...
  3. Select Save.

How do I enable my VPN? ›

  1. If you haven't already, add a VPN.
  2. Open your device's Settings app.
  3. Tap Network & internet. VPN. ...
  4. Next to the VPN you want to change, tap Settings .
  5. Turn Always-on VPN on or off. If you've set up a VPN through an app, you won't have the always-on option.
  6. If needed, tap Save.

How do I setup an internal VPN? ›

How to set up a VPN on your router
  1. Log into your router. You can access your router configuration panel by entering your router's IP address in your browser's URL bar. ...
  2. Look for the “VPN client” tab in the advanced settings of your router. ...
  3. Follow your VPN client's guidelines to set up the VPN on your router.
Jan 12, 2024

How to configure a VPN on pfSense? ›

Create the OpenVPN server
  1. From the pfSense menu, select VPN, and OpenVPN. Click Add.
  2. Select the Server mode, either Remote Access (SSL/TLS), Remote Access (User Auth), or Remote Access (SSL/TLS + User Auth).
  3. Change the Local port if necessary. Otherwise, the default is 1194.
  4. Name your server in the Description section.
Dec 11, 2023

Top Articles
Latest Posts
Article information

Author: Allyn Kozey

Last Updated:

Views: 5998

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762

Job: Investor Administrator

Hobby: Sketching, Puzzles, Pet, Mountaineering, Skydiving, Dowsing, Sports

Introduction: My name is Allyn Kozey, I am a outstanding, colorful, adventurous, encouraging, zealous, tender, helpful person who loves writing and wants to share my knowledge and understanding with you.