Code source wiki de Configuration Linux Client - Network Manager
Version 11.1 par Stéphane Dugravot le 27/06/2013 - 14:27
Afficher les derniers auteurs
author | version | line-number | content |
---|---|---|---|
1 | |||
2 | |||
3 | |||
4 | |||
5 | {{confluence_section}} | ||
6 | {{confluence_column width="30%"}} | ||
7 | (% style="text-align: center;" %) | ||
8 | [[image:attach:linux.png||title="linux.png"]] | ||
9 | {{/confluence_column}} | ||
10 | |||
11 | {{confluence_column}} | ||
12 | {{panel}} | ||
13 | |||
14 | |||
15 | {{toc minLevel="2"/}} | ||
16 | {{/panel}} | ||
17 | {{/confluence_column}} | ||
18 | {{/confluence_section}} | ||
19 | |||
20 | |||
21 | |||
22 | = Configuration Linux (Ubuntu - Mint) = | ||
23 | |||
24 | 3 solutions : | ||
25 | |||
26 | 1. Via le script d'install Cisco vpn anyconnect | ||
27 | 1. Via le package openconnect : Open client for Cisco AnyConnect VPN | ||
28 | 1. Via network-manager + | ||
29 | |||
30 | = Via le script d'install Cisco vpn anyconnect = | ||
31 | |||
32 | Sous linux on peux installer le client anyconnect en lancant le script vpnsetup.sh disponible soit : | ||
33 | |||
34 | ici : | ||
35 | |||
36 | * Linux_X86_64 : [[attach:vpnsetup_64b.sh]] ( Version au 13/02/2013) | ||
37 | * Linux_32 : [[attach:vpnsetup_32b.sh]] ( Version au 13/02/2013) | ||
38 | |||
39 | soit | ||
40 | |||
41 | en allant le chercher sur le [[https:~~/~~/vpn.lothaire.net>>url:https://vpn.lothaire.net||shape="rect"]] | ||
42 | |||
43 | |||
44 | |||
45 | [[image:attach:VPN_Linux1.png||width="800" title="VPN_Linux1.png"]] | ||
46 | |||
47 | puis en cliquant sur le lien ( apres 1, à 2 min) : | ||
48 | |||
49 | [[image:attach:VPN_Linux2.png||title="VPN_Linux2.png"]] | ||
50 | |||
51 | |||
52 | |||
53 | Une fois le script récuperé, on install le produit : | ||
54 | |||
55 | |||
56 | |||
57 | {{code title="install_anyconnect" theme="RDark" language="bash"}} | ||
58 | xxxxxx@pcxxxxx ~/Téléchargements $ sudo sh vpnsetup_64b.sh | ||
59 | [sudo] password for xxxxxx: | ||
60 | Installing Cisco AnyConnect Secure Mobility Client... | ||
61 | Removing previous installation... | ||
62 | mv: impossible d'évaluer «/opt/cisco/vpn/*.log»: Aucun fichier ou dossier de ce type | ||
63 | Extracting installation files to /tmp/vpn.zFF5b4/vpninst095927597.tgz... | ||
64 | Unarchiving installation files to /tmp/vpn.zFF5b4... | ||
65 | Starting the VPN agent... | ||
66 | Done! | ||
67 | |||
68 | |||
69 | {{/code}} | ||
70 | |||
71 | |||
72 | |||
73 | on doit rebooter sa machine, pour voir apparaître dans un menu l'application "Cisco Anyconnect Secure Mobility Client" : | ||
74 | |||
75 | [[image:attach:VPN_Linux3.png||title="VPN_Linux3.png"]] | ||
76 | |||
77 | ** | ||
78 | ** | ||
79 | |||
80 | on le lance : | ||
81 | |||
82 | **[[image:attach:VPN_Linux4.png||title="VPN_Linux4.png"]]** | ||
83 | |||
84 | ** | ||
85 | ** | ||
86 | |||
87 | **on accepte le certificat et on peut se connecter :** | ||
88 | |||
89 | ** | ||
90 | ** | ||
91 | |||
92 | **[[image:attach:VPN_Linux5.png||title="VPN_Linux5.png"]]** | ||
93 | |||
94 | **NB : si on a ces erreurs "AnyConnect cannot confirm it is connected to your secure gateway. The local network may not be trustworthy. Please try another network."** | ||
95 | |||
96 | **c'est qu'il manque le certificat TERENA SSL CA** | ||
97 | |||
98 | |||
99 | |||
100 | {{code}} | ||
101 | cd /opt/.cisco/certificates/ca | ||
102 | wget http://www.crium.univ-metz.fr/chaintcs.crt -o chaintcs.pem | ||
103 | {{/code}} | ||
104 | |||
105 | |||
106 | |||
107 | === Fichier XML pour la configuration d'anyconnect === | ||
108 | |||
109 | Dans le cas ou il y a plusieurs concentrateur vpn à gérer. | ||
110 | |||
111 | Fichier à installer dans : | ||
112 | |||
113 | * MacOS X : /opt/cisco/anyconnect/profile | ||
114 | * Windows : (% class="content" %)C:\ProgramData\Cisco\Cisco AnyConnect VPN Client\Profile\ | ||
115 | |||
116 | Mettre un nom suffixé **.xml** | ||
117 | (% class="content" %)\\ | ||
118 | |||
119 | {{code}} | ||
120 | <?xml version="1.0" encoding="UTF-8"?> | ||
121 | |||
122 | <AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/" | ||
123 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
124 | xsi:schemaLocation="http://schemas.xmlsoap.org/encoding/ AnyConnectProfile.xsd"> | ||
125 | <ClientInitialization> | ||
126 | <UseStartBeforeLogon UserControllable="false">false</UseStartBeforeLogon> | ||
127 | <CertEnrollmentPin>pinAllowed</CertEnrollmentPin> | ||
128 | <CertificateMatch> | ||
129 | <KeyUsage> | ||
130 | <MatchKey>Non_Repudiation</MatchKey> | ||
131 | <MatchKey>Digital_Signature</MatchKey> | ||
132 | </KeyUsage> | ||
133 | <ExtendedKeyUsage> | ||
134 | <ExtendedMatchKey>ClientAuth</ExtendedMatchKey> | ||
135 | <ExtendedMatchKey>ServerAuth</ExtendedMatchKey> | ||
136 | <CustomExtendedMatchKey>1.3.6.1.5.5.7.3.11</CustomExtendedMatchKey> | ||
137 | </ExtendedKeyUsage> | ||
138 | <DistinguishedName> | ||
139 | <DistinguishedNameDefinition Operator="Equal" Wildcard="Enabled"> | ||
140 | <Name>CN</Name> | ||
141 | <Pattern>ASASecurity</Pattern> | ||
142 | </DistinguishedNameDefinition> | ||
143 | <DistinguishedNameDefinition Operator="Equal" Wildcard="Disabled"> | ||
144 | <Name>L</Name> | ||
145 | <Pattern>Boulder</Pattern> | ||
146 | </DistinguishedNameDefinition> | ||
147 | </DistinguishedName> | ||
148 | </CertificateMatch> | ||
149 | </ClientInitialization> | ||
150 | <ServerList> | ||
151 | <HostEntry> | ||
152 | <HostName>UL</HostName> | ||
153 | <HostAddress>vpn.lothaire.net</HostAddress> | ||
154 | </HostEntry> | ||
155 | </ServerList> | ||
156 | </AnyConnectProfile> | ||
157 | {{/code}} | ||
158 | |||
159 | |||
160 | |||
161 | = Via le package Openconnect = | ||
162 | |||
163 | on install le package openconnect et les plugin network-manager-openconnect, network-manager-openconnect-gnome | ||
164 | |||
165 | |||
166 | |||
167 | {{code title="Openconnect" theme="RDark" language="bash"}} | ||
168 | sudo apt-get install openconnect network-manager-openconnect network-manager-openconnect-gnome | ||
169 | {{/code}} | ||
170 | |||
171 | |||
172 | |||
173 | rebooter sa machine , on verra maintenant apparaître dans son module de gestion réseau/VPN un nouveau module "VPN Compatible Cisco Anyconnect ( openconnect)" | ||
174 | |||
175 | |||
176 | |||
177 | [[image:attach:VPN_Linux6.png||title="VPN_Linux6.png"]] | ||
178 | |||
179 | |||
180 | |||
181 | [[image:attach:VPN_Linux7.png||title="VPN_Linux7.png"]] | ||
182 | |||
183 | |||
184 | |||
185 | créer , Renseigner uniquement le nomde la connexion et la passerelle | ||
186 | |||
187 | [[image:attach:VPN_Linux8.png||title="VPN_Linux8.png"]] | ||
188 | |||
189 | Pour avoir de bonnes performances il faut activer le Split-Tunnel (seules les connexions nécessaires passent dans le tunnel), | ||
190 | il faut cocher une case dans les paramètres IPV4 > Routes (la traduction française a coupé la phrase) | ||
191 | |||
192 | [[image:attach:openconnect-split-tunnel.jpg||title="openconnect-split-tunnel.jpg"]] | ||
193 | |||
194 | votre nvelle connexion VPN s'affiche maintenant dans votre gestionnaire réseau : | ||
195 | |||
196 | [[image:attach:VPN_Linux9.png||title="VPN_Linux9.png"]] | ||
197 | |||
198 | cocher " Automatically start ....." et cliquer à coté du VPN host pour la connexion : | ||
199 | |||
200 | |||
201 | |||
202 | [[image:attach:VPN_Linux10.png||title="VPN_Linux10.png"]] | ||
203 | |||
204 | valider le certificat : | ||
205 | |||
206 | [[image:attach:VPN_Linux11.png||title="VPN_Linux11.png"]] | ||
207 | |||
208 | |||
209 | |||
210 | puis loguer vous : | ||
211 | |||
212 | |||
213 | |||
214 | [[image:attach:VPN_Linux12.png||title="VPN_Linux12.png"]] | ||
215 | |||
216 | |||
217 | |||
218 | = Configuration VPN Network Manager = | ||
219 | |||
220 | == Installation == | ||
221 | |||
222 | Network Manager, le logiciel qui gère les connexions réseaux que l'on trouve sous différentes distributions Linux (ici Ubuntu) sait gérer les connexions [[WiFi>>url:http://wikidocs.univ-lorraine.fr/display/WiFi/Configuration+Network+Manager||shape="rect"]] et VPN UHP. Pour la gestion du VPN, vous devez disposer bien sûr de Network Manager, mais aussi du client vpnc : | ||
223 | |||
224 | ((( | ||
225 | (% class="syntaxhighlighter nogutter java" %) | ||
226 | ((( | ||
227 | |||
228 | |||
229 | |((( | ||
230 | (% class="container" title="Hint: double-click to select code" %) | ||
231 | ((( | ||
232 | (% class="line number1 index0 alt2" %) | ||
233 | ((( | ||
234 | {{code language="none"}} | ||
235 | > apt-get install vpnc | ||
236 | {{/code}} | ||
237 | ))) | ||
238 | ))) | ||
239 | ))) | ||
240 | |||
241 | |||
242 | ))) | ||
243 | ))) | ||
244 | |||
245 | Et enfin, du plugin network-manager-vpnc : | ||
246 | |||
247 | ((( | ||
248 | (% class="syntaxhighlighter nogutter java" %) | ||
249 | ((( | ||
250 | |||
251 | |||
252 | |((( | ||
253 | (% class="container" title="Hint: double-click to select code" %) | ||
254 | ((( | ||
255 | (% class="line number1 index0 alt2" %) | ||
256 | ((( | ||
257 | {{code language="none"}} | ||
258 | > apt-get install network-manager-vpnc | ||
259 | {{/code}} | ||
260 | ))) | ||
261 | ))) | ||
262 | ))) | ||
263 | |||
264 | |||
265 | ))) | ||
266 | ))) | ||
267 | |||
268 | == Configuration == | ||
269 | |||
270 | Faites un clique droit sur l’icône de Network Manager dans la zone de notification, puis Modification des connexions ... Comme ici : | ||
271 | |||
272 | |||
273 | |||
274 | [[image:url:http://wikidocs.univ-lorraine.fr/download/thumbnails/41123876/1.png?version=1&modificationDate=1243940356000&api=v2||thumbnail="true"]] | ||
275 | |||
276 | Rendez-vous dans l'onglet VPN, si vous avez bien installé le plugin vpnc, alors vous pouvez **//AJOUTER//** un profil : | ||
277 | |||
278 | [[image:url:http://wikidocs.univ-lorraine.fr/download/thumbnails/41123876/7.png?version=1&modificationDate=1243940356000&api=v2||thumbnail="true"]] | ||
279 | |||
280 | Cliquez sur CREER, vous obtenez alors : | ||
281 | |||
282 | [[image:attach:Capture_001.png||thumbnail="true" width="300"]] | ||
283 | |||
284 | Saisissez alors les informations de la page suivantes : | ||
285 | |||
286 | * [[doc:xwiki:publique.dn.com.infra.VPN.WebHome]] | ||
287 | * Domaine : Ne rien y inscrire | ||
288 | * Méthode chiffrement : **//Sécurisé//** | ||
289 | * Traversée du NAT : **//UDP Cisco//** | ||
290 | Dans l'onglet Paramètres IPv4, ne rien changer car l'adresse doit être attribuée automatiquement. | ||
291 | |||
292 | (% class="panelMacro" %) | ||
293 | ((( | ||
294 | |||
295 | |||
296 | |((( | ||
297 | [[image:url:http://wikidocs.univ-lorraine.fr/images/icons/emoticons/forbidden.png||width="16" height="16"]] | ||
298 | )))|((( | ||
299 | Si vous venez d'installer les paquets précédents (vpnc, network-manager-vpnc, etc ...), alors vous devez redémarrer votre poste de travail ! | ||
300 | ))) | ||
301 | |||
302 | |||
303 | ))) | ||
304 | |||
305 | == Connexion == | ||
306 | |||
307 | Faites un clique gauche sur l’icône de Network Manager dans la zone de notification, puis choisissez Connexions VPN ... | ||
308 | Enfin valider en choisissant le profil que vous venez de créer : | ||
309 | |||
310 | [[image:url:http://wikidocs.univ-lorraine.fr/download/thumbnails/41123876/9.png?version=1&modificationDate=1243940356000&api=v2||thumbnail="true"]] | ||
311 | |||
312 | Une fois la connexion établie, l’icône de Network Manager indique un cadenas pour vous informer que la connexion a été établie avec succès : | ||
313 | |||
314 | [[image:url:http://wikidocs.univ-lorraine.fr/download/thumbnails/41123876/10.png?version=1&modificationDate=1243940356000&api=v2||thumbnail="true"]] | ||
315 | |||
316 |