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 10/04/2012, à 16:31

L0ph

[Résolu] serveur VPN refuse client (windows)

Bonjour,
pour faciliter la compréhension de mon problème, j'ai suivi ce tuto et j'ai passé toutes les étapes avec succè.

Avec le fichier de conf de base, j'ai obtenu un truc semblable à cette étape:

http://doc.ubuntu-fr.org/openvpn#demarr … nnectivite

Après, j'ai donc voulu mettre mon serveur dans le fichier de conf /etc/openvpn/server.conf

Et là..

sudo openvpn server.conf

ne me donne plus rien..

/etc/init.d/openvpn start

me donne ça:

* Starting virtual private network daemon(s)...                                                                                               
*   Autostarting VPN 'client'                                                                                                         [fail]

Ce que j'ai changé en gros ce sont les lignes suivantes:

#numéro du port utilisé
port 1595
#protocole de communication
proto udp
#type d'interface
dev tun
#emplacement du master CA
ca ca.crt
#emplacement du certificat du serveur
cert server.crt
#emplacement de la clé du serveur
key server.key
#emplacement du fichier Diffie-Hellman
dh dh1024.pem
#quelle sera l'adresse du réseau virtuel créé par le VPN
#l'adresse du serveur VPN sera ici 192.168.0.1
server 192.168.0.1 255.255.255.0
#quelle est la route pour communiquer, ici le réseau 192.168
push "route 192.168.0.1 255.255.255.0"
#
keepalive 10 120
#type d'encryptage des données
cipher AES-128-CBC
#activation de la compression
comp-lzo
#nombre maximum de clients autorisés
max-clients 10
#pas d'utilisateur et groupe particuliers pour l'utilisation du VPN
user nobody
group nobody
#pour rendre la connexion persistante
persist-key
persist-tun
#fichier de log
status openvpn-status.log
log openvpn.log
#niveau de verbosité
verb 5

En soit, je n'ai pas changé grand chose.. D'où mon incompréhension TOTALE!

Merci à ceux qui se pencherons sur le sujet.

Cordialement.

Dernière modification par L0ph (Le 13/04/2012, à 14:27)

Hors ligne

#2 Le 10/04/2012, à 18:40

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

J'ai résolu mon problème, un souci avec l'adresse.. Par contre j'ai des warning qui bloquent l'accès à mon svn..
Voici le résultat de la commande openvpn server.conf

Tue Apr 10 18:34:34 2012 OpenVPN 2.1.0 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [MH] [PF_INET6] [eurephia] built on Jul 20 2010
.....
WARNING: potential conflict between --local address [192.168.0.60] and --ifconfig address pair [192.168.0.1, 192.168.0.2] -- this is a warning only that is triggered when local/remote addresses exist within the same /24 subnet as --ifconfig endpoints. (silence this warning with --ifconfig-nowarn)
Tue Apr 10 18:34:34 2012 WARNING: potential TUN/TAP adapter subnet conflict between local LAN [192.168.0.0/255.255.255.0] and remote VPN [192.168.0.1/255.255.255.255]
.....
Tue Apr 10 18:34:34 2012 WARNING: potential route subnet conflict between local LAN [192.168.0.0/255.255.255.0] and remote VPN [192.168.0.0/255.255.255.0]
....
Tue Apr 10 18:34:34 2012 Initialization Sequence Completed

Hors ligne

#3 Le 11/04/2012, à 10:45

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

Salut,

Vous faites un VPN routé qui utilise le meme réseau que votre réseau local.
Soit vous faites un vpn niveau 2, en mode bridge si votre client doit avoir accès au réseau local.
Ou vous choisissez un autre sous réseau pour le vpn.

Hors ligne

#4 Le 11/04/2012, à 11:55

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

droopy191 a écrit :

Salut,

Vous faites un VPN routé qui utilise le meme réseau que votre réseau local.
Soit vous faites un vpn niveau 2, en mode bridge si votre client doit avoir accès au réseau local.
Ou vous choisissez un autre sous réseau pour le vpn.

Wow une réponse merci smile
J'allais répondre car j'ai en effet vu le même souci..
Mais je ne suis pas du tout un pro en VPN.. Malheuresement, donc en gros je veux accéder de l'exterieur à mon réseau local..
Je dois utiliser le mode bridge, mais je suis paumé avec les adresses. Mon serveur est en 192.168.0.60 et ma box en 192.168.0.1.

Dans le fichier de conf exemple du serveur, je dois juste décommenter et modifier la ligne suivante:

server-bridge 192.168.0.60 255.255.255.0 192.168.0.130 192.168.0.160

Si vous voulez mon pb à l'instant "T" c'est quand je connecte un client windows openvpn du même sous-réseau, sur mon serveur j'ai une boucle sur mon serveur.
Je ne suis même pas sur un autre réseau encore..

MULTI: multi_create_instance called
Wed Apr 11 12:16:26 2012 192.168.0.55:1566 Re-using SSL/TLS context
Wed Apr 11 12:16:26 2012 192.168.0.55:1566 LZO compression initialized
Wed Apr 11 12:16:26 2012 192.168.0.55:1566 Control Channel MTU parms [ L:1574 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Apr 11 12:16:26 2012 192.168.0.55:1566 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ]
Wed Apr 11 12:16:26 2012 192.168.0.55:1566 Local Options hash (VER=V4): '360696c5'
Wed Apr 11 12:16:26 2012 192.168.0.55:1566 Expected Remote Options hash (VER=V4): '13a273ba'
Wed Apr 11 12:16:26 2012 192.168.0.55:1566 TLS: Initial packet from [AF_INET]192.168.0.55:1566, sid=e9b36e14 f43e79f5

et ça boucle en incrémentant le port 1566, 1567 etc..

Merci en tout cas de l'intérêt porté au sujet.. Je suis carement bloqué.. Mais toujours motivé x)

Mon server.conf

#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients <-> one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine <-> single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194

# 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 ca.crt
cert server.crt
key 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 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 10.8.0.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 192.168.0.60 255.255.255.0 192.168.0.130 192.168.0.160

# configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# 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
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"

# 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 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 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

LE client.conf

##############################################
# 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.0.60 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 nogroup

# 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 client1.crt
key client1.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

Dernière modification par L0ph (Le 11/04/2012, à 13:14)

Hors ligne

#5 Le 11/04/2012, à 13:50

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

Commencez par faire un vpn routé, c'est le plus facile pour vérifier que la partie chiffrement est correctement configuré.

Par rapport à votre fichier de conf  posté initialement, modifiez le sous-réseau.

server  10.8.0.0 255.255.255.0

vérifiez que vous pouvez pinguer le serveur vpn dans ce réseau.

Vous ne pourrez pas tester votre vpn bridgé depuis le réseau interne.
Le vpn bridgé fera apparaitre le client comme si il était dans le lan.
Je vous guiderai pour la suite quand on aura vérifié le premier point.

Hors ligne

#6 Le 11/04/2012, à 16:05

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

J'ai changé mes 2 fichiers de conf et tout réinstallé... GROSSE erreur, plus rien ne tourne. Je lance mon serveur normalement, mon client et là mon client reste bloqué là..

Wed Apr 11 15:45:35 2012 UDPv4 link local: [undef]
Wed Apr 11 15:45:35 2012 UDPv4 link remote: [AF_INET]10.8.0.0:1194

Des idées?

Mes fichier de conf server

#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients <-> one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine <-> single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194

# 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 ca.crt
cert server.crt
key 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 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 10.8.0.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

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# 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
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"

# 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 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 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

Et client:

##############################################
# 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 10.8.0.0 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 nogroup

# 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 client.crt
key client.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

Dernière modification par L0ph (Le 11/04/2012, à 17:01)

Hors ligne

#7 Le 11/04/2012, à 17:11

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

La directive remote est incorrecte dans le fichier de conf client.
Il faut indiquer l'ip du serveur ( en dehors du vpn puisque l'on n'est pas encore connecté):
- pour votre test, l'ip lan 192.168.0.60
- en production, l'ip wan de la box avec une  redirection de port qui va bien

Hors ligne

#8 Le 11/04/2012, à 17:36

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

C'est juste... Maintenant j'ai des erreurs que j'avais à mes premiers pas..

Wed Apr 11 17:47:37 2012 MULTI: multi_create_instance called
Wed Apr 11 17:47:37 2012 192.168.0.60:52418 Re-using SSL/TLS context
Wed Apr 11 17:47:37 2012 192.168.0.60:52418 LZO compression initialized
Wed Apr 11 17:47:37 2012 192.168.0.60:52418 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Apr 11 17:47:37 2012 192.168.0.60:52418 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Apr 11 17:47:37 2012 192.168.0.60:52418 Local Options hash (VER=V4): '14168603'
Wed Apr 11 17:47:37 2012 192.168.0.60:52418 Expected Remote Options hash (VER=V4): '504e774e'
Wed Apr 11 17:47:37 2012 192.168.0.60:52418 TLS: Initial packet from [AF_INET]192.168.0.60:52418, sid=dbaaa399 bd49a13e
Wed Apr 11 17:47:39 2012 MULTI: multi_create_instance called
Wed Apr 11 17:47:39 2012 192.168.0.60:35785 Re-using SSL/TLS context
Wed Apr 11 17:47:39 2012 192.168.0.60:35785 LZO compression initialized
Wed Apr 11 17:47:39 2012 192.168.0.60:35785 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Apr 11 17:47:39 2012 192.168.0.60:35785 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Apr 11 17:47:39 2012 192.168.0.60:35785 Local Options hash (VER=V4): '14168603'
Wed Apr 11 17:47:39 2012 192.168.0.60:35785 Expected Remote Options hash (VER=V4): '504e774e'
Wed Apr 11 17:47:39 2012 192.168.0.60:35785 TLS: Initial packet from [AF_INET]192.168.0.60:35785, sid=02efdb27 5d6bdd45
Wed Apr 11 17:47:39 2012 192.168.0.60:52418 write UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Apr 11 17:47:39 2012 192.168.0.60:52418 write UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Apr 11 17:47:41 2012 192.168.0.60:52418 write UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Apr 11 17:47:41 2012 192.168.0.60:52418 write UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Apr 11 17:47:41 2012 192.168.0.60:35785 write UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Apr 11 17:47:41 2012 192.168.0.60:35785 write UDPv4 [ECONNREFUSED]: Connection refused (code=111)

etc..

chez mon client

....
...
Wed Apr 11 17:47:49 2012 UDPv4 link remote: [AF_INET]192.168.0.60:1594
Wed Apr 11 17:47:49 2012 read UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Apr 11 17:47:52 2012 read UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Apr 11 17:47:54 2012 read UDPv4 [ECONNREFUSED]: Connection refused (code=111)

En tout cas merci de ton aide, c'est grâce à des gens comme toi que j'ai envi de me lancer à la découverte du monde du libre.. Même si c'est pas toujours simple x)

Dernière modification par L0ph (Le 11/04/2012, à 17:54)

Hors ligne

#9 Le 11/04/2012, à 18:01

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

Je pense que c'est du à une mauvaise commande.. je vais regénérer mes certifs.

Edit

Après avoir regénéré les certif, j'ai l'erreur qui me les a fait perdre...

Wed Apr 11 18:04:18 2012 MULTI: multi_create_instance called
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 Re-using SSL/TLS context
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 LZO compression initialized
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 Control Channel MTU parms [ L:1542 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 Local Options hash (VER=V4): '14168603'
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 Expected Remote Options hash (VER=V4): '504e774e'
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 TLS: Initial packet from [AF_INET]192.168.0.60:53203, sid=22b14b4c 0ff4b0fb
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 VERIFY ERROR: depth=0, error=unable to get local issuer certificate: /C=FR/ST=FR/L=Paris/O=xxxxx/OU=dev/CN=client/name=client/emailAddress=clangxxx@xxx.com
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 TLS_ERROR: BIO read tls_read_plaintext error: error:140890B2:SSL routines:SSL3_GET_CLIENT_CERTIFICATE:no certificate returned
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 TLS Error: TLS object -> incoming plaintext read error
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 TLS Error: TLS handshake failed
Wed Apr 11 18:04:18 2012 192.168.0.60:53203 SIGUSR1[soft,tls-error] received, client-instance restarting

Pourtant dans mes fichiers de conf les lignes tls ne sont pas en commentaire..

root@serveur:/etc/openvpn# cat client.conf | grep tls
# If a tls-auth key is used on the server
tls-auth ta.key 1
root@serveur:/etc/openvpn# cat server.conf | grep tls
tls-auth ta.key 0 # This file is secret

[EDIT] J'ai résolu le problème en regénérant les certifs client qui n'avaient pas la meme "O" que le serveur.. tout bête bref j'ai bien Initialization Sequence Completed
chez le client maintenant.. DONC, on peut passer à la suite maintenant que ça fonction dans mon sous-réseau? roll
Super sympa encore de m'aider pas à pas..

edit encore..

J'ai oublié de préciser que j'arrivais à pinger depuis mon client windows mon vpn ubuntu

Dernière modification par L0ph (Le 11/04/2012, à 18:29)

Hors ligne

#10 Le 11/04/2012, à 18:47

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

bravo d'avoir résolu ca tout seul.
Pinguez vous la bonne ip ?
depuis le client

ipconfig /all
ping 10.8.0.1

Pas de firewall sur le serveur ?

Dernière modification par droopy191 (Le 11/04/2012, à 18:47)

Hors ligne

#11 Le 11/04/2012, à 18:53

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

Voici la suite lorsque le ping marchera

4 points de préparation/recommendations:
- accès physique au serveur nécessaire car on pourrait couper l'accès réseau ( impératif en cas de fausse manip )
- les tests de connexion client ne peuvent pas marcher depuis le lan ( demander à votre voisine de vous prêter l'accès à son wifi wink  )
- ce serait aussi le bon moment de changer le réseau de votre lan ( pas indispensable mais lorsque vous connecterez depuis l'exterieur, vous risquez d'etre aussi dans un lan de réseau 192.168.0.0/24 ).
Prenez par exemple 192.168.100.0/24 -> voir votre box et modif des machines de votre lan au besoin.
- Réservez une plage ip pour le vpn sur votre box. Par exemple, réglez le dhcp pour atribuer des ips entre 192.168.100.70 et 100, nous utiliserons 192.168.100.101 à 150 pour le vpn

Dernière modification par droopy191 (Le 11/04/2012, à 19:18)

Hors ligne

#12 Le 11/04/2012, à 19:17

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

Ensuite

Modifiez le fichier /etc/default/openvpn
pour empecher le démarrage automatique du vpn

AUTOSTART="none"

installez le paquet bridge-utils

apt-get install bridge-utils

adaptez votre /etc/network/interface

auto eth0
iface eth0 inet manual

# bridge eth0 sur br0 pour Openvpn
auto br0
iface br0 inet static
        address 192.168.100.60
        netmask 255.255.255.0
        broadcast 192.168.100.255
        gateway 192.168.100.1
        pre-up /etc/openvpn/bridge.sh br0 eth0 tap0 up && /etc/init.d/openvpn start server.conf
        pre-down /etc/init.d/openvpn stop
        post-down /etc/openvpn/bridge.sh br0 eth0 tap0 down

le script de pontage dans /etc/openvpn/bridge.sh
le script n'a pas besoin d'etre modifié, adaptez au besoin les paramètres de lancement dans /etc/network/interface.
le rendre executable par chmod +x

# ex:   BRIDGE br0 eth0 tap0 up

BRIDGE=$1
ETH_interface=$2
VPN_interface=$3
updown=$4

case $updown in
"up")
openvpn --mktun --dev $VPN_interface
brctl addbr $BRIDGE
brctl addif $BRIDGE $ETH_interface
brctl addif $BRIDGE $VPN_interface
ifconfig $ETH_interface promisc up
ifconfig $VPN_interface promisc up
;;
"down")
brctl delif $BRIDGE $ETH_interface
brctl delif $BRIDGE $VPN_interface
openvpn --rmtun --dev $VPN_interface
brctl delbr $BRIDGE
;;
esac

modif du fichier de conf vpn serveur

#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients <-> one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine <-> single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194

# 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 tap0
;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 ca.crt
cert server.crt
key 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 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 10.8.0.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 192.168.100.60 255.255.255.0 192.168.100.101 192.168.100.150

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# 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
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"

# 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 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 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

Ensuite stoppez openvpn, puis redémarrer le réseau, et voyez si ca marche:
ifconfig, accès réseau du serveur, logs

Dernière modification par droopy191 (Le 12/04/2012, à 10:45)

Hors ligne

#13 Le 12/04/2012, à 10:14

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

droopy191 a écrit :

- ce serait aussi le bon moment de changer le réseau de votre lan ( pas indispensable mais lorsque vous connecterez depuis l'exterieur, vous risquez d'etre aussi dans un lan de réseau 192.168.0.0/24 ).
Prenez par exemple 192.168.100.0/24 -> voir votre box et modif des machines de votre lan au besoin.

Petit souci, c'est en dur dans la box hmm et impossible de faire une réservation. Je peux donner l'adresse de début.. Mais pas l'adresse de fin.
Vive numericable...

;tls-auth ta.key 0 # This file is secret

C'est commenté et je l'avais décommenté pour résoudre un problème.. Je dois la recommenter?

PS: Pas de souci pour la voisine tongue

EDIT

Avec la config et après un reboot.. pas d'accès internet sur le serveur.. Vu que le serveur est aussi serveur svn je reprend l'ancienne config, quand je faisais un ifconfig, je n'avais pas d'adresse ipv4.. cela me disais qu'il y avait des conflits..

Dernière modification par L0ph (Le 12/04/2012, à 10:42)

Hors ligne

#14 Le 12/04/2012, à 10:50

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

L0ph a écrit :
droopy191 a écrit :

- ce serait aussi le bon moment de changer le réseau de votre lan ( pas indispensable mais lorsque vous connecterez depuis l'exterieur, vous risquez d'etre aussi dans un lan de réseau 192.168.0.0/24 ).
Prenez par exemple 192.168.100.0/24 -> voir votre box et modif des machines de votre lan au besoin.

Petit souci, c'est en dur dans la box hmm et impossible de faire une réservation. Je peux donner l'adresse de début.. Mais pas l'adresse de fin.
Vive numericable...

dommage de ne pas pouvoir changer le sous réseau.Vous risquez d'avoir des conflits dans pas mal de réseaux.
Si vous pouvez paramétrer l'adresse de début, cela indique peut etre que les adresses inférieures ne sont pas utilisées par le dhcp ?
exemple: adresse de début 192.168.0.150 -> plage dhcp jusqu'a 192.168.0254 ?

L0ph a écrit :
;tls-auth ta.key 0 # This file is secret

C'est commenté et je l'avais décommenté pour résoudre un problème.. Je dois la recommenter?

non, c'est une erreur de ma part laissez le décommenté.

L0ph a écrit :

EDIT
Avec la config et après un reboot.. pas d'accès internet sur le serveur.. Vu que le serveur est aussi serveur svn je reprend l'ancienne config, quand je faisais un ifconfig, je n'avais pas d'adresse ipv4.. cela me disais qu'il y avait des conflits..

que donne ifconfig ? voyez vous le bridge ?
regardez les logs

Hors ligne

#15 Le 12/04/2012, à 13:44

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

droopy191 a écrit :

que donne ifconfig ? voyez vous le bridge ?
regardez les logs

Un ifconfig me donne ça:

eth0      Link encap:Ethernet  HWaddr 00:1e:c9:50:ae:b2  
          inet6 addr: fe80::21e:c9ff:fe50:aeb2/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:208 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:21716 (21.7 KB)  TX bytes:492 (492.0 B)
          Interrupt:19 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:152 errors:0 dropped:0 overruns:0 frame:0
          TX packets:152 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:12797 (12.7 KB)  TX bytes:12797 (12.7 KB)

tap0      Link encap:Ethernet  HWaddr fe:62:77:3b:35:40  
          inet6 addr: fe80::fc62:77ff:fe3b:3540/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:6 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Quand je fais cat /var/log/daemon.log | grep vpn
je n'ai pas d'erreur suite au changment de config, à cette heure là, je ne sais pas si ce sont les bons logs x)

EDIT

droopy191 a écrit :

Si vous pouvez paramétrer l'adresse de début, cela indique peut etre que les adresses inférieures ne sont pas utilisées par le dhcp ?
exemple: adresse de début 192.168.0.150 -> plage dhcp jusqu'a 192.168.0254 ?

Je pense que oui..

Dernière modification par L0ph (Le 12/04/2012, à 14:19)

Hors ligne

#16 Le 12/04/2012, à 14:03

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

on va faire plus simple pour débuguer

auto br0
iface br0 inet static
        address 192.168.100.60
        netmask 255.255.255.0
        broadcast 192.168.100.255
        gateway 192.168.100.1
        pre-up /etc/openvpn/bridge.sh br0 eth0 tap0 up 
        post-down /etc/openvpn/bridge.sh br0 eth0 tap0 down

Hors ligne

#17 Le 12/04/2012, à 14:36

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

droopy191 a écrit :

on va faire plus simple pour débuguer

auto br0
iface br0 inet static
        address 192.168.100.60
        netmask 255.255.255.0
        broadcast 192.168.100.255
        gateway 192.168.100.1
        pre-up /etc/openvpn/bridge.sh br0 eth0 tap0 up 
        post-down /etc/openvpn/bridge.sh br0 eth0 tap0 down

En gros j'ai commenté la ligne pre-down c'est ça?
voilà ce que cela me donne quand je restart le service réseau.

 * Reconfiguring network interfaces...                                                                                                        
ssh stop/waiting
ssh start/running, process 3240
.: 44: Can't open /usr/share/sendmail/dynamic
run-parts: /etc/network/if-up.d/sendmail exited with return code 2
Thu Apr 12 14:29:58 2012 TUN/TAP device tap0 opened
Thu Apr 12 14:29:58 2012 Persist state set to: ON
 * Starting virtual private network daemon(s)...
 *   Starting VPN 'server.conf': missing /etc/openvpn/server.conf.conf file !
Failed to bring up br0.

server.conf.conf.. ??? normal qu'il n'existe pas de conf.conf.. c'est juste un .conf XD

EDIT
j'ai oublié d'enlever cette partie de ligne && /etc/init.d/openvpn start server.conf
Je vais tester en la retirant, même si je pense que le souci du conf.conf était déjà là la première fois et je ne l'ai pas vu.

Dernière modification par L0ph (Le 12/04/2012, à 14:39)

Hors ligne

#18 Le 12/04/2012, à 14:44

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

En commentant && /etc/init.d/openvpn start server.conf

Edit: La commande en passant ce n'est pas juste /etc/init.d/openvpn start?

cela fonctionne, je retrouve internet.

Un if config:

br0       Link encap:Ethernet  HWaddr 00:1e:c9:50:ae:b2  
          inet addr:192.168.0.60  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:c9ff:fe50:aeb2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:442 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:91597 (91.5 KB)  TX bytes:4103 (4.1 KB)

eth0      Link encap:Ethernet  HWaddr 00:1e:c9:50:ae:b2  
          inet addr:192.168.0.60  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:c9ff:fe50:aeb2/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:5857 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3619 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1548583 (1.5 MB)  TX bytes:594902 (594.9 KB)
          Interrupt:19 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:897 errors:0 dropped:0 overruns:0 frame:0
          TX packets:897 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:119502 (119.5 KB)  TX bytes:119502 (119.5 KB)

tap0      Link encap:Ethernet  HWaddr ba:2b:bf:ff:d9:2e  
          inet6 addr: fe80::b82b:bfff:feff:d92e/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:218 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Mon /etc/network/interfaces pour récap:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0
iface eth0 inet manual

# bridge eth0 sur br0 pour Openvpn
auto br0
iface br0 inet static
        address 192.168.0.60
        netmask 255.255.255.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
        pre-up /etc/openvpn/bridge.sh br0 eth0 tap0 up #&& /etc/init.d/openvpn start server.conf
#        pre-down /etc/init.d/openvpn stop
        post-down /etc/openvpn/bridge.sh br0 eth0 tap0 down

Dernière modification par L0ph (Le 12/04/2012, à 14:47)

Hors ligne

#19 Le 12/04/2012, à 15:12

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

la partie bridge est ok, br0 récupère bien l'adresse ip.


dans la ligne
/etc/init.d/openvpn start server.conf

server.conf est le nom du ficier de configuration vpn du serveur ( remplacez par le bon).
il faut le préciser puisque l'on a desactivé le démarrage auto de tous les vpns ( afin de jouer avec le bridge ).

Dernière modification par droopy191 (Le 12/04/2012, à 15:13)

Hors ligne

#20 Le 12/04/2012, à 15:18

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

droopy191 a écrit :

la partie bridge est ok, br0 récupère bien l'adresse ip.


dans la ligne
/etc/init.d/openvpn start server.conf

server.conf est le nom du ficier de configuration vpn du serveur ( remplacez par le bon).
il faut le préciser puisque l'on a desactivé le démarrage auto de tous les vpns ( afin de jouer avec le bridge ).

C'est le bon smile

Quand je fait un ls dans /etc/openvpn, cela me retourne entre autre mon fichier de conf.

bridge.sh  .....  [b]server.conf[/b]  server.key
ca.crt     server.crt   ta.key

server.conf.conf n'existe pas normal, je ne vois pas pourquoi la commande rajoute un .conf à l'extension

Et quand le serveur vpn est lancé, le svn n'est plus accessible.. Je ne sais pas comment résoudre ce problème.. En y réfléchissant.. Je partage une seule et même adresse serveur, j'ai un vpn et un svn qui tournent ensemble, c'est normal que ça ne colle pas mais je ne vois pas comment résoudre ça.. Enfin ça c'est un autre problème, à voir une fois que le vpn tourne..

Dernière modification par L0ph (Le 12/04/2012, à 18:34)

Hors ligne

#21 Le 12/04/2012, à 18:33

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

L0ph a écrit :

Quand je fait un ls dans /etc/openvpn, cela me retourne entre autre mon fichier de conf.

bridge.sh  .....  [b]server.conf[/b]  server.key
ca.crt     server.crt   ta.key

server.conf.conf n'existe pas normal, je ne vois pas pourquoi la commande rajoute un .conf à l'extension

Je viens de vérifier sur ma machine le paramètre du nom de vpn est sans extension big_smile
Désolé pour cette erreur
donc si le nom du fichier de conf est server.conf
on lance dans le fichier interfaces par

/etc/init.d/openvpn start server

la fin du démarrage correct du serveur vpn se traduit par une ligne similaire dans les logs

Apr 12 14:01:10 ebox ovpn-ebox-bridge[24245]: Initialization Sequence Completed
L0ph a écrit :

Et quand le serveur vpn est lancé, le svn n'est plus accessible.. Normal? Ce ne sont pas les même ports.. Enfin ça c'est un autre problème, à voir une fois que le vpn tourne..

Je ne connais pas ce genre de services mais c'est anormal. Je regarderais l'interface en écoute. Désormais c'est br0 et plus eth0. N'y a t'il pas un paramètre qui force l'écoute sur eth0 ou un filtre sur le fierwall ?

Dernière modification par droopy191 (Le 12/04/2012, à 18:34)

Hors ligne

#22 Le 12/04/2012, à 18:59

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

Bon alors déjà, tu es mon dieu du vpn lol
Je n'avais même pas essayé ça -,-

En tout cas j'ai eu un autre souci avec le bridge que j'ai résolu.. J'avais donné la plage 192.168.100.101 à 150.
Super copier/coller mon réseau c'est 192.168.0.X.. ^^

Bref, en gros j'ai eu la ligne:

Initialization Sequence Completed

(j'ai sorti le champagne)

J'ai reboot et j'ai retrouvé mon svn. Mon ifconfig me donne ça.

br0       Link encap:Ethernet  HWaddr 00:1e:c9:50:ae:b2  
          inet addr:192.168.0.60  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:c9ff:fe50:aeb2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:117 errors:0 dropped:0 overruns:0 frame:0
          TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:40397 (40.3 KB)  TX bytes:15686 (15.6 KB)

eth0      Link encap:Ethernet  HWaddr 00:1e:c9:50:ae:b2  
          inet6 addr: fe80::21e:c9ff:fe50:aeb2/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:181 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:48379 (48.3 KB)  TX bytes:8255 (8.2 KB)
          Interrupt:19 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:176 errors:0 dropped:0 overruns:0 frame:0
          TX packets:176 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:15049 (15.0 KB)  TX bytes:15049 (15.0 KB)

tap0      Link encap:Ethernet  HWaddr c6:d1:0f:20:66:fb  
          inet6 addr: fe80::c4d1:fff:fe20:66fb/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:54 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

maintenant j'ai fait quelques modif dans le client.conf:

##############################################
# 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 tap0
#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.0.60 1594
;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 nogroup

# 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 client.crt
key client.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

Je me perd un peu dans les logs, mais c'est bien les syslog qu'il faut regarder?

Hors ligne

#23 Le 12/04/2012, à 19:06

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

J'arrive à me connecter depuis mon lcient windows, mais je suis encore dans le même sous-réseau par contre.
Dans un réseaux exterieur, mon serveur me répond:

Thu Apr 12 19:04:46 2012 read UDPv4 [EHOSTUNREACH|EHOSTUNREACH|EHOSTUNREACH]: No route to host (code=113)

Et mon Client est en attente..

Hors ligne

#24 Le 12/04/2012, à 19:18

droopy191

Re : [Résolu] serveur VPN refuse client (windows)

L0ph a écrit :

J'arrive à me connecter depuis mon lcient windows, mais je suis encore dans le même sous-réseau par contre.
Dans un réseaux exterieur, mon serveur me répond:

Thu Apr 12 19:04:46 2012 read UDPv4 [EHOSTUNREACH|EHOSTUNREACH|EHOSTUNREACH]: No route to host (code=113)

Et mon Client est en attente..

Avez vous bien le "Initialization Sequence Completed" aussi chez le client ( c'est bien dans syslog qu'il faut chercher) ?
Quel est l'adresse ip du client dans le lan du voisin ?

Hors ligne

#25 Le 13/04/2012, à 09:20

L0ph

Re : [Résolu] serveur VPN refuse client (windows)

droopy191 a écrit :

Avez vous bien le "Initialization Sequence Completed" aussi chez le client ( c'est bien dans syslog qu'il faut chercher) ?
Quel est l'adresse ip du client dans le lan du voisin ?

le client voisin est en 192.168.1.x

J'ai bien le "Initialization Sequence Completed" quand je me connecte avec un client de mon propre sous-réseau, mais pas du réseau voisin.

Hors ligne