OpenVPN server

When configured as an OpenVPN server, the UTM can accept remote connections from the uplink and allow a VPN client to be set up and interact with the local resources as if it were a local workstation or server.

The OpenVPN server on the UTM allows several server instances to run concurrently, provided the CPU has a sufficient number of cores: for every CPU core, one OpenVPN instance is allowed. Each instance listens on a different port, and accepts incoming connections to that port only.

Moreover, when the hardware on which UTM is installed has multiple CPU cores, every instance may be assigned more that one core, thus resulting in an increase of the throughput and data processing of that instance.

The first time the service is started a new, self-signed CA certificate for this OpenVPN server is generated and can be downloaded by clicking on the Download certificate link. It can later be used by all the clients that want to connect to this OpenVPN server.

Finally, after the server has been configured, it is possible to create and configure accounts for clients that can connect to the UTM in the Authentication page.

The OpenVPN server module is composed of three pages, namely Server configuration, Server instances, and VPN client download.

Server configuration

This page shows a switch Disabled, that will start the OpenVPN server and all services related to it (like e.g., the VPN firewall if enabled) once clicked.

Note

When starting the OpenVPN server for the first time, the root and host certificates are generated automatically.

Below, there is a single box, OpenVPN settings–that allows to set up global settings shared by all the instances.

OpenVPN settings

The box on the top shows the current OpenVPN settings, which concern the authentication method, and are:

Authentication type

Authentication Type

There are three available authentication methods to connect clients to the OpenVPN server running on the UTM:

A password-based connection is established after providing a correct username/password combination.

Don’t check client certificate key usage

Applies only to X.509 or X.509 & PSK. A tick on the checkbox will disable checking client certificate key usage. The default option is for this field to be unchecked which enables key usage checking. This is a useful security option for clients, to ensure that the host they connect to is a designated server. Or the other way around; for a server to verify that only hosts with a client certificate can connect.

Warning

When employing X.509 certificate-only authentication, any client with a valid certificate will be granted access to the OpenVPN server even without a valid account!

UTM‘s default method is PSK (username/password): The client authenticates using username and password. To use this method, no additional change is needed, while the other two methods are described below.

Server certificate

Certificate configuration

This drop-down menu is used to select the method of creation of a new certificate. The available options are:

Select one certificate from those available, shown on the right-hand side of the drop-down menu. It is possible to see the full details of this certificate by clicking on the View details hyperlink.

When a certificate has been chosen, below the Certificate configuration drop-down menu appear the name of the currently used certificate and the View details link. The latter will show all information about the certificate when clicked.

By clicking on Download certificate, it will be possible to download the certificate necessary for the connecting clients.

Advanced options

In the Advanced options panel, a few options are available to customise the OpenVPN server.

Delay triggers

A tick on the checkbox will allow to delay the triggers launched whenever a client connects to or disconnects from the OpenVPN server. Since triggers are mostly a reload of routing and firewall rules, this option proves useful with very large VPN client networks when many clients connect or disconnect at the same time.

Log verbosity

This option allows to increase or decrease the amount of messages written in the log file. The default value is 1, which means that only the most relevant messages are written to the log file, and can be increased up to 5.

Hint

A good value for debugging is 4.

Create a DNS entry for each connected client

When this option is ticked, whenever a client connects, it will receive an entry in the local DNS server, for other clients to be able to connect easily to it. The next option will appear.

Clients DNS entry prefix

A custom prefix that will be prefixed to the username of a client to uniquely identify it when using the local DNS.

Hint

If the prefix written here is vpn, the entry will be vpn-username, like e.g., vpn-johndoe.

Server instances

In this page appears the list of already defined OpenVPN instances; for each of them are displayed the name, a remark, and some details about the configuration, namely: The port on which the instance is listening, the protocol, the type of device, the type of network, authentication and certificate used, and the available actions.

Above the table, the Add new OpenVPN server instance button allows to define a new server instance and is followed by the list of the OpenVPN server instances defined.

Note

The number of allowed OpenVPN instances depends on the number of CPU cores of the appliance: at most one defined (enabled or not) instance per core is permitted; if not, , the message Maximum number of OpenVPN server instances exceeded is shown. To check the number of CPU cores, check either the CPU Load widget in the Overview, or use the command ds openvpn.settings.ALLOWED_INSTANCES from the command line.

Add new OpenVPN instance

In the editor, the following configuration options are shown.

Name

The name given to the OpenVPN server instance.

Remark

A comment for this instance.

Bind only to

The IP address to which the instance should listen to.

Port

The port on which the instance waits for incoming connections.

Note

Each server must be configured on a different port.

Network Options

Device type

The device used by the instance, chosen between TUN and TAP from the drop-down menu. TUN devices require that the traffic be routed, hence the option Bridged below is not available for TUN devices.

Protocol

The protocol used, chosen between TCP and UDP from the drop-down menu.

Bridged

Tick this option to run the OpenVPN server in bridged mode, i.e., within one of the existing zones.

The following options will appear.


Bridged to

The zone to which the OpenVPN server should be bridged. The drop-down menu shows only the available zones.

Dynamic IP pool start address

The first possible IP address in the network of the selected zone that should be used for the OpenVPN clients.

Dynamic IP pool end address

The last possible IP address in the network of the selected zone that should be used for the OpenVPN clients.


VPN subnet

This option is the only available if bridged mode is disabled. It allows the OpenVPN server to run in its own, dedicated subnet, that can be specified in the text box and should be different from the subnets of the other zones.

Note

If the OpenVPN server is routed), the clients will receive their IP addresses from a dedicated subnet. In this case, appropriate firewall rules in the VPN firewall should be created, to make sure the clients can access a zone, or just some resource (e.g., a source code repository) therein. If the OpenVPN server is bridged, it inherits the firewall settings of the zone it is defined in.

Routed and bridged OpenVPN server, static and dynamic IP addresses.

When configuring a reserved pool of IP addresses for OpenVPN clients, it is necessary to keep in mind a few rules that will keep the networking setup cleaner and help in troubleshooting, if needed.

  • Before starting the configuration of the server in a multicore architecture, regardless of the bridged or routed mode, any reservation of static IP addresses is ignored. In other words, a client connecting to this VPN server, will always receive a dynamic IP address, even if it is configured with a static IP assignment.

  • The first choice is to define whether the OpenVPN server should act in routed or bridged mode. In routed mode, it is necessary to define a dedicated VPN subnet that must be different from any other defined on the Firewall. Moreover, the traffic directed to this subnet has to be filtered, if necessary, using the VPN firewall. In bridged mode, the OpenVPN server will consider the clients as physically connected to that zone, i.e., the OpenVPN server bridges the clients to one of the zones. In this case, a pool of IP addresses must be defined within the zone, that must be entirely contained in the zone’s subnet and be smaller than that one. It is also important to make sure that this pool does not conflict with other pools defined in that zone, like e.g., a DHCP server.

  • In bridged mode it is possible to assign to some (or even to all) users a static IP address, that good practices suggest to define outside of any IP pools defined in that zone, to prevent both an IP address conflict and a wrong routing. Traffic to these IPs can then be filtered using the VPN (or IPsec) user as source or destination of traffic in the firewall rules.

Certificate

Certificate configuration

This drop-down menu is used to select the method of creation of a new certificate. The available options are:

Select one certificate from those available, shown on the right-hand side of the drop-down menu. It is possible to see the full details of this certificate by clicking on the View details hyperlink.

When a certificate has been chosen, below the Certificate configuration drop-down menu appear the name of the currently used certificate and the View details link. The latter will show all information about the certificate when clicked.

Advanced options

In the Advanced options box, additional options can be configured.

Number of processes

The drop-down menu allows to chose how many CPUs of the UTM can be used by the instance, hence the options in the drop-down menu may vary.

Note

This option is present only on appliances with multicore CPU.

Allow multiple connections from one account

Normally, one client is allowed to connect from one location at a time. Selecting this option permits multiple client logins, even from different locations. However, when the same client is connect twice or more, the VPN firewall rules do not apply anymore.

Block DHCP responses coming from tunnel

Tick this checkbox when receiving DHCP responses from the LAN at the other side of the VPN tunnel that conflict with the local DHCP server.

Client to client connections

Select from the drop-down menu the modalities of the communications between clients of the OpenVPN server. This option is only available on single-process servers, i.e., on servers running only one instance of the OpenVPN server.

The clients will not be able to communicate one to the other.

Renegotiation data channel key interval

This option allows to modify the time interval after which the data channel key will be renegotiated. The value is measured in seconds, with the default value set to 3600 seconds.

Push options

Push these nameservers

By ticking this checkbox, the nameserver specified in the textfield below are sent to the clients upon connection.

Nameservers

The nameservers specified in this textfield are sent to the connected clients, when the previous checkbox has been ticked.

Push these networks

By ticking this checkbox, the routes to the networks defined in the textfield below are sent to the connected clients.

Networks

The networks specified in this textfield are sent to the connected clients, when the previous checkbox has been ticked.

Push this domain

By ticking this checkbox, the search domain defined in the textfield on the right-hand side, is added to those of the connected clients.

Domain

The domain that will be used to identify the servers and network resources in the VPN network (i.e., the search domain).

Note

The options Push these nameservers and Push domain only work for clients running the Microsoft Windows operating system.

Authentication type

Authentication

The authentication type for this instance of OpenVPN. By default it will inherit the global configuration. However, this can be overridden by specifying manually one of the available options here, which are the same as in the global options: PSK (username/password), X.509 certificate and X.509 certificate & PSK (two factor).

Encryption

Cipher

This drop-down menu allows to choose the cipher that is used by the OpenVPN server. The default value is Auto, which means that the cipher is automatically negotiated.

Message digest algorithm

This drop-down menu allows to choose the message digest algorithm that is used by the OpenVPN server. The default value is Auto, which means that the cipher is automatically negotiated.

Disable channel encryption

When this option is ticked, the whole VPN traffic through this instance will NOT be encrypted, i.e., it will be in plain text. Moreover, the previous two options will disappear.

Warning

It is strongly suggested to not disable encryption on the OpenVPN server, as the whole OpenVPN traffic will not be encrypted but will flow as plain text and could be easily read in case the communication is intercepted.

Use certificates with weak signature algorithm

This option allows OpenVPN clients to connect to the UTM's OpenVPN server even if the server’s CA has been signed with a weak cipher like MD5.

Warning

This option should remain disabled and certificates generated using MD5 should not be used anymore, because they are highly insecure. This option is meant as a temporary workaround and it is strongly suggested to regenerate all certificates if they are using MD5 ciphers.

Enabled

Tick this checkbox to make sure the OpenVPN server instance is started.

Troubleshooting VPN connections.

While several problem with VPN connections can be easily spotted by looking at the configuration, one subtle source of connections hiccups is a wrong value of the MTU size. The UTM sets a limit of 1450 bytes to the size of the VPN’s MTU, to prevent problems with the common MTU value used by the ISP, which is 1500. However, some ISP may use a MTU value lower that the commonly used value, making the Endian MTU value too large and causing therefore connection issues (the most visible one is probably the impossibility to download large files). This value can be modified by accessing the UTM from the CLI and following these guidelines:

  1. Write down the MTU size used by the ISP (see link below).

  2. Login to the CLI, either from a shell or from Menubar ‣ System ‣ Web Console.

  3. Edit the OpenVPN template with an editor of choice: nano /etc/openvpn/openvpn.conf.tmpl.

  4. Search for the string mssfix 1450.

  5. Replace 1450 with a lower value, for example 1200.

  6. Restart OpenVPN by calling: jobcontrol restart openvpnjob.

See also

More information about the MTU size.

VPN client download

Click on the link to download the Endian VPN client for Microsoft Windows and MacOS X from the Endian Network. A valid account on Endian Network is required.