Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 11/10/2009, à 20:21

Xqua

[RESOLU] Probleme lors de la connexion Client Serveur OpenVPN

Bonjour,

j'essais depuis 48h maintenant d'obtenir un reseau VPN entre mes machines.

J'ai un serveur sous ubuntu 9.04, dessus j'ai mis OpenVPN en suivant le tutoriel du site.

je copie tout les certif creer precedement dans /etc/openvpn/

server.conf (sans les commentaire c'est plus claire pour vous je pense, sinon je vous l'envoi en entier)

;local a.b.c.d

port 1194

;proto tcp
proto udp

;dev tap
dev tun;dev-node MyTap

ca ca.crt
cert server.crt
key server.key  

dh dh1024.pem

server 10.8.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100

;server-bridge

push "route 192.168.0.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"

;client-config-dir ccd
;route 192.168.40.128 255.255.255.248

;client-config-dir ccd
;route 10.9.0.0 255.255.255.252

;learn-address ./script

;push "redirect-gateway def1 bypass-dhcp"

;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"

;client-to-client

;duplicate-cn

keepalive 10 120

tls-auth ta.key 0   #j'ai tester avec ou sans l'option ta idem

;cipher BF-CBC        
;cipher AES-128-CBC   
;cipher DES-EDE3-CBC  

comp-lzo

max-clients 5

;user nobody
;group nogroup

persist-key
persist-tun

status openvpn-status.log

;log         openvpn.log
;log-append  openvpn.log

verb 3

;mute 20

mon serveur demare correctement :

Sun Oct 11 20:02:13 2009 OpenVPN 2.1_rc11 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Mar  9 2009
Sun Oct 11 20:02:13 2009 MANAGEMENT: TCP Socket listening on 127.0.1.1:1999
Sun Oct 11 20:02:13 2009 NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x.  Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
Sun Oct 11 20:02:13 2009 Diffie-Hellman initialized with 1024 bit key
Sun Oct 11 20:02:13 2009 /usr/bin/openssl-vulnkey -q -b 1024 -m <modulus omitted>
Sun Oct 11 20:02:14 2009 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Sun Oct 11 20:02:14 2009 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Oct 11 20:02:14 2009 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Oct 11 20:02:14 2009 TLS-Auth MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Sun Oct 11 20:02:14 2009 ROUTE default_gateway=192.168.0.254
Sun Oct 11 20:02:14 2009 TUN/TAP device tun0 opened
Sun Oct 11 20:02:14 2009 TUN/TAP TX queue length set to 100
Sun Oct 11 20:02:14 2009 /sbin/ifconfig tun0 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
Sun Oct 11 20:02:14 2009 /sbin/route add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2
Sun Oct 11 20:02:14 2009 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Oct 11 20:02:14 2009 Socket Buffers: R=[112640->131072] S=[112640->131072]
Sun Oct 11 20:02:14 2009 UDPv4 link local (bound): [undef]:1194
Sun Oct 11 20:02:14 2009 UDPv4 link remote: [undef]
Sun Oct 11 20:02:14 2009 MULTI: multi_init called, r=256 v=256
Sun Oct 11 20:02:14 2009 IFCONFIG POOL: base=10.8.0.4 size=62
Sun Oct 11 20:02:14 2009 IFCONFIG POOL LIST
Sun Oct 11 20:02:14 2009 Initialization Sequence Completed

Ensuite j'installe mon client sur 2 machine une windows et une linux ubuntu 9.04, openVPN sur les deux.

je copie bien mes certificats client1.crt, client1.key, ca.crt, ca.key, le fichier ta.key, je parametre mon client.conf :

client

;dev tap
dev tun

;dev-node MyTap

;proto tcp
proto udp

remote 192.168.0.11 1194
;remote my-server-2 1194

;remote-random

resolv-retry infinite

nobind

;user nobody
;group nogroup

persist-key
persist-tun

;http-proxy-retry 
;http-proxy [proxy server] [proxy port #]

;mute-replay-warnings

ca ca.crt
cert xqua.crt
key xqua.key

;ns-cert-type server

tls-auth ta.key 1  # j'ai tester avec ou sans l'option ta idem

;cipher x

comp-lzo

verb 3

;mute 20

je lance ensuite mon client : cd /etc/openvpn/ && openvpn client1.conf

et la j'ai sur mon client :

Sun Oct 11 20:02:19 2009 OpenVPN 2.0.9 Win32-MinGW [SSL] [LZO] built on Oct  1 2006
Sun Oct 11 20:02:19 2009 IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA.  OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Sun Oct 11 20:02:19 2009 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Sun Oct 11 20:02:19 2009 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Sun Oct 11 20:02:19 2009 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Oct 11 20:02:19 2009 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Oct 11 20:02:19 2009 LZO compression initialized
Sun Oct 11 20:02:19 2009 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Sun Oct 11 20:02:19 2009 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Oct 11 20:02:19 2009 Local Options hash (VER=V4): '504e774e'
Sun Oct 11 20:02:19 2009 Expected Remote Options hash (VER=V4): '14168603'
Sun Oct 11 20:02:19 2009 UDPv4 link local: [undef]
Sun Oct 11 20:02:19 2009 UDPv4 link remote: 192.168.0.11:1194
Sun Oct 11 20:02:19 2009 TLS: Initial packet from 192.168.0.11:1194, sid=017f1d5f c7570a89
Sun Oct 11 20:02:19 2009 VERIFY OK: depth=1, /C=FR/ST=Ile_De_France/L=Paris/O=Xqua.org/CN=Xqua.org/emailAddress=xqua@free.fr
Sun Oct 11 20:02:19 2009 VERIFY OK: depth=0, /C=FR/ST=Ile_De_France/L=Paris/O=Xqua.org/CN=server/emailAddress=xqua@free.fr

et sur mon serveur :

Sun Oct 11 20:02:17 2009 MULTI: multi_create_instance called
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 Re-using SSL/TLS context
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 LZO compression initialized
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 Local Options hash (VER=V4): '14168603'
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 Expected Remote Options hash (VER=V4): '504e774e'
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 TLS: Initial packet from 192.168.0.10:4659, sid=7719b255 2909fe43
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 VERIFY ERROR: depth=0, error=unable to get local issuer certificate: /C=FR/ST=Ile_De_France/L=Paris/O=In_The_Moon/CN=xqua/emailAddress=xqua@free.fr
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 TLS_ERROR: BIO read tls_read_plaintext error: error:140890B2:SSL routines:SSL3_GET_CLIENT_CERTIFICATE:no certificate returned
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 TLS Error: TLS object -> incoming plaintext read error
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 TLS Error: TLS handshake failed
Sun Oct 11 20:02:17 2009 192.168.0.10:4659 SIGUSR1[soft,tls-error] received, client-instance restarting

je comprend pas ... j'ai refais tout les certificats, suivi a la lettre ce qu'il disait de faire ... j'ai bien compris que l'erreur etait que mon client n'est pas "connu" du serveur ... mais je comprend pas pourquoi ...

une idée ?

Merci

Dernière modification par Xqua (Le 14/10/2009, à 23:06)


pyAlienFX a python driver for the Alienware AlienFX : https://code.google.com/p/pyalienfx

Hors ligne

#2 Le 12/10/2009, à 17:44

Xqua

Re : [RESOLU] Probleme lors de la connexion Client Serveur OpenVPN

personne n'a une idée ?

j'ai encore refait tout les certificat sa ne marche pas ...


pyAlienFX a python driver for the Alienware AlienFX : https://code.google.com/p/pyalienfx

Hors ligne

#3 Le 12/10/2009, à 20:49

droopy191

Re : [RESOLU] Probleme lors de la connexion Client Serveur OpenVPN

Salut,

le ca.key n'a rien à faire sur le client ou le serveur.
ns-cert-type server doit etre actif sur le client en principe

Hors ligne

#4 Le 14/10/2009, à 19:38

Xqua

Re : [RESOLU] Probleme lors de la connexion Client Serveur OpenVPN

bonjour,

pour le ca.key je sais que ce n'est pas necessaire, mais dans le desespoir ... ^^

pour le ns-cert-type, j'ai tester avec ou sans ... mais je vais reessayer ... on sais jammais ...

merci je te tien au courant

Edit : Idem ...

coté serveur

Wed Oct 14 19:40:28 2009 192.168.0.10:1312 Re-using SSL/TLS context
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 LZO compression initialized
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 Local Options hash (VER=V4): '14168603'
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 Expected Remote Options hash (VER=V4): '504e774e'
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 TLS: Initial packet from 192.168.0.10:1312, sid=9790e3f5 0f630812
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 VERIFY ERROR: depth=0, error=unable to get local issuer certificate: /C=FR/ST=Ile_De_France/L=Paris/O=In_The_Moon/CN=xqua/emailAddress=xqua@free.fr
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 TLS_ERROR: BIO read tls_read_plaintext error: error:140890B2:SSL routines:SSL3_GET_CLIENT_CERTIFICATE:no certificate returned
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 TLS Error: TLS object -> incoming plaintext read error
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 TLS Error: TLS handshake failed
Wed Oct 14 19:40:28 2009 192.168.0.10:1312 SIGUSR1[soft,tls-error] received, client-instance restarting

coté client  :

Wed Oct 14 19:40:34 2009 OpenVPN 2.0.9 Win32-MinGW [SSL] [LZO] built on Oct  1 2006
Wed Oct 14 19:40:34 2009 IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA.  OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Wed Oct 14 19:40:34 2009 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Wed Oct 14 19:40:34 2009 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Oct 14 19:40:34 2009 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Oct 14 19:40:34 2009 LZO compression initialized
Wed Oct 14 19:40:34 2009 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Oct 14 19:40:34 2009 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Oct 14 19:40:34 2009 Local Options hash (VER=V4): '504e774e'
Wed Oct 14 19:40:34 2009 Expected Remote Options hash (VER=V4): '14168603'
Wed Oct 14 19:40:34 2009 UDPv4 link local: [undef]
Wed Oct 14 19:40:34 2009 UDPv4 link remote: 192.168.0.11:1194
Wed Oct 14 19:40:34 2009 TLS: Initial packet from 192.168.0.11:1194, sid=14ce6d58 a60554a9
Wed Oct 14 19:40:34 2009 VERIFY OK: depth=1, /C=FR/ST=Ile_De_France/L=Paris/O=Xqua.org/CN=Xqua.org/emailAddress=xqua@free.fr
Wed Oct 14 19:40:34 2009 VERIFY OK: nsCertType=SERVER
Wed Oct 14 19:40:34 2009 VERIFY OK: depth=0, /C=FR/ST=Ile_De_France/L=Paris/O=Xqua.org/CN=server/emailAddress=xqua@free.fr

Je precise que j'ai bien creer le cert du server avec la command build-key-server ...

Dernière modification par Xqua (Le 14/10/2009, à 19:42)


pyAlienFX a python driver for the Alienware AlienFX : https://code.google.com/p/pyalienfx

Hors ligne

#5 Le 14/10/2009, à 20:37

droopy191

Re : [RESOLU] Probleme lors de la connexion Client Serveur OpenVPN

Je suis pas un spécialiste du chiffrement wink
Une autre piste, vous noterez qu'il y a 2 organisations différentes entre client et serveur

/C=FR/ST=Ile_De_France/L=Paris/O=Xqua.org/CN=Xqua.org/emailAddress=xqua@free.fr
/C=FR/ST=Ile_De_France/L=Paris/O=In_The_Moon/CN=xqua/emailAddress=xqua@free.fr

Avez vous signez les clés clients et serveurs avec la meme clé ( ca.key ) ?
les ca.crt sont ils identiques sur les 2 machines ?
Il faut générer toutes les clés sur la meme machine ( c'est plus simple ).

Hors ligne

#6 Le 14/10/2009, à 22:54

Xqua

Re : [RESOLU] Probleme lors de la connexion Client Serveur OpenVPN

ahh bien vue je vai voir sa ^^


pyAlienFX a python driver for the Alienware AlienFX : https://code.google.com/p/pyalienfx

Hors ligne

#7 Le 14/10/2009, à 23:05

Xqua

Re : [RESOLU] Probleme lors de la connexion Client Serveur OpenVPN

you are a fucking genius !! big_smile:D:D:D

thank guy !!

it's work !!


pyAlienFX a python driver for the Alienware AlienFX : https://code.google.com/p/pyalienfx

Hors ligne

#8 Le 16/10/2009, à 01:17

newsdas

Re : [RESOLU] Probleme lors de la connexion Client Serveur OpenVPN

Salut à tous!

    j'ai pu résoudre mon pb mais pas totalement, lorsque je me connectais la connexion s'établissait mais se déconnectait 3 minutes après, alors jè refais toutes les config à partir de Webmin mais j'ai un message qui me demande de cacher les fichiers .key( ta.key, ca.key, nom_serveur.key ) afin qu'ils ne soient plus accessibles par tout le monde. Je me demande bien où je dois les placer et comment je dois les restreindre aux autres?

Hors ligne

#9 Le 16/10/2009, à 09:41

Xqua

Re : [RESOLU] Probleme lors de la connexion Client Serveur OpenVPN

tu dois les placer dans /etc/openvpn/ mais tu dois faire dessus :
sudo chmod 700 ta.key ect


pyAlienFX a python driver for the Alienware AlienFX : https://code.google.com/p/pyalienfx

Hors ligne