OpenVPN Road Warrior#

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. This setup is particularly useful for businesses and organizations with employees or collaborators spread across different locations, ensuring encrypted communication and data privacy.

OpenVPN is a protocol supported by the most widely used platforms, with free clients available for Windows, MacOS, Linux, Android, and iOS systems.

Nota

Before configuring the OpenVPN Road Warrior, make sure you have read the chapter related to the user database.

Server configuration#

An OpenVPN server is running on NethSecurity waiting for remote clients to contact it and establish a connection. It must be reachable from the internet on its specific port (default: 1194 UDP). Multiple clients can connect to the server, authenticate themselves and gain access to the private network; however, the clients do not need to be reachable on the internet. Each connecting client, after authentication, receives an IP address with which it will present itself to the remote network.

An OpenVPN server on NethSecurity is closely tied to a user database, which can be local or remote. The association with the database is defined during server creation and cannot be modified later.

The server configuration is straightforward because NethSecurity automatically sets most fields to sane defaults, which usually only need verification.

To configure a new OpenVPN server, click Create Server button and configure the proposed fields:

  • Server name: give a name to this OpenVPN server

  • User database: choose the user database to use for authentication, it can be a local database or a remote one (e.g. LDAP or Active Directory)

  • Create an account for each user: this is a special field and won’t be shown again in the future, it allows you to automatically create a VPN account for each user present in the database. All accounts created will have a certificate valid for 3650 days.

  • Mode: bridged or routed; routed mode is the default one and the most common, it allows to create a virtual network where clients are connected to the server and can communicate with each other. Bridged mode is less common and allows to connect the clients to the server as if they were connected to the same LAN this mode is useful when the clients need to access resources that are not directly accessible from the server. If unsure, select routed mode.

  • Authentication mode: several authentication modes are supported:

    • Username and password: the connecting client must provide a valid username and password; only users with a password set can use this mode

    • Certificate: the connecting client must have its own certificate to authenticate; this is the recommended mode for most cases

    • Username password and certificate: the connecting client must provide a valid username, password and certificate

    • Username OTP and certificate: the connecting client must provide a valid username, certificate and also an OTP code used as a password. This mode requires additional configuration in the client to receive to OTP code

  • VPN Network: the virtual network used by clients; every client will receive an IP address taken from this network. NethSecurity already suggests an uncommon network to avoid overlaps with other networks used by the firewall

  • Public IP/hostname of this unit: NethSecurity automatically fills out this field with the public IP address of each configured WAN interface. These IPs/hostnames will go into the client configuration. The order of the elements is crucial because the connecting client will start contacting the IPs/hostnames beginning with the first in the list and then progressing down the list in case of unavailability.

Click on the Create button to create the server. After that, main server details will be shown in the Web UI.

Advanced settings#

If needed, you can also customize some advanced options:

  • Protocol: UDP (default), TCP

  • Port: 1194 (default)

  • Instrada tutto il traffico attraverso la VPN: se abilitato, tutto il traffico proveniente dal client verrà instradato nel tunnel VPN, incluso il normale traffico internet. Può essere utilizzato per fini di monitoraggio e controllo, ma di solito è disabilitato poiché introduce una maggiore latenza e consumo di banda.

  • Instrada queste reti sulla VPN: lista di reti che il client instrada attraverso il tunnel VPN; le reti LAN vengono aggiunte automaticamente, se necessario altre reti possono essere aggiunte allo stesso modo

  • Consenti traffico tra client: consente lo scambio di traffico tra i client connessi; si consiglia di lasciarlo disabilitato.

  • Compressione: comprime il traffico del tunnel OpenVPN per risparmiare larghezza di banda. Tuttavia, è ora un’opzione poco utile ed in alcuni casi, può essere dannosa. Si consiglia vivamente di lasciarla disabilitata. Quando questa opzione viene modificata, è necessario scaricare nuovamente la configurazione del client.

  • Digest: the digest authenticates data channel packets (default SHA 256)

  • Cipher: encryption cipher used (default AES-256-GCM)

  • Richiedi un numero di versione TLS minimo: consente la connessione solo per i client che uilizzano una versione TLS pari o superiore a quella specificata.

  • Opzioni DHCP personalizzate: passa specifiche opzioni DHCP al client (ad esempio DOMAIN, DNS, WINS e così via)

VPN accounts#

Ora che il server è stato configurato, è necessario creare gli account per i client. Per fare questo, clicca su Aggiungi account VPN e compila il modulo:

  • Utente: ogni account è associato ad un solo utente dal database scelto, selezionare l’utente per questo account

  • Reserved IP: indica un indirizzo IP che fa parte della rete VPN definita che sarà sempre assegnato a questo account specifico, questo può essere molto utile per la creazione di regole firewall. Lascialo vuoto per assegnare un indirizzo IP casuale su ogni connessione.

  • Scadenza certificato (giorni): specificare la durata del certificato (predefinito 3650 giorni)

Once the account is created, it is necessary to export the configuration and load it into the client that needs to connect. To do this, simply click on the menu of the specific account and choose Download configuration. This action downloads the ready-to-use file, simply to be loaded into the client. This file is dynamically generated based on the current configuration of the OpenVPN server and already contains all the necessary information, including configuration details (server addresses, port, etc.) and required certificates. In case the server’s operating mode is changed (e.g., if the authentication mode is altered), it is necessary to download the file again.

Altre azioni disponibili:

  • Disabilita: disabilita l’account; l’account può essere riabilitato in qualsiasi momento.

Nota

If a client is already connected to the roadwarrior server, the Disable action on the respective account causes an immediate disconnection from the server, interrupting the communication.

  • Rigenera certificato: ricrea il certificato personale per l’account; se il certificato corrente non è scaduto, sarà revocato, e sarà necessario utilizzare il nuovo. Dopo aver rigenerato il certificato, è necessario aggiornarlo sul client ricaricando l’intera configurazione o semplicemente il certificato.

  • Elimina: cancella l’account e il suo certificato. Questa operazione è irreversibile ed il certificato non può essere recuperato.

Comportamento client#

Alcune informazioni sul comportamento dei client:

  • I client connessi alla VPN Road Warrior sono assegnati alla zona rwopenvpn, che è considerata attendibile. Per impostazione predefinita, questa zona ha accesso privilegiato sia alle zone LAN che WAN all’interno dell’infrastruttura di rete.

  • Connessione di Backup: in presenza di più connessioni WAN, i client si collegheranno utilizzando il primo IP/hostname della configurazione del server, se non è disponibile useranno il secondo IP/hostname e così via.

  • Per motivi di sicurezza, non è possibile collegare più client con lo stesso account. Ogni account può essere utilizzato da un solo client alla volta. Se un nuovo client tenta il collegamento con un account già connesso al sistema, il primo account sarà disconnesso.

Software client#

Tutte le principali piattaforme sono supportate. Ecco alcuni riferimenti per scaricare il software necessario: