TUXANANTES
Formations
+ Initiation
+ Internet et Messagerie
+ Linux
+ Reseau
+ Windows XP
Articles techniques

OpenVpn : une configuration qui fonctionne

Cette article ne se veut pas un HowTo ou un didacticiel , juste la mise à disposition des fichiers de configuration !

L'installation d'openvpn a été réalisé sur une Debian à partir des sources ( ./configure , make , make install ...)

Une vue sur l'arborescence de la configuration coté serveur

# ls -R /usr/local/openvpn
/usr/local/openvpn:
etc log

/usr/local/openvpn/etc:
ca.crt dh1024.pem openvpn.conf openvpn-status.log server.csr status.log
ca.key ipp.txt openvpn.log server.crt server.key

/usr/local/openvpn/log:
openvpn.log openvpn-status.log

Le fichier /usr/local/openvpn/etc/openvpn.conf :
port 1194
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh1024.pem
server 10.8.0.0 255.255.255.0
keepalive 10 120
persist-key
persist-tun
status /usr/local/openvpn/log/openvpn-status.log
log-append /usr/local/openvpn/log/openvpn.log
verb 1
comp-lzo

Le fichier de configuration coté Windows :
client
dev tun
proto tcp
remote 91.121.57.160 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
ns-cert-type server
verb 1


Le script permettant de gérer le service openvpn : ( # cat /etc/init.d/openvpn )

#!/bin/bash
DAEMON=/usr/local/sbin/openvpn
CONF=/usr/local/openvpn/etc/openvpn.conf
CONFIG_DIR=/usr/local/openvpn/etc
DAEMONARG="--daemon openvpn"
PIDFILE=/var/run/openvpn.pid
test -x $­­­­DAEMON || exit 0
test -d $­­­­CONFIG_DIR || exit 0
case "$­­­­1" in
start)
echo -n "Starting openvpn : "
$­­­­DAEMON --writepid $­­­­PIDFILE --config $­­­­CONF $­­­­DAEMONARG --cd $­­­­CONFIG_DIR --chroot /usr/local/openvpn
echo "Done." ;;
stop)
echo -n "Stopping openvpn : "
PID=`cat $­­­­PIDFILE`
kill $­­­­PID
rm $­­­­PIDFILE
echo "Done." ;;
restart) echo "Restarting openvpn : "
echo ""
sh $­­­­0 stop
sh $­­­­0 start
echo ""
echo "Openvpn has restarted." ;;
*) echo "Usage: $­­­­0 {start|stop|restart}" >&2
exit 1 ;;
esac
exit 0

Les commandes :
Dans cette configuration , l'installation des sources a été effectué dans le répertoire /install

cd /install/openvpn-2.0.9/easy-rsa/

Modification des dernières lignes du fichier : vars

export KEY_COUNTRY=fr
export KEY_PROVINCE=drome
export KEY_CITY=valence
export KEY_ORG=boiteinformatique
export KEY_EMAIL=xxxxxxxxx@xxx.com

Initialisation des variables définies dans le shell courant :
. ./vars

Nettoyage de toutes les clés et certificats existants :
./clean-all

Les fichiers qui vont être générés par les étapes suivantes sont créés dans le répertoire :
/install/openvpn-2.0.9/easy-rsa/keys

Création du certificat de l’Autorité de Certification :
./build-ca
Génération d'un certificat et une clé privée pour le serveur :
./buid-key-server server
( Quand le Common Name est demandé, il faut entrer « server » comme le dernier paramètre entré dans la commande précédente )

Génération des certificats et des clés pour un client :
./build-key client1

Les paramètres Diffie Hellman doivent être générés pour le serveur OpenVPN :
./build-dh


Les fichiers clés

Nom de fichier Utile à Utilité Secret
ca.crt Serveur et tous les clients Certificat racine AC NON
ca.key Clé signant la machine seulement Clé racine CA OUI
dh{n}.pem Serveur seulement Paramètres Diffie Hellman NON
server.crt Serveur seulement Certificat serveur NON
server.key Serveur seulement Clé serveur OUI
client1.crt Client1 seulement Certificat Client1 NON
client1.key Client1 seulement Clé Client1 OUI
client2.crt Client2 seulement Certificat Client2 NON
client2.key Client2 seulement Clé Client2 OUI

L’étape finale dans ce processus de génération de clés est de copier tous les fichiers sur la machine qui en a besoin, en prenant soin de les copier à l'aide d'un media sûr.



Date de création : 11/04/2008 @ 20:18
Dernière modification : 11/04/2008 @ 22:24
Catégorie :
Page lue 5847 fois


Prévisualiser la page Prévisualiser la page     Imprimer la page Imprimer la page

Réactions à cet article


Réaction n°4 

par linSheilagg le 06/08/2012 @ 03:45

Exquisite process with the fine fabric brings the best The North Face Jackets. Careful detail design on the North Face products let The North Face Outlet become the best wardrobe in the world.


Réaction n°3 

par guanyuyu le 07/07/2012 @ 02:49

The Christian Louboutin UK with surface area texture carries a gentle really feel on-­e you touch. Designer Christian Louboutin Outlet UK is famous and admirable due to Louboutin UK stylish designs, stylish look and impressive quality. Christian Louboutin Sale UK offer all the Louboutin have been worked by a craftsman and finished by hand.


Réaction n°2 

par guanyuyu le 07/07/2012 @ 02:41

This kind of Sac Longchamp really worth of our love. Simple style but also have brilliance. Sac Hobo Longchamp with simple style reveal fashion, see it at first sight, you will love this Longchamp. If you are willing to carry Sac à Main Longchamp, I believe that you will draw people's eyes without doubt, Longchamp Pas Cher will be your best choice!


Réaction n°1 

par Casqu le 04/08/2011 @ 05:39

Casque beats by dr dre Casque beats by dre écouteurs beats by dre Casque beats Casque dr dre beats Casque beats studio Casque écouteurs beats solo Casque écouteurs beats pro Casque Beats By dre Nouveau Style Casque dr dre Beats Casque Beats By dre En France monster Beats édition limitée Casque beats by dre studio Noir/Jaune casque beats by dre studio Noir/Jaune casque beats studio Noir/Jaune Beats Studio Noir/Jaune casque Beats by Dre Studio Lamborghini casque Beats Studio Lamborghini Beats Studio Lamborghini Dr.Dre Studio casque Lamborghini édition Beats by Dre Studio James 23 Beats studio James 23 édition casque Beats by Dre Studio James 23 Dre Studio LeBron James casque beats Studio James édition casque beats studio Diamant Rouge casque beats by dre studio Diamant casque beats studio édition limitée dr dre beats studio Diamant Rouge beats by dre pro casque dr dre beats pro casque beats by dre pro beats pro casque monster beats pro Beats by Dre Pro Detox
DébutPrécédent [ 1 2 3 4 5 6 7 ] SuivantFin

Calendrier

Recherche




Spécial !
www.portail44.org

L'ouvre-Boites 44.jpg
^ Haut ^


Promouvoir et soutenir le logiciel libre


GuppY - http://www.freeguppy.org/    Site créé avec GuppY v4.5.16 © 2004-2005 - Licence Libre CeCILL   GuppY - http://www.freeguppy.org/

Document généré en 0.32 seconde