« OpenVPN » : différence entre les versions
Page créée avec « <br> = <span style="color:#1b4f72;">Installation et Configuration OpenVPN sur pfSense</span> = {| style="width:100%; background:#d6eaf8; border:1px solid #85c1e9; padding:15px; border-radius:10px; overflow:hidden;" | <span style="font-size:115%; color:#1b4f72;"> Cette section décrit l'installation et la configuration complète d'un serveur VPN avec OpenVPN intégré à pfSense. <br><br> Elle permet de se connecter à distance à son réseau local et d'accéder... » |
Aucun résumé des modifications |
||
| (2 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
<br> | <br> | ||
= <span style="color:# | = <span style="color:#004d40;">Installation et Configuration OpenVPN sur pfSense (Remote Access)</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:15px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<span style="font-size:115%; color:# | <span style="font-size:115%; color:#004d40;"> | ||
Ce guide permet de configurer un VPN OpenVPN en mode Remote Access sur pfSense. <br><br> | |||
Il permet à des clients distants d'accéder au réseau interne <b>192.168.60.0/24</b> de manière sécurisée. <br><br> | |||
L'architecture repose sur un tunnel chiffré AES-256-GCM avec authentification par certificats et gestion des utilisateurs intégrée à pfSense.</span> | L'architecture repose sur un tunnel chiffré AES-256-GCM avec authentification par certificats et gestion des utilisateurs intégrée à pfSense.</span> | ||
|} | |} | ||
| Ligne 13 : | Ligne 13 : | ||
<br> | <br> | ||
= <span style="color:# | = <span style="color:#00695c;">1 — Préparation du réseau</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#00695c;">Informations de l'environnement réseau utilisé dans ce guide</b> | ||
|} | |} | ||
== <span style="color:# | == <span style="color:#00897b;">Adressage réseau</span> == | ||
{| class="wikitable" style="width:50%;" | |||
! Élément !! Adresse | |||
|- | |||
| pfSense LAN || 192.168.60.254 | |||
|- | |||
| Réseau LAN || 192.168.60.0/24 | |||
|- | |||
| VM cible || 192.168.60.33 | |||
|} | |||
Schéma de l'architecture : | |||
Schéma de l'architecture | |||
<pre> | <pre> | ||
| Ligne 44 : | Ligne 39 : | ||
┌────────────┴────────────┐ | ┌────────────┴────────────┐ | ||
│ │ | │ │ | ||
┌─────────────────┐ | ┌─────────────────┐ ┌─────────────────────┐ | ||
│ Client VPN │ │ | │ Client VPN │ │ pfSense │ | ||
│ (PC distant) │ ════► │ OpenVPN | │ (PC distant) │ ════► │ OpenVPN Remote │ | ||
│ .ovpn importé │ │ | │ .ovpn importé │ │ Access Port 1194 │ | ||
└─────────────────┘ | └─────────────────┘ └──────────┬──────────┘ | ||
│ | |||
┌──────────┴──────────┐ | |||
│ LAN 192.168.60.x │ | |||
│ VM : 192.168.60.33 │ | |||
└─────────────────────┘ | |||
</pre> | </pre> | ||
| Ligne 61 : | Ligne 54 : | ||
<br><br> | <br><br> | ||
= <span style="color:# | = <span style="color:#00695c;">2 — Création de l'Autorité de Certification (CA)</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#00695c;">Création d'une CA interne qui signera tous les certificats du VPN</b> | ||
|} | |} | ||
== <span style="color:# | == <span style="color:#00897b;">Accès au gestionnaire de certificats</span> == | ||
Naviguer vers : | Naviguer vers : | ||
<b>System → | <b>System → Certificate Authorities → Add</b> | ||
== <span style="color:#00897b;">Configuration de la CA</span> == | |||
== <span style="color:# | |||
Remplir les champs de la manière suivante : | Remplir les champs de la manière suivante : | ||
| Ligne 91 : | Ligne 75 : | ||
! Champ !! Valeur | ! Champ !! Valeur | ||
|- | |- | ||
| Method || Create an internal | | Method || Create an internal Certificate Authority | ||
|- | |- | ||
| Descriptive Name || VPN-CA | | Descriptive Name || VPN-CA | ||
|- | |- | ||
| Key | | Key Length || 2048 | ||
|- | |- | ||
| Digest Algorithm || | | Digest Algorithm || SHA256 | ||
|- | |- | ||
| Lifetime || 3650 | | Lifetime || 3650 | ||
|- | |||
| Common Name || VPN-CA | |||
|} | |} | ||
Remplir les informations d'identité | Remplir les informations d'identité : | ||
<pre> | <pre> | ||
Country Code | Country Code : FR | ||
City : Montpellier (ou au choix) | |||
</pre> | </pre> | ||
| Ligne 116 : | Ligne 100 : | ||
|} | |} | ||
Cliquer sur <b>Save</b> | Cliquer sur <b>Save</b>. | ||
<br><br> | <br><br> | ||
= <span style="color:# | = <span style="color:#00695c;">3 — Création du certificat serveur</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#00695c;">Génération du certificat d'identité du serveur OpenVPN, signé par la CA</b> | ||
|} | |} | ||
== <span style="color:# | == <span style="color:#00897b;">Accès à la section Certificates</span> == | ||
Naviguer vers : | Naviguer vers : | ||
<b>System → | <b>System → Certificates → Add / Sign</b> | ||
Add / Sign | |||
</ | |||
== <span style="color:# | == <span style="color:#00897b;">Configuration du certificat serveur</span> == | ||
Remplir les champs de la manière suivante : | Remplir les champs de la manière suivante : | ||
| Ligne 156 : | Ligne 133 : | ||
|- | |- | ||
| Type || Server Certificate | | Type || Server Certificate | ||
|} | |} | ||
| Ligne 167 : | Ligne 140 : | ||
|} | |} | ||
Cliquer sur <b>Save</b> | Cliquer sur <b>Save</b>. | ||
<br><br> | <br><br> | ||
= <span style="color:# | = <span style="color:#00695c;">4 — Création du serveur OpenVPN</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#00695c;">Configuration du serveur VPN via l'assistant intégré de pfSense</b> | ||
|} | |} | ||
== <span style="color:# | == <span style="color:#00897b;">Accès à l'assistant</span> == | ||
Naviguer vers : | Naviguer vers : | ||
| Ligne 185 : | Ligne 158 : | ||
<b>VPN → OpenVPN → Wizards</b> | <b>VPN → OpenVPN → Wizards</b> | ||
Sélectionner le backend d'authentification : | |||
<pre> | <pre> | ||
Authentication Backend : Local User Access | |||
</pre> | </pre> | ||
Puis sélectionner successivement : | |||
<pre> | <pre> | ||
OpenVPN-Server | CA : VPN-CA | ||
Certificate : OpenVPN-Server | |||
</pre> | </pre> | ||
== <span style="color:#00897b;">Configuration générale du serveur</span> == | |||
{| class="wikitable" style="width:65%;" | {| class="wikitable" style="width:65%;" | ||
| Ligne 224 : | Ligne 181 : | ||
| Protocol || UDP | | Protocol || UDP | ||
|- | |- | ||
| Interface || | | Interface || LAN (lab Proxmox) | ||
|- | |- | ||
| Port || 1194 | | Port || 1194 | ||
|} | |||
== <span style="color:#00897b;">Cryptographie</span> == | |||
{| class="wikitable" style="width:65%;" | |||
! Paramètre !! Valeur | |||
|- | |- | ||
| TLS Authentication || | | TLS Authentication || Activé | ||
|- | |- | ||
| Encryption Algorithm || AES-256-GCM | | Encryption Algorithm || AES-256-GCM | ||
| Ligne 241 : | Ligne 205 : | ||
== <span style="color:#00897b;">Configuration réseau</span> == | |||
== <span style="color:# | |||
{| class="wikitable" style="width:65%;" | {| class="wikitable" style="width:65%;" | ||
! Paramètre !! | ! Paramètre !! Valeur | ||
|- | |- | ||
| Tunnel Network || 10.8.0.0/24 | | Tunnel Network || 10.8.0.0/24 | ||
|- | |- | ||
| Local Network || 192.168. | | Local Network || 192.168.60.0/24 | ||
|- | |||
| DNS Server 1 || 192.168.60.254 | |||
|} | |} | ||
{| style="width:100%; background:#fff3e0; border:1px solid #ffb74d; padding:10px; border-radius:8px; overflow:hidden;" | {| style="width:100%; background:#fff3e0; border:1px solid #ffb74d; padding:10px; border-radius:8px; overflow:hidden;" | ||
| | | | ||
<b style="color:#e65100;">⚠ ATTENTION :</b> Le champ | <b style="color:#e65100;">⚠ ATTENTION :</b> Le champ <b>Tunnel Network</b> doit être un réseau inutilisé sur votre infrastructure. Le champ <b>Local Network</b> correspond au réseau LAN réel à exposer aux clients VPN. | ||
|} | |} | ||
Cliquer sur <b>Finish</b> pour terminer l'assistant. | Cliquer sur <b>Finish</b> pour terminer l'assistant. | ||
| Ligne 299 : | Ligne 227 : | ||
<br><br> | <br><br> | ||
= <span style="color:# | = <span style="color:#00695c;">5 — Création d'un utilisateur VPN</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#00695c;">Création d'un compte utilisateur avec son certificat client pour l'authentification VPN</b> | ||
|} | |} | ||
== <span style="color:# | == <span style="color:#00897b;">Accès au gestionnaire d'utilisateurs</span> == | ||
Naviguer vers : | Naviguer vers : | ||
<b>System → User Manager</b> | <b>System → User Manager → Add</b> | ||
== <span style="color:#00897b;">Configuration de l'utilisateur</span> == | |||
== <span style="color:# | |||
Remplir les informations du compte : | Remplir les informations du compte : | ||
{| class="wikitable" style="width: | {| class="wikitable" style="width:50%;" | ||
! Champ !! Valeur | ! Champ !! Valeur | ||
|- | |- | ||
| Username || | | Username || vpnuser | ||
|- | |- | ||
| Password || (mot de passe sécurisé) | | Password || (mot de passe sécurisé) | ||
| Ligne 341 : | Ligne 262 : | ||
<pre> | <pre> | ||
VPN-CA | CA : VPN-CA | ||
</pre> | </pre> | ||
| Ligne 349 : | Ligne 270 : | ||
|} | |} | ||
Cliquer sur <b>Save</b> | Cliquer sur <b>Save</b>. | ||
<br><br> | <br><br> | ||
= <span style="color:# | = <span style="color:#00695c;">6 — Installation du package d'export client</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#00695c;">Installation du package pfSense permettant d'exporter les configurations clients OpenVPN</b> | ||
|} | |} | ||
== <span style="color:# | == <span style="color:#00897b;">Accès au gestionnaire de paquets</span> == | ||
Naviguer vers : | Naviguer vers : | ||
| Ligne 368 : | Ligne 289 : | ||
== <span style="color:#00897b;">Installation du package</span> == | |||
== <span style="color:# | |||
Rechercher et installer le package suivant : | Rechercher et installer le package suivant : | ||
| Ligne 379 : | Ligne 299 : | ||
Cliquer sur <b>Install</b> puis confirmer. | Cliquer sur <b>Install</b> puis confirmer. | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e8f8f5; border:1px solid #a9dfbf; padding:10px; border-radius:8px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#1e8449;">ℹ INFO :</b> Ce package ajoute une interface dans pfSense permettant de générer automatiquement les fichiers de configuration pour chaque utilisateur VPN, incluant les certificats et clés embarquées. | ||
|} | |} | ||
| Ligne 387 : | Ligne 307 : | ||
<br><br> | <br><br> | ||
= <span style="color:# | = <span style="color:#00695c;">7 — Export de la configuration client</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#00695c;">Génération et téléchargement du fichier de configuration pour le client VPN</b> | ||
|} | |} | ||
== <span style="color:# | == <span style="color:#00897b;">Accès à l'export client</span> == | ||
Naviguer vers : | Naviguer vers : | ||
| Ligne 403 : | Ligne 323 : | ||
== <span style="color:#00897b;">Téléchargement de la configuration</span> == | |||
Choisir le format adapté au système du client : | |||
Choisir le format | |||
Pour <b>Windows</b> : | Pour <b>Windows</b> : | ||
| Ligne 412 : | Ligne 331 : | ||
<pre> | <pre> | ||
Windows Installer (.exe) | Windows Installer (.exe) | ||
</pre> | </pre> | ||
| Ligne 424 : | Ligne 337 : | ||
<b style="color:#e65100;">⚠ IMPORTANT :</b> Le fichier .ovpn contient les certificats, clés et paramètres de connexion. Il est confidentiel : ne pas le partager ni le stocker dans un endroit non sécurisé. | <b style="color:#e65100;">⚠ IMPORTANT :</b> Le fichier .ovpn contient les certificats, clés et paramètres de connexion. Il est confidentiel : ne pas le partager ni le stocker dans un endroit non sécurisé. | ||
|} | |} | ||
<br><br> | <br><br> | ||
= <span style="color:# | = <span style="color:#00695c;">8 — Règles de pare-feu pfSense</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#00695c;">Création des règles de pare-feu pour autoriser les clients VPN à accéder au réseau LAN</b> | ||
|} | |} | ||
== <span style="color:# | == <span style="color:#00897b;">Règle OpenVPN → LAN</span> == | ||
Naviguer vers : | Naviguer vers : | ||
| Ligne 495 : | Ligne 354 : | ||
<b>Firewall → Rules → OpenVPN</b> | <b>Firewall → Rules → OpenVPN</b> | ||
Créer | Créer la règle suivante : | ||
<pre> | <pre> | ||
| Ligne 501 : | Ligne 360 : | ||
Interface : OpenVPN | Interface : OpenVPN | ||
Protocol : any | Protocol : any | ||
Source : | Source : OpenVPN net | ||
Destination : | Destination : LAN net | ||
Description : Allow VPN clients to LAN | Description : Allow VPN clients to LAN | ||
</pre> | </pre> | ||
| Ligne 508 : | Ligne 367 : | ||
{| style="width:100%; background:#fff3e0; border:1px solid #ffb74d; padding:10px; border-radius:8px; overflow:hidden;" | {| style="width:100%; background:#fff3e0; border:1px solid #ffb74d; padding:10px; border-radius:8px; overflow:hidden;" | ||
| | | | ||
<b style="color:#e65100;">⚠ NOTE :</b> Pour un environnement de production, affiner les règles | <b style="color:#e65100;">⚠ NOTE :</b> Pour un environnement de production, affiner les règles en précisant les protocoles et ports autorisés plutôt que d'utiliser "any". | ||
|} | |} | ||
| Ligne 519 : | Ligne 378 : | ||
│ │ | │ │ | ||
│ WAN Rules : ✓ UDP 1194 → OpenVPN Server │ | │ WAN Rules : ✓ UDP 1194 → OpenVPN Server │ | ||
│ OpenVPN Rules: ✓ | │ OpenVPN Rules: ✓ OpenVPN net → LAN net (any) │ | ||
│ LAN Rules : ✓ Trafic habituel │ | │ LAN Rules : ✓ Trafic habituel │ | ||
│ │ | │ │ | ||
| Ligne 525 : | Ligne 384 : | ||
</pre> | </pre> | ||
Cliquer sur <b>Save</b> puis <b>Apply Changes</b>. | |||
<br><br> | <br><br> | ||
= <span style="color:# | = <span style="color:#00695c;">9 — Client VPN (VM Windows)</span> = | ||
{| style="width:100%; background:# | {| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | ||
| | | | ||
<b style="color:# | <b style="color:#00695c;">Installation et configuration du client OpenVPN sur la VM Windows</b> | ||
|} | |} | ||
== <span style="color:# | == <span style="color:#00897b;">Installation du client</span> == | ||
Sur la VM Windows, installer le client OpenVPN officiel puis importer le fichier exporté depuis pfSense : | |||
* <b>Clic droit</b> sur l'icône OpenVPN dans la barre des tâches | * <b>Clic droit</b> sur l'icône OpenVPN dans la barre des tâches | ||
* Sélectionner <b>Import file</b> | * Sélectionner <b>Import file</b> | ||
* Choisir le fichier <b>.ovpn</b> téléchargé | * Choisir le fichier <b>.ovpn</b> téléchargé | ||
== <span style="color:# | == <span style="color:#00897b;">Connexion au VPN</span> == | ||
* <b>Clic droit</b> sur l'icône OpenVPN dans la barre des tâches | * <b>Clic droit</b> sur l'icône OpenVPN dans la barre des tâches | ||
| Ligne 560 : | Ligne 412 : | ||
<pre> | <pre> | ||
Username : | Username : vpnuser | ||
Password : (mot de passe défini dans pfSense) | Password : (mot de passe défini dans pfSense) | ||
</pre> | </pre> | ||
| Ligne 567 : | Ligne 419 : | ||
<br><br> | |||
= <span style="color:#00695c;">10 — Tests</span> = | |||
{| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | |||
| | |||
<b style="color:#00695c;">Vérification du bon fonctionnement de la connexion OpenVPN</b> | |||
|} | |||
== <span style="color:# | == <span style="color:#00897b;">Test de connectivité</span> == | ||
Une fois connecté, vérifier l'accès au réseau interne : | Une fois connecté, vérifier l'accès au réseau interne : | ||
| Ligne 575 : | Ligne 435 : | ||
<pre> | <pre> | ||
ping 192.168. | ping 192.168.60.254 | ||
</pre> | </pre> | ||
* <b>Ping vers | * <b>Ping vers la VM cible</b> : | ||
<pre> | <pre> | ||
ping 192.168. | ping 192.168.60.33 | ||
</pre> | </pre> | ||
| Ligne 600 : | Ligne 460 : | ||
== <span style="color:#00897b;">Vérification côté pfSense</span> == | |||
== <span style="color:# | |||
Dans l'interface web pfSense, vérifier les connexions actives : | Dans l'interface web pfSense, vérifier les connexions actives : | ||
<b>Status → OpenVPN</b> | <b>Status → OpenVPN</b> | ||
<pre> | <pre> | ||
| Ligne 615 : | Ligne 470 : | ||
│ User │ Real IP │ VPN IP │ Connected │ | │ User │ Real IP │ VPN IP │ Connected │ | ||
├──────────────┼──────────────┼──────────────┼──────────────┤ | ├──────────────┼──────────────┼──────────────┼──────────────┤ | ||
│ | │ vpnuser │ X.X.X.X │ 10.8.0.2 │ 00:05:32 │ | ||
└──────────────┴──────────────┴──────────────┴──────────────┘ | └──────────────┴──────────────┴──────────────┴──────────────┘ | ||
</pre> | </pre> | ||
{| style="width:100%; background:# | |||
<br><br> | |||
= <span style="color:#004d40;">Résultat attendu</span> = | |||
{| style="width:100%; background:#e0f2f1; border:1px solid #80cbc4; padding:12px; border-radius:10px; overflow:hidden;" | |||
| | |||
<b style="color:#004d40;">Récapitulatif des indicateurs de succès</b> | |||
|} | |||
* ✓ <b>VPN connecté</b> — icône verte dans le client OpenVPN | |||
* ✓ <b>IP tunnel attribuée</b> — adresse en 10.8.0.x visible dans ipconfig | |||
* ✓ <b>Accès au réseau 192.168.60.0/24</b> — ping vers pfSense et VMs opérationnel | |||
* ✓ <b>Accès aux machines internes</b> — communication établie avec 192.168.60.33 | |||
<br><br> | |||
= <span style="color:#004d40;">Conclusion</span> = | |||
{| style="width:100%; background:#b2dfdb; border:1px solid #4db6ac; padding:15px; border-radius:10px; overflow:hidden;" | |||
| | | | ||
< | <span style="font-size:115%; color:#004d40;"> | ||
Mise en place d'un <b>VPN Remote Access SSL/TLS</b> sur pfSense permettant un accès sécurisé au réseau interne via authentification utilisateur et certificat. <br><br> | |||
Le tunnel chiffré <b>AES-256-GCM</b> garantit la confidentialité des échanges, tandis que l'authentification par certificat assure l'identité des clients connectés. | |||
</span> | |||
|} | |} | ||
<br><br> | <br><br> | ||
Dernière version du 20 avril 2026 à 22:34
Installation et Configuration OpenVPN sur pfSense (Remote Access)
1 — Préparation du réseau
Adressage réseau
| Élément | Adresse |
|---|---|
| pfSense LAN | 192.168.60.254 |
| Réseau LAN | 192.168.60.0/24 |
| VM cible | 192.168.60.33 |
Schéma de l'architecture :
Internet
│
┌────────────┴────────────┐
│ │
┌─────────────────┐ ┌─────────────────────┐
│ Client VPN │ │ pfSense │
│ (PC distant) │ ════► │ OpenVPN Remote │
│ .ovpn importé │ │ Access Port 1194 │
└─────────────────┘ └──────────┬──────────┘
│
┌──────────┴──────────┐
│ LAN 192.168.60.x │
│ VM : 192.168.60.33 │
└─────────────────────┘
2 — Création de l'Autorité de Certification (CA)
Accès au gestionnaire de certificats
Naviguer vers :
System → Certificate Authorities → Add
Configuration de la CA
Remplir les champs de la manière suivante :
| Champ | Valeur |
|---|---|
| Method | Create an internal Certificate Authority |
| Descriptive Name | VPN-CA |
| Key Length | 2048 |
| Digest Algorithm | SHA256 |
| Lifetime | 3650 |
| Common Name | VPN-CA |
Remplir les informations d'identité :
Country Code : FR City : Montpellier (ou au choix)
Cliquer sur Save.
3 — Création du certificat serveur
Accès à la section Certificates
Naviguer vers :
System → Certificates → Add / Sign
Configuration du certificat serveur
Remplir les champs de la manière suivante :
| Champ | Valeur |
|---|---|
| Method | Create internal certificate |
| Descriptive Name | OpenVPN-Server |
| Certificate Authority | VPN-CA |
| Type | Server Certificate |
Cliquer sur Save.
4 — Création du serveur OpenVPN
Accès à l'assistant
Naviguer vers :
VPN → OpenVPN → Wizards
Sélectionner le backend d'authentification :
Authentication Backend : Local User Access
Puis sélectionner successivement :
CA : VPN-CA Certificate : OpenVPN-Server
Configuration générale du serveur
| Paramètre | Valeur |
|---|---|
| Server Mode | Remote Access (SSL/TLS) |
| Protocol | UDP |
| Interface | LAN (lab Proxmox) |
| Port | 1194 |
Cryptographie
| Paramètre | Valeur |
|---|---|
| TLS Authentication | Activé |
| Encryption Algorithm | AES-256-GCM |
| Auth Digest Algorithm | SHA256 |
Configuration réseau
| Paramètre | Valeur |
|---|---|
| Tunnel Network | 10.8.0.0/24 |
| Local Network | 192.168.60.0/24 |
| DNS Server 1 | 192.168.60.254 |
Cliquer sur Finish pour terminer l'assistant.
5 — Création d'un utilisateur VPN
Accès au gestionnaire d'utilisateurs
Naviguer vers :
System → User Manager → Add
Configuration de l'utilisateur
Remplir les informations du compte :
| Champ | Valeur |
|---|---|
| Username | vpnuser |
| Password | (mot de passe sécurisé) |
Cocher l'option :
Click to create a user certificate
Dans le menu déroulant qui apparaît, sélectionner :
CA : VPN-CA
Cliquer sur Save.
6 — Installation du package d'export client
Accès au gestionnaire de paquets
Naviguer vers :
System → Package Manager → Available Packages
Installation du package
Rechercher et installer le package suivant :
openvpn-client-export
Cliquer sur Install puis confirmer.
7 — Export de la configuration client
Accès à l'export client
Naviguer vers :
VPN → OpenVPN → Client Export
La liste des utilisateurs configurés apparaît.
Téléchargement de la configuration
Choisir le format adapté au système du client :
Pour Windows :
Windows Installer (.exe)
8 — Règles de pare-feu pfSense
Règle OpenVPN → LAN
Naviguer vers :
Firewall → Rules → OpenVPN
Créer la règle suivante :
Action : Pass Interface : OpenVPN Protocol : any Source : OpenVPN net Destination : LAN net Description : Allow VPN clients to LAN
Schéma du flux réseau VPN :
┌──────────────────────────────────────────────────────────────┐ │ pfSense Firewall │ ├──────────────────────────────────────────────────────────────┤ │ │ │ WAN Rules : ✓ UDP 1194 → OpenVPN Server │ │ OpenVPN Rules: ✓ OpenVPN net → LAN net (any) │ │ LAN Rules : ✓ Trafic habituel │ │ │ └──────────────────────────────────────────────────────────────┘
Cliquer sur Save puis Apply Changes.
9 — Client VPN (VM Windows)
Installation du client
Sur la VM Windows, installer le client OpenVPN officiel puis importer le fichier exporté depuis pfSense :
- Clic droit sur l'icône OpenVPN dans la barre des tâches
- Sélectionner Import file
- Choisir le fichier .ovpn téléchargé
Connexion au VPN
- Clic droit sur l'icône OpenVPN dans la barre des tâches
- Sélectionner Connect
- Saisir les identifiants du compte créé :
Username : vpnuser Password : (mot de passe défini dans pfSense)
L'icône doit passer au vert indiquant une connexion établie.
10 — Tests
Test de connectivité
Une fois connecté, vérifier l'accès au réseau interne :
- Ping vers pfSense (passerelle LAN) :
ping 192.168.60.254
- Ping vers la VM cible :
ping 192.168.60.33
- Vérification de l'adresse IP VPN attribuée (doit être dans le tunnel 10.8.0.0/24) :
ipconfig
Résultat attendu :
Carte Ethernet OpenVPN : Adresse IPv4. . . . . . . : 10.8.0.x Masque de sous-réseau . . : 255.255.255.0 Passerelle par défaut . . : 10.8.0.1
Vérification côté pfSense
Dans l'interface web pfSense, vérifier les connexions actives :
Status → OpenVPN
┌──────────────┬──────────────┬──────────────┬──────────────┐ │ User │ Real IP │ VPN IP │ Connected │ ├──────────────┼──────────────┼──────────────┼──────────────┤ │ vpnuser │ X.X.X.X │ 10.8.0.2 │ 00:05:32 │ └──────────────┴──────────────┴──────────────┴──────────────┘
Résultat attendu
- ✓ VPN connecté — icône verte dans le client OpenVPN
- ✓ IP tunnel attribuée — adresse en 10.8.0.x visible dans ipconfig
- ✓ Accès au réseau 192.168.60.0/24 — ping vers pfSense et VMs opérationnel
- ✓ Accès aux machines internes — communication établie avec 192.168.60.33
Conclusion