informatique:linux:openvpn
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| informatique:linux:openvpn [2020/05/29 10:43] – [Configuration] benoit | informatique:linux:openvpn [2020/05/29 13:24] (Version actuelle) – [Configuration] benoit | ||
|---|---|---|---|
| Ligne 7: | Ligne 7: | ||
| apt install openvpn openssl easy-rsa | apt install openvpn openssl easy-rsa | ||
| - | ==== Configuration | + | |
| + | |||
| + | |||
| + | ==== Initialisation des certificats | ||
| Copie des utilitaires de certificat RSA: | Copie des utilitaires de certificat RSA: | ||
| Ligne 28: | Ligne 31: | ||
| export KEY_OU=" | export KEY_OU=" | ||
| + | Copier le fichier de conf openssl: | ||
| + | cp openssl-1.0.0.cnf openssl.cnf | ||
| + | |||
| + | Charger les variables: | ||
| + | . ./vars | ||
| + | |||
| + | Message attendu: | ||
| + | NOTE: If you run ./ | ||
| + | |||
| + | Nettoyage de l' | ||
| + | ./clean-all | ||
| + | |||
| + | Création du certificat : | ||
| + | |||
| + | ./build-ca | ||
| + | | ||
| + | Resultat et réponses à donner: | ||
| + | |||
| + | Generating a RSA private key | ||
| + | .................+++++ | ||
| + | ..............+++++ | ||
| + | writing new private key to ' | ||
| + | ----- | ||
| + | You are about to be asked to enter information that will be incorporated | ||
| + | into your certificate request. | ||
| + | What you are about to enter is what is called a Distinguished Name or a DN. | ||
| + | There are quite a few fields but you can leave some blank | ||
| + | For some fields there will be a default value, | ||
| + | If you enter ' | ||
| + | ----- | ||
| + | Country Name (2 letter code) [US]: | ||
| + | State or Province Name (full name) [CA]: | ||
| + | Locality Name (eg, city) [SanFrancisco]: | ||
| + | Organization Name (eg, company) [myhost.mydomain]: | ||
| + | Organizational Unit Name (eg, section) [MyOrganizationalUnit]: | ||
| + | Common Name (eg, your name or your server' | ||
| + | Name [EasyRSA]: | ||
| + | Email Address [me@myhost.mydomain]: | ||
| + | | ||
| + | Générer la clé serveur: | ||
| + | |||
| + | ./ | ||
| + | |||
| + | :!: mêmez réponses à donner que plus haut avec quelques éléments supplémentaires: | ||
| + | |||
| + | Please enter the following ' | ||
| + | to be sent with your certificate request | ||
| + | A challenge password []: | ||
| + | An optional company name []: | ||
| + | | ||
| + | ... | ||
| + | | ||
| + | Certificate is to be certified until May 27 10:52:54 2030 GMT (3650 days) | ||
| + | Sign the certificate? | ||
| + | | ||
| + | | ||
| + | 1 out of 1 certificate requests certified, commit? [y/n]y | ||
| + | Write out database with 1 new entries | ||
| + | Data Base Updated | ||
| + | |||
| + | Générer la clé client: | ||
| + | |||
| + | ./build-key client1 | ||
| + | |||
| + | Générer les paramètres Diffie-Hellman : | ||
| + | |||
| + | ./build-dh | ||
| + | |||
| + | |||
| + | ln -s / | ||
| + | |||
| + | ==== Configuration ==== | ||
| + | |||
| + | Créer et éditer le fichier de configuration du serveur: | ||
| + | |||
| + | vim / | ||
| + | |||
| + | Insérer le contenu suivant: | ||
| + | # OpenVPN listen port | ||
| + | port 444 | ||
| + | # Protocol | ||
| + | proto tcp | ||
| + | # Interface | ||
| + | dev tun | ||
| + | | ||
| + | # Path to certificates | ||
| + | ca server/ | ||
| + | cert server/ | ||
| + | key server/ | ||
| + | dh server/ | ||
| + | | ||
| + | # VPN network | ||
| + | server 10.8.0.0 255.255.255.0 | ||
| + | | ||
| + | # Other settings | ||
| + | ifconfig-pool-persist ipp.txt | ||
| + | keepalive 10 120 | ||
| + | comp-lzo | ||
| + | user nobody | ||
| + | group nogroup | ||
| + | persist-key | ||
| + | persist-tun | ||
| + | status openvpn-status.log | ||
| + | verb 3 | ||
| + | | ||
| + | # On définit le serveur VPN comme passerelle par défaut pour les clients. | ||
| + | push " | ||
| + | push "route 10.9.8.0 255.255.252.0" | ||
| + | | ||
| + | # Default DNS for VPN clients | ||
| + | push " | ||
| + | |||
| + | Tester la conf du serveur VPN voir si ça démarre : | ||
| + | |||
| + | cd / | ||
| + | openvpn server.conf | ||
| - | ln -s easy-rsa/ | ||
informatique/linux/openvpn.1590749027.txt.gz · Dernière modification : de benoit
