Bonjour,
Je met actuellement en place un Open Vpn mode routeur entre 2 sites. Le serveur OpenVPN est sur un poste xp et le client auquel j'accède en SSH est un 2003 serveur (idiot mais c'est juste un test ).
Schéma:
| 192.168.250.0 /24| ==| 192.168.250.15 |==| Routeur |== Tunnel VPN ==| Routeur |==| 192.168.1.100 |==| 192.168.1.0 /24 |
10.24.0.1 10.24.0.6
Mon problème: - depuis le client, je ping le serveur sur l'interface 10.24.0.1, 192.168.250.15 et par son nom netbios (tout va bien)
- depuis le serveur je ne ping mon client que par son adresse virtuelle 10.24.0.6, sur son adresse réelle le ping échoue.
voici mon fichier de config serveur:
local 192.168.250.15
port 1194
proto udp
dev tun
mode server
tls-server
tun-mtu 1500
mssfix
;dev-node MyTap
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh1024.pem
server 10.24.0.0 255.255.255.0
push "route 10.24.0.0 255.255.255.0"
route 192.168.250.0 255.255.255.0
route 192.168.1.0.255.255.255.0
push "route 192.168.250.0 255.255.255.0"
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1"
push "dhcp-option DNS 192.168.250.10"
client-to-client
;duplicate-cn
keepalive 10 120
tls-auth ta.key 0 # This file is secret
;replay-persist tls-auth.log
cipher BF-CBC # Blowfish (default)
comp-lzo
max-clients 10
persist-key
persist-tun
status openvpn-status.log
verb 5
;mute 20
Voici mon fichier de config client:
client
dev tun
;dev-node MyTap
proto udp
remote IP_Publique_Serveur **** # port publique redirigé sur le 1194 en local
;remote my-server-2 1194
;remote-random
nobind
tls-client
persist-key
persist-tun
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
;mute-replay-warnings
ca ca.crt
cert client1.crt
key client1.key
ns-cert-type server
tls-auth ta.key 1
cipher BF-CBC
comp-lzo
verb 5
;mute 20
Les log du serveur
Thu Feb 04 14:12:17 2010 us=686931 OpenVPN 2.0.7 Win32-MinGW [SSL] [LZO] built on Apr 12 2006
Thu Feb 04 14:12:17 2010 us=860661 Diffie-Hellman initialized with 1024 bit key
Thu Feb 04 14:12:17 2010 us=925845 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Thu Feb 04 14:12:17 2010 us=925953 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Feb 04 14:12:17 2010 us=925977 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Feb 04 14:12:17 2010 us=926018 TLS-Auth MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Thu Feb 04 14:12:17 2010 us=969341 TAP-WIN32 device [Connexion au réseau local 3] opened: \\.\Global\{4B97F23E-B48D-4F8B-AD56-1A95B830AF31}.tap
Thu Feb 04 14:12:17 2010 us=971889 TAP-Win32 Driver Version 8.1
Thu Feb 04 14:12:17 2010 us=974177 TAP-Win32 MTU=1500
Thu Feb 04 14:12:17 2010 us=976476 Notified TAP-Win32 driver to set a DHCP IP/netmask of 10.24.0.1/255.255.255.252 on interface {4B97F23E-B48D-4F8B-AD56-1A95B830AF31} [DHCP-serv: 10.24.0.2, lease-time: 31536000]
Thu Feb 04 14:12:17 2010 us=978961 Sleeping for 10 seconds...
Thu Feb 04 14:12:27 2010 us=981110 NOTE: FlushIpNetTable failed on interface [65540] {4B97F23E-B48D-4F8B-AD56-1A95B830AF31} (status=259) : Aucune donnée n'est disponible.
Thu Feb 04 14:12:27 2010 us=985338 route ADD 192.168.250.0 MASK 255.255.255.0 10.24.0.2
Thu Feb 04 14:12:27 2010 us=990218 Route addition via IPAPI succeeded
Thu Feb 04 14:12:27 2010 us=990277 route ADD 192.168.1.0 MASK 255.255.255.255 10.24.0.2
Thu Feb 04 14:12:27 2010 us=997412 Route addition via IPAPI succeeded
Thu Feb 04 14:12:27 2010 us=997473 route ADD 10.24.0.0 MASK 255.255.255.0 10.24.0.2
Thu Feb 04 14:12:28 2010 us=4485 Route addition via IPAPI succeeded
Thu Feb 04 14:12:28 2010 us=4560 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Thu Feb 04 14:12:28 2010 us=4645 Socket Buffers: R=[8192->8192] S=[8192->8192]
Thu Feb 04 14:12:28 2010 us=7357 UDPv4 link local (bound): [undef]:1194
Thu Feb 04 14:12:28 2010 us=7401 UDPv4 link remote: [undef]
Thu Feb 04 14:12:28 2010 us=7418 MULTI: multi_init called, r=256 v=256
Thu Feb 04 14:12:28 2010 us=7519 IFCONFIG POOL: base=10.24.0.4 size=62
Thu Feb 04 14:12:28 2010 us=7578 IFCONFIG POOL LIST
Thu Feb 04 14:12:28 2010 us=7592 client1,10.24.0.4
Thu Feb 04 14:12:28 2010 us=7643 Initialization Sequence Completed
Thu Feb 04 14:12:32 2010 us=186242 MULTI: multi_create_instance called
Thu Feb 04 14:12:32 2010 us=186361 "IP_Publique_Client":2151 Re-using SSL/TLS context
Thu Feb 04 14:12:32 2010 us=186406 "IP_Publique_Client":2151 LZO compression initialized
Thu Feb 04 14:12:32 2010 us=186627 "IP_Publique_Client":2151 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Thu Feb 04 14:12:32 2010 us=186651 "IP_Publique_Client":2151 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Thu Feb 04 14:12:32 2010 us=186725 "IP_Publique_Client":2151 Local Options String: 'V4,dev-type tun,link-mtu 1542,tun-mtu 1500,proto UDPv4,comp-lzo,keydir 0,cipher BF-CBC,auth SHA1,keysize 128,tls-auth,key-method 2,tls-server'
Thu Feb 04 14:12:32 2010 us=186747 "IP_Publique_Client":2151 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1542,tun-mtu 1500,proto UDPv4,comp-lzo,keydir 1,cipher BF-CBC,auth SHA1,keysize 128,tls-auth,key-method 2,tls-client'
Thu Feb 04 14:12:32 2010 us=186790 "IP_Publique_Client":2151 Local Options hash (VER=V4): '14168603'
Thu Feb 04 14:12:32 2010 us=186817 "IP_Publique_Client":2151 Expected Remote Options hash (VER=V4): '504e774e'
Thu Feb 04 14:12:32 2010 us=186894 "IP_Publique_Client":2151 TLS: Initial packet from "IP_Publique-client":2151, sid=3e723c27 f31718f4
Thu Feb 04 14:12:33 2010 us=466335 "IP_Publique_Client":2151 VERIFY OK: depth=1, /C=FR/ST=DR/L=Villefranche/O=DLSystem/CN=OpenVPN-DLSystem/emailAddress=mail@host.domain
Thu Feb 04 14:12:33 2010 us=467091 "IP_Publique_Client":2151 VERIFY OK: depth=0, /C=FR/ST=DR/O=DLSystem/CN=client1/emailAddress=mail@host.domain
Thu Feb 04 14:12:33 2010 us=663681 "IP_Publique_Client":2151 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu Feb 04 14:12:33 2010 us=663742 "IP_Publique_Client":2151 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Feb 04 14:12:33 2010 us=663838 "IP_Publique_Client":2151 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu Feb 04 14:12:33 2010 us=663859 "IP_Publique_Client":2151 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Feb 04 14:12:33 2010 us=764068 "IP_Publique_Client":2151 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Thu Feb 04 14:12:33 2010 us=764165 "IP_Publique_Client":2151 [client1] Peer Connection Initiated with "IP_Publique-client":2151
Thu Feb 04 14:12:33 2010 us=764263 client1/"IP_Publique_Client":2151 MULTI: Learn: 10.24.0.6 -> client1/"IP_Publique-client":2151
Thu Feb 04 14:12:33 2010 us=764286 client1/"IP_Publique_Client":2151 MULTI: primary virtual IP for client1/"IP_Publique-client":2151: 10.24.0.6
Thu Feb 04 14:12:34 2010 us=798027 client1/"IP_Publique_Client":2151 PUSH: Received control message: 'PUSH_REQUEST'
Thu Feb 04 14:12:34 2010 us=798159 client1/"IP_Publique_Client":2151 SENT CONTROL [client1]: 'PUSH_REPLY,route 10.24.0.0 255.255.255.0,route 192.168.250.0 255.255.255.0,redirect-gateway def1,route 10.24.0.0 255.255.255.0,ping 10,ping-restart 120,ifconfig 10.24.0.6 10.24.0.5' (status=1)
Les log du client
Thu Feb 04 14:12:33 2010 us=426237 OpenVPN 2.0.7 Win32-MinGW [SSL] [LZO] built on Apr 12 2006
Thu Feb 04 14:12:33 2010 us=426327 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.
Thu Feb 04 14:12:33 2010 us=427525 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Thu Feb 04 14:12:33 2010 us=427554 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Feb 04 14:12:33 2010 us=427568 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Feb 04 14:12:33 2010 us=427591 LZO compression initialized
Thu Feb 04 14:12:33 2010 us=427679 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Thu Feb 04 14:12:33 2010 us=435184 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Thu Feb 04 14:12:33 2010 us=435221 Local Options String: 'V4,dev-type tun,link-mtu 1542,tun-mtu 1500,proto UDPv4,comp-lzo,keydir 1,cipher BF-CBC,auth SHA1,keysize 128,tls-auth,key-method 2,tls-client'
Thu Feb 04 14:12:33 2010 us=435233 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1542,tun-mtu 1500,proto UDPv4,comp-lzo,keydir 0,cipher BF-CBC,auth SHA1,keysize 128,tls-auth,key-method 2,tls-server'
Thu Feb 04 14:12:33 2010 us=435255 Local Options hash (VER=V4): '504e774e'
Thu Feb 04 14:12:33 2010 us=435270 Expected Remote Options hash (VER=V4): '14168603'
Thu Feb 04 14:12:33 2010 us=435296 Socket Buffers: R=[8192->8192] S=[8192->8192]
Thu Feb 04 14:12:33 2010 us=435309 UDPv4 link local: [undef]
Thu Feb 04 14:12:33 2010 us=435318 UDPv4 link remote: "IP_Publique_serveur":"Port_publique_serveur"
Thu Feb 04 14:12:33 2010 us=622490 TLS: Initial packet from "IP_Publique_serveur":"Port_publique_serveur", sid=9ef2f577 099ba84f
Thu Feb 04 14:12:34 2010 us=199201 VERIFY OK: depth=1, /C=FR/ST=DR/L=Villefranche/O=DLSystem/CN=OpenVPN-DLSystem/emailAddress=mail@host.domain
Thu Feb 04 14:12:34 2010 us=199619 VERIFY OK: nsCertType=SERVER
Thu Feb 04 14:12:34 2010 us=199629 VERIFY OK: depth=0, /C=FR/ST=DR/O=DLSystem/CN=server/emailAddress=mail@host.domain
Thu Feb 04 14:12:35 2010 us=106655 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu Feb 04 14:12:35 2010 us=106679 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Feb 04 14:12:35 2010 us=106742 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Thu Feb 04 14:12:35 2010 us=106754 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Thu Feb 04 14:12:35 2010 us=106797 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Thu Feb 04 14:12:35 2010 us=106824 [server] Peer Connection Initiated with "IP_Publique_serveur":"Port_publique_serveur"
Thu Feb 04 14:12:36 2010 us=138170 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Thu Feb 04 14:12:36 2010 us=241968 PUSH: Received control message: 'PUSH_REPLY,route 10.24.0.0 255.255.255.0,route 192.168.250.0 255.255.255.0,redirect-gateway def1,route 10.24.0.0 255.255.255.0,ping 10,ping-restart 120,ifconfig 10.24.0.6 10.24.0.5'
Thu Feb 04 14:12:36 2010 us=242026 OPTIONS IMPORT: timers and/or timeouts modified
Thu Feb 04 14:12:36 2010 us=242035 OPTIONS IMPORT: --ifconfig/up options modified
Thu Feb 04 14:12:36 2010 us=242043 OPTIONS IMPORT: route options modified
Thu Feb 04 14:12:36 2010 us=257118 TAP-WIN32 device [Connexion au réseau local 5] opened: \\.\Global\{7C2576FD-C97A-49F8-AF8B-C336BAC80B30}.tap
Thu Feb 04 14:12:36 2010 us=257141 TAP-Win32 Driver Version 8.1
Thu Feb 04 14:12:36 2010 us=257152 TAP-Win32 MTU=1500
Thu Feb 04 14:12:36 2010 us=257168 Notified TAP-Win32 driver to set a DHCP IP/netmask of 10.24.0.6/255.255.255.252 on interface {7C2576FD-C97A-49F8-AF8B-C336BAC80B30} [DHCP-serv: 10.24.0.5, lease-time: 31536000]
Thu Feb 04 14:12:36 2010 us=258366 NOTE: FlushIpNetTable failed on interface [2] {7C2576FD-C97A-49F8-AF8B-C336BAC80B30} (status=1413) : Index non valide.
Thu Feb 04 14:12:36 2010 us=260156 TEST ROUTES: 0/0 succeeded len=3 ret=0 a=0 u/d=down
Thu Feb 04 14:12:36 2010 us=260194 Route: Waiting for TUN/TAP interface to come up...
Thu Feb 04 14:12:37 2010 us=293021 TEST ROUTES: 0/0 succeeded len=3 ret=0 a=0 u/d=down
Thu Feb 04 14:12:37 2010 us=293044 Route: Waiting for TUN/TAP interface to come up...
Thu Feb 04 14:12:38 2010 us=325134 TEST ROUTES: 0/0 succeeded len=3 ret=0 a=0 u/d=down
Thu Feb 04 14:12:38 2010 us=325156 Route: Waiting for TUN/TAP interface to come up...
Thu Feb 04 14:12:39 2010 us=357296 TEST ROUTES: 0/0 succeeded len=3 ret=0 a=0 u/d=down
Thu Feb 04 14:12:39 2010 us=357316 Route: Waiting for TUN/TAP interface to come up...
Thu Feb 04 14:12:40 2010 us=389474 TEST ROUTES: 0/0 succeeded len=3 ret=0 a=0 u/d=down
Thu Feb 04 14:12:40 2010 us=389498 Route: Waiting for TUN/TAP interface to come up...
Thu Feb 04 14:12:41 2010 us=421657 TEST ROUTES: 4/4 succeeded len=3 ret=1 a=0 u/d=up
Thu Feb 04 14:12:41 2010 us=421687 route ADD "IP_Publique_serveur" MASK 255.255.255.255 192.168.1.1
Thu Feb 04 14:12:41 2010 us=423137 Route addition via IPAPI succeeded
Thu Feb 04 14:12:41 2010 us=423155 route ADD 0.0.0.0 MASK 128.0.0.0 10.24.0.5
Thu Feb 04 14:12:41 2010 us=424754 ROUTE: route addition failed using CreateIpForwardEntry: Paramètre incorrect. [if_index=2]
Thu Feb 04 14:12:41 2010 us=424769 Route addition via IPAPI failed
Thu Feb 04 14:12:41 2010 us=424780 route ADD 128.0.0.0 MASK 128.0.0.0 10.24.0.5
Thu Feb 04 14:12:41 2010 us=426369 ROUTE: route addition failed using CreateIpForwardEntry: Paramètre incorrect. [if_index=2]
Thu Feb 04 14:12:41 2010 us=426384 Route addition via IPAPI failed
Thu Feb 04 14:12:41 2010 us=426395 route ADD 10.24.0.0 MASK 255.255.255.0 10.24.0.5
Thu Feb 04 14:12:41 2010 us=427964 ROUTE: route addition failed using CreateIpForwardEntry: Paramètre incorrect. [if_index=2]
Thu Feb 04 14:12:41 2010 us=427980 Route addition via IPAPI failed
Thu Feb 04 14:12:41 2010 us=427991 route ADD 192.168.250.0 MASK 255.255.255.0 10.24.0.5
Thu Feb 04 14:12:41 2010 us=429565 ROUTE: route addition failed using CreateIpForwardEntry: Paramètre incorrect. [if_index=2]
Thu Feb 04 14:12:41 2010 us=429578 Route addition via IPAPI failed
Thu Feb 04 14:12:41 2010 us=429590 route ADD 10.24.0.0 MASK 255.255.255.0 10.24.0.5
Thu Feb 04 14:12:41 2010 us=431168 ROUTE: route addition failed using CreateIpForwardEntry: Paramètre incorrect. [if_index=2]
Thu Feb 04 14:12:41 2010 us=431181 Route addition via IPAPI failed
Thu Feb 04 14:12:41 2010 us=431192 Initialization Sequence Completed
ipconfig + Tables de routage:
Serveur:
Client:
Les 2 erreurs flagrantes que je vois sont:
"FlushIpNetTable failed on interface" que je n'arrive pas a corriger, je ne sais même pas ce que c'est
" ROUTE: route addition failed using CreateIpForwardEntry: Paramètre incorrect. [if_index=2]
Route addition via IPAPI failed "
Pour cette dernière ca dois être lié a la passerelle car les erreurs sont pas les même en fonction des paramètres de passerelle que je configure (push "redirect-gateway" ,push "redirect-gateway def1" ou rien.
Sinon quand la connexion est établie dans les log du serveur, la ligne suivante se répète:
Fri Feb 05 11:37:30 2010 us=412900 client1/"IP_Publique_Client":2795 MULTI: bad source address from client [192.168.1.100], packet dropped
Voila ca fais une semaine que je suis sur ce problème et je sais plus quoi faire
PS: Le routage IP est activé sur les 2 PC et le parfeu Windows désactivé sur les interfaces réseau correspondantes.
Merci et désolé pour la tartine que je viens de poster lol
Message édité par Thomas7169 le 05-02-2010 à 16:42:21