<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://lea-linux.org/docs/index.php?action=history&amp;feed=atom&amp;title=VPN_par_la_pratique_OpenVPN_Stunnel</id>
	<title>VPN par la pratique OpenVPN Stunnel - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://lea-linux.org/docs/index.php?action=history&amp;feed=atom&amp;title=VPN_par_la_pratique_OpenVPN_Stunnel"/>
	<link rel="alternate" type="text/html" href="https://lea-linux.org/docs/index.php?title=VPN_par_la_pratique_OpenVPN_Stunnel&amp;action=history"/>
	<updated>2026-05-02T05:40:43Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://lea-linux.org/docs/index.php?title=VPN_par_la_pratique_OpenVPN_Stunnel&amp;diff=45221&amp;oldid=prev</id>
		<title>Lea le 27 décembre 2023 à 17:06</title>
		<link rel="alternate" type="text/html" href="https://lea-linux.org/docs/index.php?title=VPN_par_la_pratique_OpenVPN_Stunnel&amp;diff=45221&amp;oldid=prev"/>
		<updated>2023-12-27T17:06:40Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 27 décembre 2023 à 17:06&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Ligne 1 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 1 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Sécurité]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= VPN par la pratique =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= VPN par la pratique =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Par [[Utilisateur:Jiel|Jiel]] et [[Utilisateur:amnesiak|Tony]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Par [[Utilisateur:Jiel|Jiel]] et [[Utilisateur:amnesiak|Tony]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l720&quot;&gt;Ligne 720 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 718 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;&amp;lt;b&amp;gt;[[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Reseau-index&lt;/del&gt;|@ Retour à la rubrique &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Réseau &lt;/del&gt;et &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sécurité&lt;/del&gt;]]&amp;lt;/b&amp;gt;&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;&amp;lt;b&amp;gt;[[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Sécurité et vie privée&lt;/ins&gt;|@ Retour à la rubrique &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Sécurité &lt;/ins&gt;et &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vie privée&lt;/ins&gt;]]&amp;lt;/b&amp;gt;&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Copy|2006, 2010|[[Utilisateur:Jiel|Jiel Beaumadier]] et [[Utilisateur:amnesiak|Tony Cheneau]]|FDL}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Copy|2006, 2010|[[Utilisateur:Jiel|Jiel Beaumadier]] et [[Utilisateur:amnesiak|Tony Cheneau]]|FDL}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Catégorie:Sécurité et vie privée]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lea</name></author>
	</entry>
	<entry>
		<id>https://lea-linux.org/docs/index.php?title=VPN_par_la_pratique_OpenVPN_Stunnel&amp;diff=18203&amp;oldid=prev</id>
		<title>Jiel : Page créée avec « Category:Sécurité  = VPN par la pratique = Par Jiel et Tony  == 1.1 OpenVPN : Installation et création ==  ===1. Installa... »</title>
		<link rel="alternate" type="text/html" href="https://lea-linux.org/docs/index.php?title=VPN_par_la_pratique_OpenVPN_Stunnel&amp;diff=18203&amp;oldid=prev"/>
		<updated>2010-10-25T12:50:31Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « &lt;a href=&quot;/documentations/Cat%C3%A9gorie:S%C3%A9curit%C3%A9&quot; title=&quot;Catégorie:Sécurité&quot;&gt;Category:Sécurité&lt;/a&gt;  = VPN par la pratique = Par &lt;a href=&quot;/documentations/Utilisateur:Jiel&quot; title=&quot;Utilisateur:Jiel&quot;&gt;Jiel&lt;/a&gt; et &lt;a href=&quot;/documentations/Utilisateur:Amnesiak&quot; title=&quot;Utilisateur:Amnesiak&quot;&gt;Tony&lt;/a&gt;  == 1.1 OpenVPN : Installation et création ==  ===1. Installa... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Sécurité]]&lt;br /&gt;
&lt;br /&gt;
= VPN par la pratique =&lt;br /&gt;
Par [[Utilisateur:Jiel|Jiel]] et [[Utilisateur:amnesiak|Tony]]&lt;br /&gt;
&lt;br /&gt;
== 1.1 OpenVPN : Installation et création ==&lt;br /&gt;
&lt;br /&gt;
===1. Installation d&amp;#039;OpenVPN===&lt;br /&gt;
&lt;br /&gt;
Comme nous n&amp;#039;avons pas Internet sur nos clients/serveurs de test, on [[Software-soft_gere-installation_logiciel|installe]] OpenVPN à la main sur notre [[Essayer_GNU/Linux_sans_l&amp;#039;installer|Live CD]] [[Install-index#Ubuntu|Ubuntu]] :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:~/tp_VPN# dpkg -i openvpn_2.0.6-1_i386.deb&lt;br /&gt;
 Selecting previously deselected package openvpn.&lt;br /&gt;
 (Reading database ... 76142 files and directories currently installed.)&lt;br /&gt;
 Unpacking openvpn (from openvpn_2.0.6-1_i386.deb) ...&lt;br /&gt;
 Setting up openvpn (2.0.6-1) ...&lt;br /&gt;
 Restarting virtual private network daemon:.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
A noter que si l&amp;#039;on avait eu un accès au net, la technique suivante aurait suffit :&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 apt-get update &amp;amp;&amp;amp; apt-get install openvpn&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===2. Préparation du serveur===&lt;br /&gt;
&lt;br /&gt;
On prépare les certificats et les clefs :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:~/tp_VPN# cd /usr/share/doc/openvpn/examples/easy-rsa/2.0&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0# gzip -d pkitool.gz&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On décompresse les outils pour générer les clefs :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0# chmod 777 pkitool&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On donne tous les droits au repertoire pkitool :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0# source ./vars&lt;br /&gt;
 NOTE: If you run ./clean-all, I will be doing a rm -rf on /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On exécute le script vars et charge les variables d&amp;#039;environnement :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 easy-rsa/2.0# ./clean-all&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On génère le certificat du CA. Ce certificat permettra de signer le certificat de tous nos clients et celui du serveur. Grâce à lui, on pourra rajouter autant de clients qu&amp;#039;on le souhaite pour se brancher sur notre serveur.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0# ./build-ca&lt;br /&gt;
 Generating a 1024 bit RSA private key&lt;br /&gt;
 ................++++++&lt;br /&gt;
 ......++++++&lt;br /&gt;
 writing new private key to &amp;#039;ca.key&amp;#039;&lt;br /&gt;
 -----&lt;br /&gt;
 You are about to be asked to enter information that will be incorporated&lt;br /&gt;
 into your certificate request.&lt;br /&gt;
 What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
 There are quite a few fields but you can leave some blank&lt;br /&gt;
 For some fields there will be a default value,&lt;br /&gt;
 If you enter &amp;#039;.&amp;#039;, the field will be left blank.&lt;br /&gt;
 -----&lt;br /&gt;
 Country Name (2 letter code) [US]:FR&lt;br /&gt;
 State or Province Name (full name) [CA]:94&lt;br /&gt;
 Locality Name (eg, city) [SanFrancisco]:Creteil&lt;br /&gt;
 Organization Name (eg, company) [Fort-Funston]:Paris12&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Master2SSI&lt;br /&gt;
 Common Name (eg, your name or your server&amp;#039;s hostname) [Fort-Funston CA]:ABC&lt;br /&gt;
 Email Address [me@myhost.mydomain]:root@localhost&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/&lt;br /&gt;
 &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On génère maintenant le certificat pour le serveur :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 easy-rsa/2.0# ./build-key-server server1&lt;br /&gt;
 Generating a 1024 bit RSA private key&lt;br /&gt;
 .................................++++++&lt;br /&gt;
 ..++++++&lt;br /&gt;
 writing new private key to &amp;#039;server1.key&amp;#039;&lt;br /&gt;
 -----&lt;br /&gt;
 You are about to be asked to enter information that will be incorporated&lt;br /&gt;
 into your certificate request.&lt;br /&gt;
 What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
 There are quite a few fields but you can leave some blank&lt;br /&gt;
 For some fields there will be a default value,&lt;br /&gt;
 If you enter &amp;#039;.&amp;#039;, the field will be left blank.&lt;br /&gt;
 -----&lt;br /&gt;
 Country Name (2 letter code) [US]:FR&lt;br /&gt;
 State or Province Name (full name) [CA]:94&lt;br /&gt;
 Locality Name (eg, city) [SanFrancisco]:Creteil&lt;br /&gt;
 Organization Name (eg, company) [Fort-Funston]:Paris12&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Master2SSI&lt;br /&gt;
 Common Name (eg, your name or your server&amp;#039;s hostname) [server1]:server1&lt;br /&gt;
 Email Address [me@myhost.mydomain]:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &amp;#039;extra&amp;#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
 Using configuration from /usr/share/doc/openvpn/examples/easy-rsa/2.0/openssl.cnf&lt;br /&gt;
 Check that the request matches the signature&lt;br /&gt;
 Signature ok&lt;br /&gt;
 The Subject&amp;#039;s Distinguished Name is as follows&lt;br /&gt;
 countryName           :PRINTABLE:&amp;#039;FR&amp;#039;&lt;br /&gt;
 stateOrProvinceName   :PRINTABLE:&amp;#039;94&amp;#039;&lt;br /&gt;
 localityName          :PRINTABLE:&amp;#039;Creteil&amp;#039;&lt;br /&gt;
 organizationName      :PRINTABLE:&amp;#039;Paris12&amp;#039;&lt;br /&gt;
 organizationalUnitName:PRINTABLE:&amp;#039;Master2SSI&amp;#039;&lt;br /&gt;
 commonName            :PRINTABLE:&amp;#039;server1&amp;#039;&lt;br /&gt;
 emailAddress          :IA5STRING:&amp;#039;me@myhost.mydomain&amp;#039;&lt;br /&gt;
 Certificate is to be certified until Mar 26 02:30:21 2018 GMT (3650 days)&lt;br /&gt;
 Sign the certificate? [y/n]:y&lt;br /&gt;
  &lt;br /&gt;
 1 out of 1 certificate requests certified, commit? [y/n]y&lt;br /&gt;
 Write out database with 1 new entries&lt;br /&gt;
 Data Base Updated&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0#&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. Vérification du certificat===&lt;br /&gt;
&lt;br /&gt;
On vérifie le certificat créé pour le serveur server1 (on fera de même pour celui du client1 quand il sera créé) :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0# openssl x509 -in keys/server1.crt -noout -text&lt;br /&gt;
 Certificate:&lt;br /&gt;
     Data:&lt;br /&gt;
         Version: 3 (0x2)&lt;br /&gt;
         Serial Number: 1 (0x1)&lt;br /&gt;
         Signature Algorithm: md5WithRSAEncryption&lt;br /&gt;
         Issuer: C=FR, ST=94, L=Creteil, O=Paris12, OU=Master2SSI, CN=ABC/emailAddress=root@localhost&lt;br /&gt;
         Validity&lt;br /&gt;
            Not Before: Mar 28 02:30:21 2008 GMT&lt;br /&gt;
            Not After : Mar 26 02:30:21 2018 GMT&lt;br /&gt;
         Subject: C=FR, ST=94, L=Creteil, O=Paris12, OU=Master2SSI, CN=server1/emailAddress=me@myhost.mydomain&lt;br /&gt;
         Subject Public Key Info:&lt;br /&gt;
             Public Key Algorithm: rsaEncryption&lt;br /&gt;
             RSA Public Key: (1024 bit)&lt;br /&gt;
                 Modulus (1024 bit):&lt;br /&gt;
                     00:ee:d5:69:63:88:68:3e:54:27:b0:cd:34:88:66:&lt;br /&gt;
                     1f:8f:b5:4f:3d:ca:72:c0:67:09:82:2c:1c:4a:f4:&lt;br /&gt;
                     66:11:8d:e7:33:f4:26:8d:9f:c1:61:54:72:98:b9:&lt;br /&gt;
                     b8:a3:b4:7f:42:6a:7f:28:71:48:f9:5a:b5:e9:11:&lt;br /&gt;
                     38:7f:20:97:e2:d3:2c:86:2d:98:d2:07:4b:18:5b:&lt;br /&gt;
                     ff:4f:30:24:74:86:a4:35:3b:bd:94:dc:67:af:8c:&lt;br /&gt;
                     35:6a:41:4a:dc:94:cd:34:a9:49:54:75:1c:73:d2:&lt;br /&gt;
                     ee:bd:12:78:ec:64:62:1a:09:d5:d0:70:1f:1e:fb:&lt;br /&gt;
                     16:b3:fe:25:be:77:15:f3:df&lt;br /&gt;
                 Exponent: 65537 (0x10001)&lt;br /&gt;
         X509v3 extensions:&lt;br /&gt;
             X509v3 Basic Constraints:&lt;br /&gt;
                 CA:FALSE&lt;br /&gt;
             Netscape Cert Type:&lt;br /&gt;
                 SSL Server&lt;br /&gt;
             Netscape Comment:&lt;br /&gt;
                 OpenSSL Generated Server Certificate&lt;br /&gt;
             X509v3 Subject Key Identifier:&lt;br /&gt;
                 AA:43:74:87:31:76:63:D5:04:97:62:40:13:F7:9E:AB:15:34:19:C3&lt;br /&gt;
             X509v3 Authority Key Identifier:&lt;br /&gt;
                 keyid:67:92:22:44:BC:33:B9:C8:FF:69:96:11:C5:39:0D:64:03:29:DF:60&lt;br /&gt;
                 DirName:/C=FR/ST=94/L=Creteil/O=Paris12/OU=Master2SSI/CN=ABC/emailAddress=root@localhost&lt;br /&gt;
                 serial:E7:B7:58:95:0C:72:DA:ED&lt;br /&gt;
 &lt;br /&gt;
             X509v3 Extended Key Usage:&lt;br /&gt;
                 TLS Web Server Authentication&lt;br /&gt;
             X509v3 Key Usage:&lt;br /&gt;
                 Digital Signature, Key Encipherment&lt;br /&gt;
     Signature Algorithm: md5WithRSAEncryption&lt;br /&gt;
         b2:e9:fe:fd:78:c8:5d:da:e0:34:db:91:f6:43:27:53:59:02:&lt;br /&gt;
         53:07:c0:ec:f9:ca:73:82:5d:62:db:d4:88:56:f5:72:b4:1b:&lt;br /&gt;
         c3:3d:c4:a3:59:b2:c2:8d:9f:62:85:8f:5c:c9:4c:a9:f5:27:&lt;br /&gt;
         f9:17:cb:30:23:37:35:c0:72:56:5c:5a:f9:72:c9:28:b3:9f:&lt;br /&gt;
         fd:b7:d1:9f:e4:a0:e2:1c:e4:33:c5:86:b2:8c:46:aa:18:2a:&lt;br /&gt;
         72:9a:3f:2d:49:d4:74:f6:8a:18:99:fa:7a:94:fa:29:a2:5a:&lt;br /&gt;
         21:07:70:e1:fc:fd:70:05:1a:99:47:d7:4b:05:7d:ba:0c:7e:&lt;br /&gt;
         42:1a&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0#&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===4. Création du certificat du client===&lt;br /&gt;
&lt;br /&gt;
On crée un certificat client SSL, pour le groupe qui va se connecter sur notre serveur. On s&amp;#039;y prend exactement comme pour créer le certificat pour le serveur.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 easy-rsa/2.0# ./build-key-server client1&lt;br /&gt;
 Generating a 1024 bit RSA private key&lt;br /&gt;
 .................................++++++&lt;br /&gt;
 ..++++++&lt;br /&gt;
 writing new private key to &amp;#039;client1.key&amp;#039;&lt;br /&gt;
 -----&lt;br /&gt;
 You are about to be asked to enter information that will be incorporated&lt;br /&gt;
 into your certificate request.&lt;br /&gt;
 What you are about to enter is what is called a Distinguished Name or a DN.&lt;br /&gt;
 There are quite a few fields but you can leave some blank&lt;br /&gt;
 For some fields there will be a default value,&lt;br /&gt;
 If you enter &amp;#039;.&amp;#039;, the field will be left blank.&lt;br /&gt;
 -----&lt;br /&gt;
 State or Province Name (full name) [CA]:94&lt;br /&gt;
 Locality Name (eg, city) [SanFrancisco]:Creteil&lt;br /&gt;
 Organization Name (eg, company) [Fort-Funston]:Paris12&lt;br /&gt;
 Organizational Unit Name (eg, section) []:Master2SSI&lt;br /&gt;
 Common Name (eg, your name or your server&amp;#039;s hostname) [client1]:client1&lt;br /&gt;
 Email Address [me@myhost.mydomain]:&lt;br /&gt;
 &lt;br /&gt;
 Please enter the following &amp;#039;extra&amp;#039; attributes&lt;br /&gt;
 to be sent with your certificate request&lt;br /&gt;
 A challenge password []:&lt;br /&gt;
 An optional company name []:&lt;br /&gt;
 Using configuration from /usr/share/doc/openvpn/examples/easy-rsa/2.0/openssl.cnf&lt;br /&gt;
 Check that the request matches the signature&lt;br /&gt;
 Signature ok&lt;br /&gt;
 The Subject&amp;#039;s Distinguished Name is as follows&lt;br /&gt;
 countryName           :PRINTABLE:&amp;#039;FR&amp;#039;&lt;br /&gt;
 stateOrProvinceName   :PRINTABLE:&amp;#039;94&amp;#039;&lt;br /&gt;
 localityName          :PRINTABLE:&amp;#039;Creteil&amp;#039;&lt;br /&gt;
 organizationName      :PRINTABLE:&amp;#039;Paris12&amp;#039;&lt;br /&gt;
 organizationalUnitName:PRINTABLE:&amp;#039;Master2SSI&amp;#039;&lt;br /&gt;
 commonName            :PRINTABLE:&amp;#039;client1&amp;#039;&lt;br /&gt;
 emailAddress          :IA5STRING:&amp;#039;me@myhost.mydomain&amp;#039;&lt;br /&gt;
 Certificate is to be certified until Mar 26 02:41:30 2018 GMT (3650 days)&lt;br /&gt;
 Sign the certificate? [y/n]:y&lt;br /&gt;
  &lt;br /&gt;
 &lt;br /&gt;
 1 out of 1 certificate requests certified, commit? [y/n]y&lt;br /&gt;
 Write out database with 1 new entries&lt;br /&gt;
 Data Base Updated&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0#&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===5. Création des paramètres de Diffie-Hellman===&lt;br /&gt;
&lt;br /&gt;
On crée les paramètres Diffie-Hellman :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0# ./build-dh&lt;br /&gt;
 Generating DH parameters, 1024 bit long safe prime, generator 2&lt;br /&gt;
 This is going to take a long time&lt;br /&gt;
 ...................................................................+............&lt;br /&gt;
 ................................................................+...............&lt;br /&gt;
 .........+.................+.......+............................................&lt;br /&gt;
 .+..............................................................................&lt;br /&gt;
 ....+............................................................+..............&lt;br /&gt;
 ................................................................................&lt;br /&gt;
 .......++*++*++*&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0#&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===6. Copie des clefs dans le répertoire d&amp;#039;OpenVPN===&lt;br /&gt;
On copie les fichiers ainsi créés dans le répertoire /etc/openvpn :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/easy-rsa/2.0# cp -r keys /etc/openvpn/&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 1.2 OpenVPN : configuration ==&lt;br /&gt;
&lt;br /&gt;
On regarde les fichiers d&amp;#039;exemples. On copie server.conf dans /etc/openvpn :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/sample-config-files# cp server.conf.gz /etc/openvpn/&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/sample-config-files#&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On décompresse :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/sample-config-files# cd /etc/openvpn/&lt;br /&gt;
 root@ubuntu:/etc/openvpn# gzip -d server.conf.gz&lt;br /&gt;
 root@ubuntu:/etc/openvpn#&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On édite ensuite ensuite le fichier de conf d&amp;#039;OpenVPN pour le serveur.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 port 1194&lt;br /&gt;
 proto udp&lt;br /&gt;
 dev tun&lt;br /&gt;
 &lt;br /&gt;
 ca /etc/openvpn/keys/ca.crt&lt;br /&gt;
 cert /etc/openvpn/keys/server1.crt&lt;br /&gt;
 key /etc/openvpn/keys/server1.key # à garder bien secrête&lt;br /&gt;
 &lt;br /&gt;
 dh /etc/openvpn/keys/dh1024.pem&lt;br /&gt;
  &lt;br /&gt;
 server 10.8.0.0 255.255.255.0&lt;br /&gt;
 comp-lzo&lt;br /&gt;
 persist-key&lt;br /&gt;
 persist-tun&lt;br /&gt;
 status openvpn-status.log&lt;br /&gt;
 verb 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===A) Configuration du client===&lt;br /&gt;
&lt;br /&gt;
On vérifie les fichiers d&amp;#039;exemples :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/etc/openvpn# cd /usr/share/doc/openvpn/examples/sample-config-files/&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/sample-config-files# cp client.conf /etc/openvpn/&lt;br /&gt;
 root@ubuntu:/usr/share/doc/openvpn/examples/sample-config-files# cd /etc/openvpn&lt;br /&gt;
 root@ubuntu:/etc/openvpn#&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On édite client.conf en rajoutant l&amp;#039;adresse du serveur VPN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 client&lt;br /&gt;
 dev tun&lt;br /&gt;
 proto udp&lt;br /&gt;
 &lt;br /&gt;
 remote ip_du_server 1194&lt;br /&gt;
 &lt;br /&gt;
 resolv-retry infinite&lt;br /&gt;
 nobind&lt;br /&gt;
 persist-key&lt;br /&gt;
 persist-tun&lt;br /&gt;
 &lt;br /&gt;
 ca /etc/openvpn/keys/ca.crt&lt;br /&gt;
 cert /etc/openvpn/keys/client1.crt&lt;br /&gt;
 key /etc/openvpn/keys/client1.key&lt;br /&gt;
 &lt;br /&gt;
 comp-lzo&lt;br /&gt;
 verb 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===B) Distribution de certificats===&lt;br /&gt;
&lt;br /&gt;
On lance le serveur :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 root@ubuntu:/etc/openvpn# mv server.conf openvpn.conf&lt;br /&gt;
 root@ubuntu:/etc/openvpn# /etc/init.d/openvpn start&lt;br /&gt;
 Starting virtual private network daemon: client(OK) openvpn(OK).&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Une fois le client connecté, on obtient des informations sur lui en consultant /etc/openvpn/openvpn-status.log :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 localhost openvpn # cat openvpn-status.log &lt;br /&gt;
 OpenVPN CLIENT LIST&lt;br /&gt;
 Updated,Sun Dec 17 17:21:15 2006&lt;br /&gt;
 Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since&lt;br /&gt;
 ABC,88.169.118.169:34322,8851,9928,Sun Dec 17 17:18:29 2006&lt;br /&gt;
 ROUTING TABLE&lt;br /&gt;
 Virtual Address,Common Name,Real Address,Last Ref&lt;br /&gt;
 10.8.0.6,ABC,88.169.118.169:34322,Sun Dec 17 17:21:01 2006&lt;br /&gt;
 GLOBAL STATS&lt;br /&gt;
 Max bcast/mcast queue length,0&lt;br /&gt;
 END&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le fichier ipp.txt est quant à lui, vide chez le client et contient ABC,10.8.0.4 chez le serveur.&lt;br /&gt;
On essaie de capturer sur l&amp;#039;interface sur laquelle partent nos paquets, ici, des pings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 17:36:58.100540 IP monclient.openvpn &amp;gt;    88.169.118.169.34322: UDP, length 125&lt;br /&gt;
         0x0000:  4500 0099 0000 4000 4011 be9c 5372 5939  E.....@.@...SrY9&lt;br /&gt;
         0x0010:  58a2 766a 04aa 8612 0085 8135 302e 335e  X.vj.......50.3^&lt;br /&gt;
         0x0020:  c78b ee3d 8792 ce09 da12 2207 5e06 40dd  ...=......&amp;quot;.^.@.&lt;br /&gt;
         0x0030:  d2d1 8460 3e98 8c6e def3 e5af 28eb ec62  ...`&amp;gt;..n....(..b&lt;br /&gt;
         0x0040:  fb06 cd23 22b9 3e04 3e4d 58c2 4d4a 4ed1  ...#&amp;quot;.&amp;gt;.&amp;gt;MX.MJN.&lt;br /&gt;
 17:36:58.186103 IP 88.169.118.169.34322 &amp;gt; monclient.openvpn: UDP, length 125&lt;br /&gt;
         0x0000:  4500 0099 0000 4000 3711 c79c 58a2 766a  E.....@.7...X.vj&lt;br /&gt;
         0x0010:  5372 5939 8612 04aa 0085 6cae 30e3 834f  SrY9......l.0..O&lt;br /&gt;
         0x0020:  ad50 8cd8 b076 aa7b d241 05c4 9727 3253  .P...v.{.A...&amp;#039;2S&lt;br /&gt;
         0x0030:  ac79 26b4 d5fb 1238 1775 b717 ebca 3a6d  .y&amp;amp;....8.u....:m&lt;br /&gt;
         0x0040:  3936 c20d 0608 be9b 4a2d fc18 94f9 f1fb  96......J-......&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
		 &lt;br /&gt;
C&amp;#039;est bien entendu chiffré, mais c&amp;#039;est bon de le vérifier (on voit un paquet UDP, mais les données ne nous sont pas compréhensibles).&lt;br /&gt;
&lt;br /&gt;
Après avoir effectué quelques tests de connectivité avec ping, on remarque quelques «choses» intéressantes avec les outils classiques au niveau serveur :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 localhost openvpn # arp -a&lt;br /&gt;
 localhost openvpn # route&lt;br /&gt;
 Table de routage IP du noyau&lt;br /&gt;
 Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;10.8.0.2        *               255.255.255.255 UH    0      0        0 tun0&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 local312.lnsta1 *               255.255.255.255 UH    0      0        0 ppp0&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;10.8.0.0        10.8.0.2        255.255.255.0   UG    0      0        0 tun0&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 192.168.1.0     *               255.255.255.0   U     0      0        0 eth0&lt;br /&gt;
 192.168.10.0    *               255.255.255.0   U     0      0        0 eth1&lt;br /&gt;
 loopback        *               255.0.0.0       U     0      0        0 lo&lt;br /&gt;
 default         local312.lnsta1 0.0.0.0         UG    0      0        0 ppp0&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On constate que notre table de cache ARP est vide et que notre table de routage a obtenu quant à elle de nouvelles routes permettant de passer dans le tunnel.&lt;br /&gt;
&lt;br /&gt;
===C) Mode pont (Bridge)===&lt;br /&gt;
&lt;br /&gt;
On modifie les fichiers de configurations clients et serveur en remplaçant dev tun par dev tap.&lt;br /&gt;
&lt;br /&gt;
On re-pratique les tests précédents :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 localhost openvpn # route&lt;br /&gt;
 Table de routage IP du noyau&lt;br /&gt;
 Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface&lt;br /&gt;
 local232.lnfny1 *               255.255.255.255 UH    0      0        0 ppp0&lt;br /&gt;
 10.8.0.0        *               255.255.255.0   U     0      0        0 tap0&lt;br /&gt;
 192.168.1.0     *               255.255.255.0   U     0      0        0 eth0&lt;br /&gt;
 192.168.10.0    *               255.255.255.0   U     0      0        0 eth1&lt;br /&gt;
 loopback        *               255.0.0.0       U     0      0        0 lo&lt;br /&gt;
 default         local232.lnfny1 0.0.0.0         UG    0      0        0 ppp0&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La table de routage s&amp;#039;est un peu allégée.&lt;br /&gt;
&lt;br /&gt;
Le mode pont nous permet d&amp;#039;agir directement au niveau de la couche 2. Le client se fait attribuer une IP lorsqu&amp;#039;il se connecte, mais il pourrait très bien avoir une conectivité IPv6 ou demander son IP à un serveur DHCP.&lt;br /&gt;
&lt;br /&gt;
Le fichier ipp.txt n&amp;#039;a pas changé. Le fichier openvpn-status.log a quelque peu changé, et montre maintenant de nouvelles informations, telle l&amp;#039;adresse MAC du client :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 OpenVPN CLIENT LIST&lt;br /&gt;
 Updated,Sun Dec 17 17:48:58 2006&lt;br /&gt;
 Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since&lt;br /&gt;
 ABC,88.169.118.169:34393,5264,6927,Sun Dec 17 17:42:51 2006&lt;br /&gt;
 ROUTING TABLE&lt;br /&gt;
 Virtual Address,Common Name,Real Address,Last Ref&lt;br /&gt;
  8a:e5:8c:0a:a5:a6,ABC,88.169.118.169:34393,Sun Dec 17 17:42:53 2006&lt;br /&gt;
 GLOBAL STATS&lt;br /&gt;
 Max bcast/mcast queue length,1&lt;br /&gt;
 END&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notre table ARP nous informe que l&amp;#039;on a bien accès à la couche 2 :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 localhost openvpn # arp -a&lt;br /&gt;
 ? (10.8.0.4) at 8A:E5:8C:0A:A5:A6 [ether] on tap0&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La capture du flux sur tap0 nous montre les échanges de requète ARP, explique pourquoi la table ARP se remplit.&lt;br /&gt;
&lt;br /&gt;
Ce type de tunnel est donc parfait pour tout ce qui nécessite des protocoles au dessus de la couche 2, comme IPX par exemple. Avant, quand nous n&amp;#039;étions pas en mode pont, ce n&amp;#039;était pas possible de mettre des protocoles de niveau 3 dans notre tunnel.&lt;br /&gt;
&lt;br /&gt;
===D) Poussée de routes vers le client===&lt;br /&gt;
&lt;br /&gt;
Cette configuration force le client à passer tout son trafic sortant à l&amp;#039;intérieur du VPN. Cela permet de sécuriser de manière totale sa connexion. En point négatif, on pourra remarquer que cela augmente la latence du client (puisqu&amp;#039;il doit maintenant passer par le VPN pour sortir) et peut aussi limiter son débit.&lt;br /&gt;
&lt;br /&gt;
On édite server.conf pour &amp;quot;pousser&amp;quot; les routes vers la machine du client, on rajoute la ligne suivante :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 push &amp;quot;redirect-gateway def1&amp;quot;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il faut aussi rajouter au serveur des règles pour activer le NAT si on veut que le client puisse sortir vers l&amp;#039;extérieur. En voici un exemple:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==2) VPN applicatif : Stunnel &amp;amp; SSH (ou tunneling de ports)==&lt;br /&gt;
&lt;br /&gt;
===Stunnel 3.X===&lt;br /&gt;
&lt;br /&gt;
Si on fonctionne sur un ancien système, il est probable que l&amp;#039;on ait une ancienne version de stunnel. La version 4.0 a apporté de nombreux changements, dont un changement total de la façon de le lancer. La nouvelle version lit dans un fichier, tandis que l&amp;#039;ancienne prenait tous ses arguments en ligne de commande.&lt;br /&gt;
Pour plus d&amp;#039;information, se réferrer à l&amp;#039;URL suivante [http://www.freebsddiary.org/stunnel-v3-to-v4.php Upgrading to stunnel 4] (en anglais).&lt;br /&gt;
&lt;br /&gt;
===Stunnel 4.X===&lt;br /&gt;
&lt;br /&gt;
====Principe et utilité====&lt;br /&gt;
&lt;br /&gt;
Cet outil sert dans plusieurs cas :&lt;br /&gt;
* quand on est sur un réseau non sûr et que l&amp;#039;on souhaite se connecter par exemple sur un serveur mail externe en POP afin d&amp;#039;y relever son courrier électronique&lt;br /&gt;
* quand on a un serveur utilisant pour communiquer le protocole TCP et que l&amp;#039;on veut lui adjoindre la fonctionnalité SSL afin que son trafic soit chiffré&lt;br /&gt;
&lt;br /&gt;
Stunnel est une sorte de proxy, il fonctionne comme suit :&lt;br /&gt;
client (en clair) &amp;lt;=&amp;gt; Stunnel (sur la machine client) &amp;lt;=&amp;gt; Stunnel (sur un hôte de confiance ou directement sur le serveur)&amp;lt;=&amp;gt; leserveur (en clair)&lt;br /&gt;
&lt;br /&gt;
Ainsi, tout l&amp;#039;échange entre le client et le serveur est sécurisé par stunnel.&lt;br /&gt;
&lt;br /&gt;
Comme tout transite avec SSL, on pourra constater que la capture du trafic sur l&amp;#039;interface de sortie du client que la communication est totalement chiffrée.&lt;br /&gt;
&lt;br /&gt;
====Côté serveur====&lt;br /&gt;
&lt;br /&gt;
Nous allons ici nous employer a protéger un serveur HTTP qui n&amp;#039;a pas de connexion HTTPS. Le fichier de configuration /etc/stunnel/stunnel.conf ressemble à ce qui suit :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 # Sample stunnel configuration file by Michal Trojnara 2002-2005&lt;br /&gt;
 # Some options used here may not be adequate for your particular configuration&lt;br /&gt;
 # Please make sure you understand them (especially the effect of chroot jail)&lt;br /&gt;
 &lt;br /&gt;
 # Certificate/key is needed in server mode and optional in client mode&lt;br /&gt;
 cert = /etc/stunnel/stunnel.pem&lt;br /&gt;
 key = /etc/stunnel/stunnel.key&lt;br /&gt;
 &lt;br /&gt;
 # Some security enhancements for UNIX systems - comment them out on Win32&lt;br /&gt;
 # chroot = /chroot/stunnel/&lt;br /&gt;
 setuid = stunnel&lt;br /&gt;
 setgid = stunnel&lt;br /&gt;
 # PID is created inside chroot jail&lt;br /&gt;
 pid = /var/run/stunnel/stunnel.pid&lt;br /&gt;
 &lt;br /&gt;
 # Some performance tunings&lt;br /&gt;
 socket = l:TCP_NODELAY=1&lt;br /&gt;
 socket = r:TCP_NODELAY=1&lt;br /&gt;
 #compression = rle&lt;br /&gt;
 &lt;br /&gt;
 # Workaround for Eudora bug&lt;br /&gt;
 #options = DONT_INSERT_EMPTY_FRAGMENTS&lt;br /&gt;
 &lt;br /&gt;
 # Authentication stuff&lt;br /&gt;
 #verify = 2&lt;br /&gt;
 # Don&amp;#039;t forget to c_rehash CApath&lt;br /&gt;
 # CApath is located inside chroot jail:&lt;br /&gt;
 #CApath = /certs&lt;br /&gt;
 # It&amp;#039;s often easier to use CAfile:&lt;br /&gt;
 #CAfile = /etc/stunnel/certs.pem&lt;br /&gt;
 # Don&amp;#039;t forget to c_rehash CRLpath&lt;br /&gt;
 # CRLpath is located inside chroot jail:&lt;br /&gt;
 #CRLpath = /crls&lt;br /&gt;
 # Alternatively you can use CRLfile:&lt;br /&gt;
 #CRLfile = /etc/stunnel/crls.pem&lt;br /&gt;
 &lt;br /&gt;
 # Some debugging stuff useful for troubleshooting&lt;br /&gt;
 #debug = 7&lt;br /&gt;
 output = /var/log/stunnel.log&lt;br /&gt;
 &lt;br /&gt;
 # Use it for client mode&lt;br /&gt;
 #client = yes&lt;br /&gt;
 &lt;br /&gt;
 # Service-level configuration&lt;br /&gt;
 &lt;br /&gt;
 #[pop3s]&lt;br /&gt;
 #accept  = 995&lt;br /&gt;
 #connect = 110&lt;br /&gt;
 &lt;br /&gt;
 #[imaps]&lt;br /&gt;
 #accept  = 993&lt;br /&gt;
 #connect = 143&lt;br /&gt;
 &lt;br /&gt;
 #[ssmtp]&lt;br /&gt;
 #accept  = 465&lt;br /&gt;
 #connect = 25&lt;br /&gt;
 &lt;br /&gt;
 [https]&lt;br /&gt;
 accept  = 443&lt;br /&gt;
 connect = serveur_a_proteger:80&lt;br /&gt;
 TIMEOUTclose = 0&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ici, on va donc dire d&amp;#039;écouter sur le port 443 un client stunnel afin de pouvoir se brancher de manière sécurisée sur le port 80 de ce site.&lt;br /&gt;
&lt;br /&gt;
====Côté client====&lt;br /&gt;
&lt;br /&gt;
On édite le fichier de configuration de stunnel pour le client, c&amp;#039;est à dire /etc/stunnel/stunnel.conf.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 client = yes    # on est le client&lt;br /&gt;
 #foreground = no&lt;br /&gt;
 &lt;br /&gt;
 [443]&lt;br /&gt;
 accept = localhost:80    # port en clair&lt;br /&gt;
 connect = IP_serveur_stunnel:443    # serveur et son port SLL&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensuite on lance stunnel par la commande :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 [root@mamachine ssl]# stunnel /etc/stunnel/stunnel.conf&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On voit que ça a marché :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 [root@mamachine ssl]# netstat -l -t -n|grep :80&lt;br /&gt;
 tcp        0      0 127.0.0.1:80                0.0.0.0:*                   LISTEN&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour vraiment faire un vrai tunnel sécurisé, et que le client soit sûr que le serveur soit digne de confiance, le serveur aurait pu donner au client son certificat. Le client aurait juste eu à rajouter dans son fichier stunnel.conf la ligne suivante :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 cert = /etc/stunnel/server.pem&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Analyse du trafic====&lt;br /&gt;
&lt;br /&gt;
Avec l&amp;#039;aide Wireshark (ex-Ethereal), lorsqu&amp;#039;on capture un échange HTTP complet, on ne voit pas le trafic HTTP. Soit on a commencé la capture au début de l&amp;#039;échange et on voit que l&amp;#039;on a du SSL, soit on a commencé la capture au cours de l&amp;#039;échange et Wireshark ne voit que du TCP.&lt;br /&gt;
&lt;br /&gt;
===SSH===&lt;br /&gt;
&lt;br /&gt;
On utilise maintenant le même mécanisme mais en utilisant le protocole SSH.&lt;br /&gt;
&lt;br /&gt;
====Côté serveur ====&lt;br /&gt;
&lt;br /&gt;
Il est très probable que le serveur SSH de notre distribution soit déjà directement bien configuré. Si on a un problème pour la suite, il faut penser à vérifier que l&amp;#039;on a activé le TCP port forwarding en rajoutant la ligne suivant dans son sshd_config (celui-ci est normalement activé par défaut si rien n&amp;#039;est précisé):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 AllowTcpForwarding yes&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Côté client ====&lt;br /&gt;
&lt;br /&gt;
On va tenter de faire un tunnel via SSH. On choisit un port non privilégié (supérieur à 1024), ici on a pris 6712. On va ensuite demander au serveur SSH de nous rediriger le trafic d&amp;#039;un serveur choisi, ici le serveur web www.linuxfr.org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 [root@client ssl]# ssh -l luser -L 6712:www.linuxfr.org:80 serveur_ssh.tld&lt;br /&gt;
 Warning: Permanently added &amp;#039;80.114.69.57&amp;#039; (RSA) to the list of known hosts.&lt;br /&gt;
 Password:&lt;br /&gt;
 Last login: Sun Dec 17 20:21:06 2006 from localhost&lt;br /&gt;
 luser@remotehost ~ $ ls&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La connexion au serveur SSH a marché. On lance un navigateur web sur localhost:6712, et on est immédiatement redirigé sur la page d&amp;#039;accueil de linuxfr.org. On peut vérifié que le tunnel a bien marché aussi avec la commande netstat :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 [root@client openvpn]# netstat -l -t -n | grep :6712&lt;br /&gt;
 tcp        0      0 127.0.0.1:6712              0.0.0.0:*                   LISTEN&lt;br /&gt;
 tcp        0      0 ::1:6712                    :::*                        LISTEN&lt;br /&gt;
 [root@client openvpn]#&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Analyse de trafic ====&lt;br /&gt;
&lt;br /&gt;
On ne peut pas voir de trafic HTTP avec Wireshark, tout est chiffré.&lt;br /&gt;
&lt;br /&gt;
===WGET et tunneling SSH===&lt;br /&gt;
&lt;br /&gt;
On va essayer de récupérer avec wget l&amp;#039;image qui est en haut à gauche du site linuxfr.org (un manchot) :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 [root@client tmp]# wget &amp;lt;nowiki&amp;gt;127.0.0.1:6712/images/top_bar_left_logo.png&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 --21:07:48--  &amp;lt;nowiki&amp;gt;http://127.0.0.1:6712/images/top_bar_left_logo.png&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
            =&amp;gt; `top_bar_left_logo.png&amp;#039;&lt;br /&gt;
 Connexion vers 127.0.0.1:6712...connecté.&lt;br /&gt;
 requête HTTP transmise, en attente de la réponse...302 Found&lt;br /&gt;
 Emplacement: &amp;lt;nowiki&amp;gt;http://linuxfr.org/ images/top_bar_left_logo.png&amp;lt;/nowiki&amp;gt; [suivant]&lt;br /&gt;
 --21:07:49--  &amp;lt;nowiki&amp;gt;http://linuxfr.org/ images/top_bar_left_logo.png&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
            =&amp;gt; `top_bar_left_logo.png&amp;#039;&lt;br /&gt;
 Résolution de linuxfr.org... 212.27.33.225&lt;br /&gt;
 Connexion vers linuxfr.org|212.27.33.225|:80...connecté.&lt;br /&gt;
 requête HTTP transmise, en attente de la réponse...200 OK&lt;br /&gt;
 Longueur: 20,474 (20K) [image/png] &lt;br /&gt;
 &lt;br /&gt;
 100%[=============================================================================================================&amp;gt;] 20,474        --.--K/s&lt;br /&gt;
 &lt;br /&gt;
 21:07:49 (240.57 KB/s) - « top_bar_left_logo.png » sauvegardé [20474/20474]&lt;br /&gt;
 &lt;br /&gt;
 [root@client tmp]#&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a bien récupéré l&amp;#039;image et on peut la visionner. Wget est passé chez le client par le port 6712, au début. Puis, il s&amp;#039;est vu donné l&amp;#039;IP du site de linuxfr.org pour télécharger. C&amp;#039;est pourquoi il nous affiche qu&amp;#039;il a téléchargé sur linuxfr.org. Ainsi, seul le début de la requète est passé par le tunnel. Le reste de la transaction s&amp;#039;est effectuée en clair.&lt;br /&gt;
&lt;br /&gt;
===Tunneling SSH de port distant===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 [root@client tmp]# ssh -l user -R le_port_ouvert_a_distance:l_IP_de_l_hote_a_contacter:le_port_du_serveur_a_contacter le_serveur_distant&lt;br /&gt;
 Password:&lt;br /&gt;
 Last login: Sun Dec 17 21:22:21 2006 from localhost&lt;br /&gt;
 user@localhost ~ $&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ainsi, toutes les requêtes sur le_server_distant:le_port_ouvert_a_distance seront ramenées à la machine qui aura établi la connexion SSH, et celle-ci transférera à son tour ses connexions vers l_IP_de_l_hote_a_contacter:le_port_du_serveur_a_contacter.&lt;br /&gt;
&lt;br /&gt;
L&amp;#039;explication de la page de manuel SSH:&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
     -R [bind_address:]port:host:hostport&lt;br /&gt;
             Specifies that the given port on the remote (server) host is to&lt;br /&gt;
             be forwarded to the given host and port on the local side.  This&lt;br /&gt;
             works by allocating a socket to listen to port on the remote&lt;br /&gt;
             side, and whenever a connection is made to this port, the connec-&lt;br /&gt;
             tion is forwarded over the secure channel, and a connection is&lt;br /&gt;
             made to host port hostport from the local machine.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cette fonctionnalité permet par exemple de donner un accès à des machines à l&amp;#039;intérieur d&amp;#039;un réseau.&lt;br /&gt;
&lt;br /&gt;
===Authentification forte SSH par clés===&lt;br /&gt;
&lt;br /&gt;
Une possibilité de SSH est l&amp;#039;authentification par clef.&lt;br /&gt;
Celle-ci permet:&lt;br /&gt;
* de s&amp;#039;authentifier avec une clef, ce qui augmente la sécurité entre le client serveur, car ce dernier peut ensuite exiger que tous les clients aient une clef pour se loguer (deux éléments requis au lieu d&amp;#039;un seul)&lt;br /&gt;
* de s&amp;#039;authentifier de manière automatique, facilitant ainsi la mise en place de script&lt;br /&gt;
&lt;br /&gt;
Il faut au préalable créer une clef:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 ~/$ ssh-keygen -t dsa&lt;br /&gt;
 Generating public/private dsa key pair.&lt;br /&gt;
 Enter file in which to save the key (/home/user/.ssh/id_dsa):./maclef&lt;br /&gt;
 Enter passphrase (empty for no passphrase):&lt;br /&gt;
 Enter same passphrase again:&lt;br /&gt;
 Your identification has been saved in ./maclef.&lt;br /&gt;
 Your public key has been saved in ./maclef.pub.&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 f2:aa:d0:9e:4e:95:ff:29:f3:3b:ac:fc:0f:2d:b4:ef user@localhost&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ici, si vous entrez une passphrase, celle-ci sera demandée à chaque login. Si vous décidez de ne pas en mettre, cela permettra l&amp;#039;authentification sans login (pensez à protéger votre clef!).&lt;br /&gt;
&lt;br /&gt;
Ensuite, il suffit d&amp;#039;envoyer la clef publique sur le serveur :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 ssh-copy-id -i lecheminverslaclefPUBLIQUE IP_DU_SERVEUR&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Vous aurez ainsi le plaisir de pouvoir vous loguer grâce à cette clef de la manière suivante :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
 ssh -i lecheminverslaclefPRIVEE IP_DU_SERVEUR&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Conclusions ===&lt;br /&gt;
&lt;br /&gt;
* Avec le tunneling SSH, on a rien à configurer (avant il fallait éditer le fichier stunnel.conf). Il faut juste que le client possède un client SSH.&lt;br /&gt;
* Par SSH on a l&amp;#039;avantage d&amp;#039;avoir une authentification par mot de passe (avec stunnel le client aurait peut cependant exiger d&amp;#039;avoir le certificat du serveur).&lt;br /&gt;
* Un inconvénient est que les ports locaux qu&amp;#039;on utilise pour les transferts (ici 6712) sont accessibles par tous les utilisateurs éventuels de la machine, e.g. les passerelles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;lt;b&amp;gt;[[Reseau-index|@ Retour à la rubrique Réseau et sécurité]]&amp;lt;/b&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{Copy|2006, 2010|[[Utilisateur:Jiel|Jiel Beaumadier]] et [[Utilisateur:amnesiak|Tony Cheneau]]|FDL}}&lt;/div&gt;</summary>
		<author><name>Jiel</name></author>
	</entry>
</feed>