# \[resolu\] ssh et open vpn

**URL:** <https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738>\
**Category:** Pause Café\
**Created:** [Février 20, 2016, 5:51 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738 "2016-02-20T17:51:45Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:51 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/1 "2016-02-20T17:51:45Z")

</div>

Bonsoir à tous. j’essaye de mettre le serveur openvpn chez moi.  
je suis le tuto de [http://howto.landure.fr/gnu-linux/debian-4-0-etch/installer-et-configurer-openvpn-sur-debian-4-0-etch](http://howto.landure.fr/gnu-linux/debian-4-0-etch/installer-et-configurer-openvpn-sur-debian-4-0-etch)

C’est loin d’être gagné ☹

je suis arrivé au moment où il fallait redémarrer openvpn. Après le “restart” ma connection ssh s’est coupé.  
Si j’arrête openvpn, ssh fonctionne à nouveau.  
d’où vient le problème ?

---

<div class="post-metadata">

**Author:** ![Ludo](https://www.debian-fr.org/user_avatar/www.debian-fr.org/ludo/32/3426_2.png) [@Ludo](https://www.debian-fr.org/u/Ludo)\
**Post date:** [Février 20, 2016, 5:51 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/2 "2016-02-20T17:51:49Z")

</div>

Tu ne devrais pas d’abord créer un connexion vpn avant de lancer le ssh via le tunnel vpn ?

Mais je n’y connais rien en openvpn, je sais juste que ou je boss tout nos firewall sont interconnecter en vpn. Se connecter directement vers une ip public de firewall est bloqué en ssh, mais on passe plutôt par le tunnel vpn en ip privée.

Enfin quelqu’un de plus expérimenté doit pouvoir t’éclairer mieux que moi. 🙂

---

<div class="post-metadata">

**Author:** ![tntprog](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/t/eada6e/32.png) [@tntprog](https://www.debian-fr.org/u/tntprog)\
**Post date:** [Février 20, 2016, 5:51 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/3 "2016-02-20T17:51:51Z")

</div>

Euuuh à tout hasard, est-ce que OpenVPN et SSH n’utilisent pas le même port ?? Car si 2 applis tournent sur le même port, il y en a forcément une des 2 qui ne peut pas fonctionner ! (c’est bien pour ça qu’il y a 65535 ports disponibles)

---

<div class="post-metadata">

**Author:** ![mattotop](https://www.debian-fr.org/user_avatar/www.debian-fr.org/mattotop/32/3942_2.png) [@mattotop](https://www.debian-fr.org/u/mattotop)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/4 "2016-02-20T17:52:00Z")

</div>

tntprog: le port habituel (que je n’utilise pas d’ailleurs) pour openvpn est le 1194, ce qui ne peut pas rentrer en conflit avec le port 22 ssh.  
ludo: passer par un vpn pour faire du ssh, c’est un peu comme porter des bretelles et une ceinture: il y a une précaution inutile.  
shell-boudeur: excellent tuto. tu as quoi comme adressage des deux coté du vpn (lan du client et du serveur), et quelles sont les adresses attribuées par le serveur ? Parceque ça ressemblerait bien à un problême d’adressage aussi.

---

<div class="post-metadata">

**Author:** ![Ludo](https://www.debian-fr.org/user_avatar/www.debian-fr.org/ludo/32/3426_2.png) [@Ludo](https://www.debian-fr.org/u/Ludo)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/5 "2016-02-20T17:52:02Z")

</div>

[quote=“mattotop”]  
ludo: passer par un vpn pour faire du ssh, c’est un peu comme porter des bretelles et une ceinture: il y a une précaution inutile.[/quote]

Pour faire passe uniquement ssh y’a pas de doute.

---

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/6 "2016-02-20T17:52:12Z")

</div>

> [@](#):
>
> tu as quoi comme adressage des deux coté du vpn (lan du client et du serveur), et quelles sont les adresses attribuées par le serveur ?

stéphanie de monaco !  
dsl, je ne comprends pas ce tu demandes.  
Préfères-tu voir le server.conf ?

---

<div class="post-metadata">

**Author:** ![mattotop](https://www.debian-fr.org/user_avatar/www.debian-fr.org/mattotop/32/3942_2.png) [@mattotop](https://www.debian-fr.org/u/mattotop)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/7 "2016-02-20T17:52:12Z")

</div>

Le server.conf oui, mais aussi le resultat d’ifconfig -a sur chacune des deux machines du vpn.

---

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/8 "2016-02-20T17:52:15Z")

</div>

le fichier conf

[code]# TCP or UDP server?  
;proto tcp  
proto udp

# “dev tun” will create a routed IP tunnel,

# “dev tap” will create an ethernet tunnel.

# Use “dev tap0” if you are ethernet bridging

# and have precreated a tap0 virtual interface

# and bridged it with your ethernet interface.

# If you want to control access policies

# over the VPN, you must create firewall

# rules for the the TUN/TAP interface.

# On non-Windows systems, you can give

# an explicit unit number, such as tun0.

# On Windows, use “dev-node” for this.

# On most systems, the VPN will not function

# unless you partially or fully disable

# the firewall for the TUN/TAP interface.

;dev tap  
dev tun

# Windows needs the TAP-Win32 adapter name

# from the Network Connections panel if you

# have more than one. On XP SP2 or higher,

# you may need to selectively disable the

# Windows firewall for the TAP adapter.

# Non-Windows systems usually don’t need this.

;dev-node MyTap

# SSL/TLS root certificate (ca), certificate

# (cert), and private key (key). Each client

# and the server must have their own cert and

# key file. The server and all clients will

# use the same ca file.

# 

# See the “easy-rsa” directory for a series

# of scripts for generating RSA certificates

# and private keys. Remember to use

# a unique Common Name for the server

# and each of the client certificates.

# 

# Any X509 key management system can be used.

# OpenVPN can also use a PKCS #12 formatted key file

# (see “pkcs12” directive in man page).

ca /etc/openvpn/keys/ca.crt  
cert /etc/openvpn/keys/server.crt  
key /etc/openvpn/keys/server.key # This file should be kept secret

# Diffie hellman parameters.

# Generate your own with:

# openssl dhparam -out dh1024.pem 1024

# Substitute 2048 for 1024 if you are using

# 2048 bit keys.

dh /etc/openvpn/keys/dh1024.pem

# Configure server mode and supply a VPN subnet

# for OpenVPN to draw client addresses from.

# The server will take 10.8.0.1 for itself,

# the rest will be made available to clients.

# Each client will be able to reach the server

# on 10.8.0.1. Comment this line out if you are

# ethernet bridging. See the man page for more info.

server 192.168.1.0 255.255.255.0

# Maintain a record of client \<-\> virtual IP address

# associations in this file. If OpenVPN goes down or

# is restarted, reconnecting clients can be assigned

# the same virtual IP address from the pool that was

# previously assigned.

ifconfig-pool-persist ipp.txt

# Configure server mode for ethernet bridging.

# You must first use your OS’s bridging capability

# to bridge the TAP interface with the ethernet

# NIC interface. Then you must manually set the

# IP/netmask on the bridge interface, here we

# assume 10.8.0.4/255.255.255.0. Finally we

# must set aside an IP range in this subnet

# (start=10.8.0.50 end=10.8.0.100) to allocate

# to connecting clients. Leave this line commented

# out unless you are ethernet bridging.

;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100

# Push routes to the client to allow it

# to reach other private subnets behind

# the server. Remember that these

# private subnets will also need

# to know to route the OpenVPN client

# address pool (10.8.0.0/255.255.255.0)

# back to the OpenVPN server.

;push “route 192.168.10.0 255.255.255.0”  
;push “route 192.168.20.0 255.255.255.0”

# To assign specific IP addresses to specific

# clients or if a connecting client has a private

# subnet behind it that should also have VPN access,

# use the subdirectory “ccd” for client-specific

# configuration files (see man page for more info).

# EXAMPLE: Suppose the client

# having the certificate common name “Thelonious”

# also has a small subnet behind his connecting

# machine, such as 192.168.40.128/255.255.255.248.

# First, uncomment out these lines:

;client-config-dir ccd  
;route 192.168.40.128 255.255.255.248

# Then create a file ccd/Thelonious with this line:

# iroute 192.168.40.128 255.255.255.248

# This will allow Thelonious’ private subnet to

# access the VPN. This example will only work

# if you are routing, not bridging, i.e. you are

# using “dev tun” and “server” directives.

# EXAMPLE: Suppose you want to give

# Thelonious a fixed VPN IP address of 10.9.0.1.

# First uncomment out these lines:

;client-config-dir ccd  
;route 10.9.0.0 255.255.255.252

# Then add this line to ccd/Thelonious:

# ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different

# firewall access policies for different groups

# of clients. There are two methods:

# (1) Run multiple OpenVPN daemons, one for each

# group, and firewall the TUN/TAP interface

# for each group/daemon appropriately.

# (2) (Advanced) Create a script to dynamically

# modify the firewall in response to access

# from different clients. See man

# page for more info on learn-address script.

;learn-address ./script

# If enabled, this directive will configure

# all clients to redirect their default

# network gateway through the VPN, causing

# all IP traffic such as web browsing and

# and DNS lookups to go through the VPN

# (The OpenVPN server machine may need to NAT

# the TUN/TAP interface to the internet in

# order for this to work properly).

# CAVEAT: May break client’s network config if

# client’s local DHCP server packets get routed

# through the tunnel. Solution: make sure

# client’s local DHCP server is reachable via

# a more specific route than the default route

# of 0.0.0.0/0.0.0.0.

;push “redirect-gateway”

# Certain Windows-specific network settings

# can be pushed to clients, such as DNS

# or WINS server addresses. CAVEAT:

# [http://openvpn.net/faq.html#dhcpcaveats](http://openvpn.net/faq.html#dhcpcaveats)

;push “dhcp-option DNS 10.8.0.1”  
;push “dhcp-option WINS 10.8.0.1”

# Uncomment this directive to allow different

# clients to be able to “see” each other.

# By default, clients will only see the server.

# To force clients to only see the server, you

# will also need to appropriately firewall the

# server’s TUN/TAP interface.

;client-to-client

# Uncomment this directive if multiple clients

# might connect with the same certificate/key

# files or common names. This is recommended

# only for testing purposes. For production use,

# each client should have its own certificate/key

# pair.

# 

# IF YOU HAVE NOT GENERATED INDIVIDUAL

# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,

# EACH HAVING ITS OWN UNIQUE “COMMON NAME”,

# UNCOMMENT THIS LINE OUT.

;duplicate-cn

# The keepalive directive causes ping-like

# messages to be sent back and forth over

# the link so that each side knows when

# the other side has gone down.

# Ping every 10 seconds, assume that remote

# peer is down if no ping received during

# a 120 second time period.

keepalive 10 120

# For extra security beyond that provided

# by SSL/TLS, create an “HMAC firewall”

# to help block DoS attacks and UDP port flooding.

# 

# Generate with:

# openvpn --genkey --secret ta.key

# 

# The server and each client must have

# a copy of this key.

# The second parameter should be ‘0’

# on the server and ‘1’ on the clients.

tls-auth /etc/openvpn/keys/ta.key 0 # This file is secret

# Select a cryptographic cipher.

# This config item must be copied to

# the client config file as well.

;cipher BF-CBC # Blowfish (default)  
;cipher AES-128-CBC # AES  
cipher DES-EDE3-CBC # Triple-DES

# Enable compression on the VPN link.

# If you enable it here, you must also

# enable it in the client config file.

comp-lzo

# The maximum number of concurrently connected

# clients we want to allow.

;max-clients 100

# It’s a good idea to reduce the OpenVPN

# daemon’s privileges after initialization.

# 

# You can uncomment this out on

# non-Windows systems.

user nobody  
group nogroup

# The persist options will try to avoid

# accessing certain resources on restart

# that may no longer be accessible because

# of the privilege downgrade.

persist-key  
persist-tun

# Output a short status file showing

# current connections, truncated

# and rewritten every minute.

status /var/log/openvpn-status.log

# By default, log messages will go to the syslog (or

# on Windows, if running as a service, they will go to

# the “\Program Files\OpenVPN\log” directory).

# Use log or log-append to override this default.

# “log” will truncate the log file on OpenVPN startup,

# while “log-append” will append to it. Use one

# or the other (but not both).

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

# Set the appropriate level of log

# file verbosity.

# 

# 0 is silent, except for fatal errors

# 4 is reasonable for general usage

# 5 and 6 can help to debug connection problems

# 9 is extremely verbose

verb 3

# Silence repeating messages. At most 20

# sequential messages of the same message

# category will be output to the log.

;mute 20

# Revoked certificate list

crl-verify /etc/openvpn/keys/crl.pem[/code]

ifconfig du dinosore :

[code]ifconfig -a  
eth0 Lien encap:Ethernet HWaddr 00:50:FC:6F:81:C2  
inet adr:192.168.1.71 Bcast:192.168.1.255 Masque:255.255.255.0  
adr inet6: fe80::250:fcff:fe6f:81c2/64 Scope:Lien  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
RX packets:2183504 errors:0 dropped:0 overruns:0 frame:0  
TX packets:4117725 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:1000  
RX bytes:149282882 (142.3 MiB) TX bytes:1688386899 (1.5 GiB)  
Interruption:10 Adresse de base:0xf400

eth0:0 Lien encap:Ethernet HWaddr 00:50:FC:6F:81:C2  
inet adr:192.168.1.72 Bcast:192.168.1.255 Masque:255.255.255.0  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
Interruption:10 Adresse de base:0xf400

eth0:1 Lien encap:Ethernet HWaddr 00:50:FC:6F:81:C2  
inet adr:192.168.1.73 Bcast:192.168.1.255 Masque:255.255.255.0  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
Interruption:10 Adresse de base:0xf400

eth0:2 Lien encap:Ethernet HWaddr 00:50:FC:6F:81:C2  
inet adr:192.168.1.75 Bcast:192.168.1.255 Masque:255.255.255.0  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
Interruption:10 Adresse de base:0xf400

lo Lien encap:Boucle locale  
inet adr:127.0.0.1 Masque:255.0.0.0  
adr inet6: ::1/128 Scope:HÃ´te  
UP LOOPBACK RUNNING MTU:16436 Metric:1  
RX packets:125 errors:0 dropped:0 overruns:0 frame:0  
TX packets:125 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:0  
RX bytes:48382 (47.2 KiB) TX bytes:48382 (47.2 KiB)

sit0 Lien encap:IPv6-dans-IPv4  
NOARP MTU:1480 Metric:1  
RX packets:0 errors:0 dropped:0 overruns:0 frame:0  
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:0  
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)[/code]

et celui du pc distant

[code] ifconfig -a  
eth0 Lien encap:Ethernet HWaddr 00:12:17:5C:5A:71  
inet adr:192.168.1.4 Bcast:192.168.1.255 Masque:255.255.255.0  
adr inet6: fe80::212:17ff:fe5c:5a71/64 Scope:Lien  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
RX packets:27487 errors:0 dropped:0 overruns:0 frame:0  
TX packets:23182 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:1000  
RX bytes:28110392 (26.8 MiB) TX bytes:4646513 (4.4 MiB)  
Interruption:11 Adresse de base:0xe800

lo Lien encap:Boucle locale  
inet adr:127.0.0.1 Masque:255.0.0.0  
adr inet6: ::1/128 Scope:HÃ´te  
UP LOOPBACK RUNNING MTU:16436 Metric:1  
RX packets:8 errors:0 dropped:0 overruns:0 frame:0  
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:0  
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

sit0 Lien encap:IPv6-dans-IPv4  
NOARP MTU:1480 Metric:1  
RX packets:0 errors:0 dropped:0 overruns:0 frame:0  
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:0  
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)[/code]

---

<div class="post-metadata">

**Author:** ![mattotop](https://www.debian-fr.org/user_avatar/www.debian-fr.org/mattotop/32/3942_2.png) [@mattotop](https://www.debian-fr.org/u/mattotop)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/9 "2016-02-20T17:52:17Z")

</div>

cherches pas: ton pc distant et ton serveur sont sur la même frange d’adresse du coté du réseau local ([192.168.1.xxx](http://192.168.1.xxx)). Quand ils ont un paquet à faire circuler vers une adresse 192.168.1.qqchose, ils ne savent pas s’il doivent l’envoyer par la carte réseau ou le vpn (en fait, ils doivent tout envoyer vers le réseau local). Il faut que tu changes l’adressage IP d’un coté ou de l’autre. AMA, plutot du coté du serveur.

---

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/10 "2016-02-20T17:52:36Z")

</div>

Merci Matt, j’ai changé

[code]# Configure server mode and supply a VPN subnet

# for OpenVPN to draw client addresses from.

# The server will take 10.8.0.1 for itself,

# the rest will be made available to clients.

# Each client will be able to reach the server

# on 10.8.0.1. Comment this line out if you are

# ethernet bridging. See the man page for more info.

server 192.168.1.0 255.255.255.0[/code]

en

```auto

```

et je ne suis plus déconnecté de ssh 😃

Me reste plus qu’à arriver à me connecter depuis le poste client

Merci encore

---

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/11 "2016-02-20T17:52:36Z")

</div>

les lignes qui commencent par le symbole # sont des commentaires mais qu’en est-il des lignes qui commencent par le point virgule ?

---

<div class="post-metadata">

**Author:** ![mattotop](https://www.debian-fr.org/user_avatar/www.debian-fr.org/mattotop/32/3942_2.png) [@mattotop](https://www.debian-fr.org/u/mattotop)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/12 "2016-02-20T17:52:38Z")

</div>

aussi.

---

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/13 "2016-02-20T17:52:39Z")

</div>

je n’arrive même pas à pinguer depuis le poste client  
un ifconfig du serveur

[code]ifconfig -a  
eth0 Lien encap:Ethernet HWaddr 00:50:FC:6F:81:C2  
inet adr:192.168.1.71 Bcast:192.168.1.255 Masque:255.255.255.0  
adr inet6: fe80::250:fcff:fe6f:81c2/64 Scope:Lien  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
RX packets:7852444 errors:0 dropped:0 overruns:0 frame:0  
TX packets:12548575 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:1000  
RX bytes:1791191892 (1.6 GiB) TX bytes:4136535834 (3.8 GiB)  
Interruption:10 Adresse de base:0xf400

eth0:0 Lien encap:Ethernet HWaddr 00:50:FC:6F:81:C2  
inet adr:192.168.1.72 Bcast:192.168.1.255 Masque:255.255.255.0  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
Interruption:10 Adresse de base:0xf400

eth0:1 Lien encap:Ethernet HWaddr 00:50:FC:6F:81:C2  
inet adr:192.168.1.73 Bcast:192.168.1.255 Masque:255.255.255.0  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
Interruption:10 Adresse de base:0xf400

eth0:2 Lien encap:Ethernet HWaddr 00:50:FC:6F:81:C2  
inet adr:192.168.1.75 Bcast:192.168.1.255 Masque:255.255.255.0  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
Interruption:10 Adresse de base:0xf400

lo Lien encap:Boucle locale  
inet adr:127.0.0.1 Masque:255.0.0.0  
adr inet6: ::1/128 Scope:HÃ´te  
UP LOOPBACK RUNNING MTU:16436 Metric:1  
RX packets:151 errors:0 dropped:0 overruns:0 frame:0  
TX packets:151 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:0  
RX bytes:50422 (49.2 KiB) TX bytes:50422 (49.2 KiB)

sit0 Lien encap:IPv6-dans-IPv4  
NOARP MTU:1480 Metric:1  
RX packets:0 errors:0 dropped:0 overruns:0 frame:0  
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:0  
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tun0 Lien encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
inet adr:192.168.2.1 P-t-P:192.168.2.2 Masque:255.255.255.255  
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1  
RX packets:0 errors:0 dropped:0 overruns:0 frame:0  
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 lg file transmission:100  
RX bytes:0 (0.0 b) TX bytes:756 (756.0 b)[/code]

un ping depuis le serveur

[code]ping 192.168.2.1  
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.  
64 bytes from 192.168.2.1: icmp\_seq=1 ttl=64 time=0.189 ms  
64 bytes from 192.168.2.1: icmp\_seq=2 ttl=64 time=0.175 ms  
64 bytes from 192.168.2.1: icmp\_seq=3 ttl=64 time=0.149 ms  
64 bytes from 192.168.2.1: icmp\_seq=4 ttl=64 time=0.135 ms  
64 bytes from 192.168.2.1: icmp\_seq=5 ttl=64 time=0.138 ms

— 192.168.2.1 ping statistics —  
5 packets transmitted, 5 received, 0% packet loss, time 4002ms  
rtt min/avg/max/mdev = 0.135/0.157/0.189/0.022 ms[/code]

depuis le poste client (win)

```auto
Envoi d'une requête 'Ping' 192.168.2.1 avec 32 octets de données :
Délai d'attente de la demande dépassé.
Délai d'attente de la demande dépassé.
Délai d'attente de la demande dépassé.
Délai d'attente de la demande dépassé.
Statistiques Ping pour 192.168.2.1:
    Paquets : envoyés = 4, reçus = 0, perdus = 4 (perte 100%)[/code]

win me dit que le câble réseau est débranché

mon fichier *.opvn

[code]##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
##############################################

# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client

# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one. On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap

# Are we connecting to a TCP or
# UDP server? Use the same setting as
# on the server.
;proto tcp
proto udp

# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote 192.168.2.1 1194
;remote my-server-2 1194

# Choose a random host from the remote
# list for load-balancing. Otherwise
# try hosts in the order specified.
;remote-random

# Keep trying indefinitely to resolve the
# host name of the OpenVPN server. Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite

# Most clients don't need to bind to
# a specific local port number.
nobind

# Downgrade privileges after initialization (non-Windows only)
;user nobody
;group nobody

# Try to preserve some state across restarts.
persist-key
persist-tun

# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here. See the man page
# if your proxy server requires
# authentication.
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]

# Wireless networks often produce a lot
# of duplicate packets. Set this flag
# to silence duplicate packet warnings.
;mute-replay-warnings

# SSL/TLS parms.
# See the server config file for more
# description. It's best to use
# a separate .crt/.key file pair
# for each client. A single ca
# file can be used for all clients.
ca ca.crt
cert test.crt
key test.key

# Verify server certificate by checking
# that the certicate has the nsCertType
# field set to "server". This is an
# important precaution to protect against
# a potential attack discussed here:
# http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the nsCertType
# field set to "server". The build-key-server
# script in the easy-rsa folder will do this.
;ns-cert-type server

# If a tls-auth key is used on the server
# then every client must also have the key.
;tls-auth ta.key 1

# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
;cipher x

# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
comp-lzo

# Set log file verbosity.
verb 3

# Silence repeating messages
;mute 20
```

quelque chose que je n’ai pas fait correctement ?

---

<div class="post-metadata">

**Author:** ![mattotop](https://www.debian-fr.org/user_avatar/www.debian-fr.org/mattotop/32/3942_2.png) [@mattotop](https://www.debian-fr.org/u/mattotop)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/14 "2016-02-20T17:52:43Z")

</div>

c’est quoi, ça, dans ta config client: remote 192.168.2.1 1194 ?  
Je ne vois nulle part ton serveur utiliser 192.168.2.1 comme adresse, donc le client a peut être un peu de mal à atteindre son serveur, non ?

Sinon, que donne ipconfig /all sur ton client ?

---

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/15 "2016-02-20T17:52:44Z")

</div>

le 192.168.2.1 est l’adresse du serveur openvpn, c’est celui de la carte ethernet qu’il faut mettre ?

`ipconfig /all
Configuration IP de Windows
   Nom de l'hôte . . . . . . . . . . : antec
   Suffixe DNS principal . . . . . . :
   Type de noeud. . . . . . . . . . : Hybride
   Routage IP activé . . . . . . . . : Non
   Proxy WINS activé . . . . . . . . : Non
Carte Ethernet Connexion au réseau local 2 :
   Statut du média. . . . . . . . . . . . : Média déconnecté
   Suffixe DNS propre à la connexion. . . :
   Description. . . . . . . . . . . . . . : TAP-Win32 Adapter V9
   Adresse physique . . . . . . . . . . . : 00-FF-87-E2-63-A4
   DHCP activé. . . . . . . . . . . . . . : Oui
   Configuration automatique activée. . . : Oui
Carte Ethernet Connexion au réseau local :
   Suffixe DNS propre à la connexion. . . :
   Description. . . . . . . . . . . . . . : Realtek RTL8168B/8111B Family PCI-E
Gigabit Ethernet NIC (NDIS 6.0)
   Adresse physique . . . . . . . . . . . : 00-1D-7D-9C-CA-80
   DHCP activé. . . . . . . . . . . . . . : Oui
   Configuration automatique activée. . . : Oui
   Adresse IPv4. . . . . . . . . . . : 192.168.1.3(préféré)
   Masque de sous-réseau. . . . . . . . . : 255.255.255.0
   Bail obtenu. . . . . . . . . . . . . . : samedi 19 juillet 2008 11:49:47
   Bail expirant. . . . . . . . . . . . . : dimanche 20 juillet 2008 11:49:46
   Passerelle par défaut. . . . . . . . . : 192.168.1.1
   Serveur DHCP . . . . . . . . . . . . . : 192.168.1.1
   Serveurs DNS. . . . . . . . . . . . . : 192.168.1.1
   NetBIOS sur Tcpip. . . . . . . . . . . : Activé
Carte Tunnel Connexion au réseau local* :
   Suffixe DNS propre à la connexion. . . :
   Description. . . . . . . . . . . . . . : isatap.{06DE1DDC-CF01-485E-8FBF-4693A77FA559}
   Adresse physique . . . . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP activé. . . . . . . . . . . . . . : Non
   Configuration automatique activée. . . : Oui
   Adresse IPv6 de liaison locale. . : fe80::5efe:192.168.1.3%10(préféré)
   Passerelle par défaut. . . . . . . . . :
   Serveurs DNS. . . . . . . . . . . . . : 192.168.1.1
   NetBIOS sur TCPIP. . . . . . . . . . . : Désactivé
Carte Tunnel Connexion au réseau local* 6 :
   Suffixe DNS propre à la connexion. . . :
   Description. . . . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
   Adresse physique . . . . . . . . . . . : 02-00-54-55-4E-01
   DHCP activé. . . . . . . . . . . . . . : Non
   Configuration automatique activée. . . : Oui
   Adresse IPv6. . . . . . . . . . . : 2001:0:d5c7:a2ca:18a2:292b:3f57:fefc(préféré)
   Adresse IPv6 de liaison locale. . : fe80::18a2:292b:3f57:fefc%9(préféré)
   Passerelle par défaut. . . . . . . . . : ::
   NetBIOS sur TCPIP. . . . . . . . . . . : Désactivé
Carte Tunnel Connexion au réseau local* 7 :
   Statut du média. . . . . . . . . . . . : Média déconnecté
   Suffixe DNS propre à la connexion. . . :
   Description. . . . . . . . . . . . . . : isatap.{87E263A4-9637-42B7-AF60-CA19491A258A}
   Adresse physique . . . . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP activé. . . . . . . . . . . . . . : Non
   Configuration automatique activée. . . : Oui`

---

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/16 "2016-02-20T17:52:47Z")

</div>

J’ai supprimé openvpn pour repartir à zéro.  
Lorsque j’arrive là

[quote] Création d’une autorité de certification

Une autorité de certification est un ensemble clef privée / clef publique destiné à signer des clefs publiques. Pour créer votre autorité de certification, exécutez les lignes de commandes suivantes :

source /etc/openvpn/easy-rsa/vars  
export KEY\_COMMONNAME=“ca.$OPENVPN\_SERVER”  
/etc/openvpn/easy-rsa/clean-all  
/etc/openvpn/easy-rsa/build-ca[/quote]

ça m’affiche une erreur

` /etc/openvpn/easy-rsa/build-ca
error on line 123 of /etc/openvpn/easy-rsa/openssl.cnf
657:error:0E065068:configuration file routines:STR_COPY:variable has no value:conf_def.c:629:line 123
`

la ligne 123 du fichier openssl.cnf

`0.organizationName_default = $ENV::KEY_ORG
`  
suis largué

---

<div class="post-metadata">

**Author:** ![mattotop](https://www.debian-fr.org/user_avatar/www.debian-fr.org/mattotop/32/3942_2.png) [@mattotop](https://www.debian-fr.org/u/mattotop)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/17 "2016-02-20T17:52:48Z")

</div>

il faut commencer par éditer /etc/openvpn/easy-rsa/vars pour y mettre des valeurs cohérentes pour les variables KEY\_\* (en particulier le KEY\_ORG qui pose pb). Ensuite, tu source comme il est dit le fichier, tu oublies le export situ as déjà mis une valeur pour le cn KEY\_COMMONNAME dans vars (chaque machine certifiée doit avoir au final son propre cn). Puis tu continues ton tuto /etc/openvpn/easy-rsa/clean-all;/etc/openvpn/easy-rsa/build-ca, etc…

---

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:52 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/18 "2016-02-20T17:52:49Z")

</div>

j’ai réussi à tout réinstaller openvpn et je suis arrivé à finir le tuto.  
le “Allerplus loin” attendra encore.  
installation nickel, pas de messages d’erreurs ou autres.  
j’ai copié le test.tar.gz et décompréssé dans le poste client  
donc dans c:\programme files\openvpn\config je me retrouve avec :  
ca.crt  
test.crt  
test.key  
ta.key  
j’ai fais une copie d’un fichier client.ovpn qui se trouve dans sample-config et modifié comme suit :

[code]##############################################

# Sample client-side OpenVPN 2.0 config file

# for connecting to multi-client server.

# 

# This configuration can be used by multiple

# clients, however each client should have

# its own cert and key files.

# 

# On Windows, you might want to rename this

# file so it has a .ovpn extension

##############################################

# Specify that we are a client and that we

# will be pulling certain config file directives

# from the server.

client

# Use the same setting as you are using on

# the server.

# On most systems, the VPN will not function

# unless you partially or fully disable

# the firewall for the TUN/TAP interface.

;dev tap  
dev tun

# Windows needs the TAP-Win32 adapter name

# from the Network Connections panel

# if you have more than one. On XP SP2,

# you may need to disable the firewall

# for the TAP adapter.

;dev-node MyTap

# Are we connecting to a TCP or

# UDP server? Use the same setting as

# on the server.

;proto tcp  
proto udp

# The hostname/IP and port of the server.

# You can have multiple remote entries

# to load balance between the servers.

#adresse de la vrai carte réseau du pc server  
remote 192.168.1.71 1194  
;remote my-server-2 1194

# Choose a random host from the remote

# list for load-balancing. Otherwise

# try hosts in the order specified.

;remote-random

# Keep trying indefinitely to resolve the

# host name of the OpenVPN server. Very useful

# on machines which are not permanently connected

# to the internet such as laptops.

resolv-retry infinite

# Most clients don’t need to bind to

# a specific local port number.

nobind

# Downgrade privileges after initialization (non-Windows only)

;user nobody  
;group nobody

# Try to preserve some state across restarts.

persist-key  
persist-tun

# If you are connecting through an

# HTTP proxy to reach the actual OpenVPN

# server, put the proxy server/IP and

# port number here. See the man page

# if your proxy server requires

# authentication.

;http-proxy-retry # retry on connection failures  
;http-proxy [proxy server] [proxy port #]

# Wireless networks often produce a lot

# of duplicate packets. Set this flag

# to silence duplicate packet warnings.

;mute-replay-warnings

# SSL/TLS parms.

# See the server config file for more

# description. It’s best to use

# a separate .crt/.key file pair

# for each client. A single ca

# file can be used for all clients.

ca ca.crt  
cert test.crt  
key test.key

# Verify server certificate by checking

# that the certicate has the nsCertType

# field set to “server”. This is an

# important precaution to protect against

# a potential attack discussed here:

# [http://openvpn.net/howto.html#mitm](http://openvpn.net/howto.html#mitm)

# 

# To use this feature, you will need to generate

# your server certificates with the nsCertType

# field set to “server”. The build-key-server

# script in the easy-rsa folder will do this.

;ns-cert-type server

# If a tls-auth key is used on the server

# then every client must also have the key.

;tls-auth ta.key 1

# Select a cryptographic cipher.

# If the cipher option is used on the server

# then you must also specify it here.

;cipher x

# Enable compression on the VPN link.

# Don’t enable this unless it is also

# enabled in the server config file.

comp-lzo

# Set log file verbosity.

verb 3

# Silence repeating messages

;mute 20  
[/code]

je lance openvpnGUI et je me retrouve avec ça :

`Sat Jul 19 19:11:39 2008 OpenVPN 2.0.9 Win32-MinGW [SSL] [LZO] built on Oct 1 2006
Sat Jul 19 19:11:39 2008 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.
Sat Jul 19 19:11:39 2008 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Sat Jul 19 19:11:39 2008 LZO compression initialized
Sat Jul 19 19:11:39 2008 Control Channel MTU parms [L:1542 D:138 EF:38 EB:0 ET:0 EL:0]
Sat Jul 19 19:11:39 2008 Data Channel MTU parms [L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1]
Sat Jul 19 19:11:39 2008 Local Options hash (VER=V4): '41690919'
Sat Jul 19 19:11:39 2008 Expected Remote Options hash (VER=V4): '530fdded'
Sat Jul 19 19:11:39 2008 UDPv4 link local: [undef]
Sat Jul 19 19:11:39 2008 UDPv4 link remote: 192.168.1.71:1194`

---

<div class="post-metadata">

**Author:** ![shell-boudeur](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@shell-boudeur](https://www.debian-fr.org/u/shell-boudeur)\
**Post date:** [Février 20, 2016, 5:53 UTC](https://www.debian-fr.org/t/resolu-ssh-et-open-vpn/14738/19 "2016-02-20T17:53:22Z")

</div>

youpy !!! j’ai enfin réussi ! 😃😃😃😃  
me reste encore à bien comprendre et maitriser le principe 😕

est-il possible de faire en sorte qu’il soit nécessaire d’avoir les certificats de sécurité et d’imposer un mot de passe ?
