Bonsoir à tous,

Me voilà avec un soucis liée à openvpn. Le réseau n'étant vraiment pas mon fort, même après avoir cherché, mon problème reste insoluble.

J'ai un peu pratiqué OpenVPN et j'en ai un en particulier qui me pose problème. Puisque je ne vois rien qui diffère notablement de toutes mes autres configs qui marchent, je me demande d'où vient l'erreur.


Voici mes les infos d'un VPN qui fonctionne:

Fichier de Config:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
client
dev tun3
proto udp
remote IPX.XX.XXX.XX PORT
resolv-retry infinite
nobind
persist-key
persist-tun
auth-user-pass
comp-lzo
verb 3
cipher AES-128-CBC
pull
route-delay 2
redirect-gateway
<ca>
CA
</ca>
<cert>
MYCERT
</cert>
<key>
MYKEY
</key>

Sortie OpenVPN:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Sat Jan 16 01:02:42 2016 OpenVPN 2.3.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jul  8 2015
Sat Jan 16 01:02:42 2016 library versions: OpenSSL 1.0.2d 9 Jul 2015, LZO 2.08
Sat Jan 16 01:02:51 2016 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Sat Jan 16 01:02:51 2016 Socket Buffers: R=[212992->131072] S=[212992->131072]
Sat Jan 16 01:02:51 2016 UDPv4 link local: [undef]
Sat Jan 16 01:02:51 2016 UDPv4 link remote: [AF_INET]IPX.XX.XX.XX.XX:PORT
Sat Jan 16 01:02:51 2016 TLS: Initial packet from [AF_INET]IPX.XX.XX.XX.XX:PORT, sid=0366af3e f76d4ee6
Sat Jan 16 01:02:51 2016 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sat Jan 16 01:02:51 2016 VERIFY OK: depth=1, C=MT, ST=MLT, L=Valletta, O=FreeVPN.me, OU=FreeVPN.me, CN=FreeVPN.me CA, name=FreeVPN.me, emailAddress=contact@freevpn.me
Sat Jan 16 01:02:51 2016 VERIFY OK: depth=0, C=MT, ST=MLT, L=Valletta, O=FreeVPN.me, OU=FreeVPN.me, CN=FreeVPN.me, name=FreeVPN.me, emailAddress=contact@freevpn.me
Sat Jan 16 01:02:51 2016 Data Channel Encrypt: Cipher 'AES-128-CBC' initialized with 128 bit key
Sat Jan 16 01:02:51 2016 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jan 16 01:02:51 2016 Data Channel Decrypt: Cipher 'AES-128-CBC' initialized with 128 bit key
Sat Jan 16 01:02:51 2016 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jan 16 01:02:51 2016 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Sat Jan 16 01:02:51 2016 [FreeVPN.me] Peer Connection Initiated with [AF_INET]IPX.XX.XX.XX.XX:PORT
Sat Jan 16 01:02:53 2016 SENT CONTROL [FreeVPN.me]: 'PUSH_REQUEST' (status=1)
Sat Jan 16 01:02:53 2016 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,route 10.15.0.1,topology net30,ping 10,ping-restart 60,ifconfig 10.15.0.30 10.15.0.29'
Sat Jan 16 01:02:53 2016 OPTIONS IMPORT: timers and/or timeouts modified
Sat Jan 16 01:02:53 2016 OPTIONS IMPORT: --ifconfig/up options modified
Sat Jan 16 01:02:53 2016 OPTIONS IMPORT: route options modified
Sat Jan 16 01:02:53 2016 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sat Jan 16 01:02:53 2016 ROUTE_GATEWAY 192.168.1.254/255.255.255.0 IFACE=wlp5s0 HWADDR=MACADDRESS
Sat Jan 16 01:02:53 2016 TUN/TAP device tun3 opened
Sat Jan 16 01:02:53 2016 TUN/TAP TX queue length set to 100
Sat Jan 16 01:02:53 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sat Jan 16 01:02:53 2016 /sbin/ip link set dev tun3 up mtu 1500
Sat Jan 16 01:02:53 2016 /sbin/ip addr add dev tun3 local 10.15.0.30 peer 10.15.0.29
Sat Jan 16 01:02:55 2016 /sbin/ip route add IPX.XX.XX.XX.XX/PORTa 192.168.1.254
Sat Jan 16 01:02:55 2016 /sbin/ip route add 0.0.0.0/1 via 10.15.0.29
Sat Jan 16 01:02:55 2016 /sbin/ip route add 128.0.0.0/1 via 10.15.0.29
Sat Jan 16 01:02:55 2016 /sbin/ip route add 10.15.0.1/32 via 10.15.0.29
Sat Jan 16 01:02:55 2016 Initialization Sequence Completed
Résultat de route -n :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.15.0.29      128.0.0.0       UG    0      0        0 tun3
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wlp5s0
10.15.0.1       10.15.0.29      255.255.255.255 UGH   0      0        0 tun3
10.15.0.29      0.0.0.0         255.255.255.255 UH    0      0        0 tun3
128.0.0.0       10.15.0.29      128.0.0.0       UG    0      0        0 tun3
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 docker0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp5s0
XXX.XX.XXX.XX   192.168.1.254   255.255.255.255 UGH   0      0        0 wlp5s0

Et un exemple du résultat que me sort le VPN qui me pose problème:

Fichier OPENVPN:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
client
dev tun3
proto udp
#IP
remote vpn.ovh.VPN.com PORT
resolv-retry infinite
nobind
persist-key
persist-tun
comp-lzo
verb 3
redirect-gateway
pull
#CRSFILES
ca cacert.pem
cert my.crt
key my.key
Sortie de la commande openvpn:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Sat Jan 16 01:00:43 2016 OpenVPN 2.3.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jul  8 2015
Sat Jan 16 01:00:43 2016 library versions: OpenSSL 1.0.2d 9 Jul 2015, LZO 2.08
Sat Jan 16 01:00:43 2016 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Sat Jan 16 01:00:47 2016 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sat Jan 16 01:00:47 2016 Socket Buffers: R=[212992->131072] S=[212992->131072]
Sat Jan 16 01:00:47 2016 UDPv4 link local: [undef]
Sat Jan 16 01:00:47 2016 UDPv4 link remote: [AF_INET]IP.XXX.XX.XXX:PORT
Sat Jan 16 01:00:47 2016 TLS: Initial packet from [AF_INET]IP.XXX.XX.XXX:PORT, sid=c8e12fd0 5085c318
Sat Jan 16 01:00:47 2016 VERIFY OK: depth=1, C=FR, ST=IDF, O=Multiposting, CN=VPN.com, emailAddress=root@VPN.com
Sat Jan 16 01:00:47 2016 VERIFY OK: depth=0, C=FR, ST=IDF, L=Paris, O=Multiposting, CN=vpn.ovh.VPN.com, emailAddress=root@VPN.com
Sat Jan 16 01:00:48 2016 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Jan 16 01:00:48 2016 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jan 16 01:00:48 2016 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Jan 16 01:00:48 2016 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jan 16 01:00:48 2016 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Sat Jan 16 01:00:48 2016 [vpn.ovh.VPN.com] Peer Connection Initiated with [AF_INET]IP.XXX.XX.XXX:PORT
Sat Jan 16 01:00:50 2016 SENT CONTROL [vpn.ovh.VPN.com]: 'PUSH_REQUEST' (status=1)
Sat Jan 16 01:00:50 2016 PUSH: Received control message: 'PUSH_REPLY,topology subnet,route-gateway 10.240.0.1,route 10.0.0.0 255.192.0.0,route 10.64.0.0 255.255.0.0,route 10.224.0.0 255.255.0.0,ping 10,ping-restart 120,ifconfig 10.240.1.11 255.255.0.0'
Sat Jan 16 01:00:50 2016 OPTIONS IMPORT: timers and/or timeouts modified
Sat Jan 16 01:00:50 2016 OPTIONS IMPORT: --ifconfig/up options modified
Sat Jan 16 01:00:50 2016 OPTIONS IMPORT: route options modified
Sat Jan 16 01:00:50 2016 OPTIONS IMPORT: route-related options modified
Sat Jan 16 01:00:50 2016 ROUTE_GATEWAY 192.168.1.254/255.255.255.0 IFACE=wlp5s0 HWADDR=MACADDR
Sat Jan 16 01:00:50 2016 TUN/TAP device tun3 opened
Sat Jan 16 01:00:50 2016 TUN/TAP TX queue length set to 100
Sat Jan 16 01:00:50 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sat Jan 16 01:00:50 2016 /sbin/ip link set dev tun3 up mtu 1500
Sat Jan 16 01:00:50 2016 /sbin/ip addr add dev tun3 10.240.1.11/16 broadcast 10.240.255.255
Sat Jan 16 01:00:50 2016 /sbin/ip route add IP.XXX.XX.XXX/32 via 192.168.1.254
Sat Jan 16 01:00:50 2016 /sbin/ip route del 0.0.0.0/0
Sat Jan 16 01:00:50 2016 /sbin/ip route add 0.0.0.0/0 via 10.240.0.1
Sat Jan 16 01:00:50 2016 /sbin/ip route add 10.0.0.0/10 via 10.240.0.1
Sat Jan 16 01:00:50 2016 /sbin/ip route add 10.64.0.0/16 via 10.240.0.1
Sat Jan 16 01:00:50 2016 /sbin/ip route add 10.224.0.0/16 via 10.240.0.1
Sat Jan 16 01:00:50 2016 Initialization Sequence Completed
Sortie de la commande route -n:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.240.0.1      0.0.0.0         UG    950    0        0 tun3
10.0.0.0        10.240.0.1      255.192.0.0     UG    0      0        0 tun3
10.64.0.0       10.240.0.1      255.255.0.0     UG    0      0        0 tun3
10.224.0.0      10.240.0.1      255.255.0.0     UG    0      0        0 tun3
10.240.0.0      0.0.0.0         255.255.0.0     U     0      0        0 tun3
IP.XXX.XXX.XX   192.168.1.254   255.255.255.255 UGH   0      0        0 wlp5s0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 docker0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp5s0
Donc apparemment, la connexion au VPN se passe correctement. Mais ensuite, sur ma machine, le trafic n'est pas redirigé. En testant plusieurs changements dans la configuration, j'obtiens toujours, soit mon IP de box, soit aucune connexion.

J'ai tenté plusieurs changements dans la configuration du client, notament l'option "bypass-dhcp" dans le "redirect-gateway" mais le problème persiste.

En observant les sorties je me rends aussi compte qu'il manque un pont dans ma config qui pose problème:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wlp5s0
Mais je ne vois pas bien quand celui-ci est crée dans la première config.

Avez-vous déjà eu un problème similaire avec OpenVPN ?

Merci d'avoir lu mon message jusqu'au bout et du temps que vous prendrez pour y répondre.