Changes between Version 4 and Version 5 of Realisations/2006-2007/Projet/Entreprise2/Client1


Ignore:
Timestamp:
Apr 20, 2007, 7:00:11 PM (18 years ago)
Author:
alladoum
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Realisations/2006-2007/Projet/Entreprise2/Client1

    v4 v5  
    3939# 3des-cbc,cle de 192 bits (24o)
    4040# hmac-md5,cle de 128 bits(16o)
     41flush;
    4142
    4243## de client1 vers serveur1
     
    4748add 10.40.0.9 10.40.0.13 ah  2000 -m transport -A hmac-md5 "1234567890123456";
    4849add 10.40.0.9 10.40.0.13 esp  2001 -m transport -E 3des-cbc "123456789012345678901234";
    49 EOF
    50 
    51 $ cat >> /etc/ipsec.conf << EOF
     50
    5251# Definition des SPD
    53 flush;
    5452spdflush;
    5553spdadd 10.40.0.13 10.40.0.9 any -P out ipsec
    56 esp/transport/10.40.0.13-10.40.0.9/require
    57 ah/transport/10.40.0.13-10.40.0.9/require;
     54esp/transport/10.40.0.13-10.40.0.9/use
     55ah/transport/10.40.0.13-10.40.0.9/use;
     56# politique en entree
     57spdadd 10.0.0.9 10.40.0.13 any -P in ipsec
     58ah/transport/10.40.0.9-10.40.0.13/use
     59esp/transport/10.0.0.9-10.0.0.13/use;
    5860EOF
    5961}}}
     
    6264$ setkey -v -f /etc/ipsec.conf
    6365}}}
    64    -> Editez dans /etc/rc.conf en ajoutant la ligne
     66   -> Si vous entrez
     67{{{
     68$ setkey -D -P
     69}}}
     70la création des SA et SP devraient vous produire un affichage à peu près similaire à
     71{{{
     72[root@SERVEUR1 ~]# setkey -P -D
     7310.0.0.13[any] 10.40.0.9[any] any
     74        in ipsec
     75        ah/transport/10.40.0.13-10.40.0.9/use
     76        esp/transport/10.0.0.13-10.0.0.9/use
     77        created: Apr 20 18:10:44 2007  lastused: Apr 20 18:10:44 2007
     78        lifetime: 0(s) validtime: 0(s)
     79        spid=16393 seq=1 pid=7761
     80        refcnt=1
     8110.40.0.9[any] 10.0.0.13[any] any
     82        out ipsec
     83        ah/transport/10.40.0.9-10.40.0.13/use
     84        esp/transport/10.0.0.9-10.0.0.13/use
     85        created: Apr 20 18:10:44 2007  lastused: Apr 20 18:10:44 2007
     86        lifetime: 0(s) validtime: 0(s)
     87        spid=16392 seq=0 pid=7761
     88        refcnt=1
     89}}}
     90   -> Pour automatiser cette procédure au démarrage de la machine, éditez dans /etc/rc.conf en ajoutant :
    6591{{{
    6692ipsec_enable="YES"
     
    7197
    7298   * Configurer Racoon
    73  
     99[[BR]]
     100
     101   -> Créer psk.txt initiant l'échange de clé partagé
     102{{{
     103$ cat > psk.txt << EOF
     10410.40.0.9       mot_de_passe_t3$T
     105EOF
     106}}}
     107L'adresse IP est celle de la cible (ici Serveur1), suivi du mot de passe.
     108   -> Créer racoon.conf. Vous pouvez vous inspirer de l'exemple fourni par défaut avec Racoon, ou bien utiliser (en le modifiant) celui-ci:
     109{{{
     110$ cat > racoon.conf << EOF
     111#  $File: /home/chris/PRes/Postes_Rackables/ipsec_client1/racoon.conf $
     112#  $MD5: 2922df40b60a8f1eb7116f90a485f84a $
     113#  $By Christophe Alladoum <christophe[dot]alladoum[at]gmail[dot]com>$
     114#  $Last-Modified: Fri Apr 20 18:28:11 2007$
     115
     116#
     117# Configuration de RACOON cote client
     118#
     119
     120path include "/chemin/absolu/vers/ce/repertoire" ;
     121
     122path pre_shared_key "/chemin/absolu/vers/psk.txt" ;
     123# path pre_shared_key "/root/ipsec_client1/psk.txt" ;
     124# path certificate "/usr/local/etc/cert" ;
     125
     126# "log" indique le niveau de debug
     127# choix : notify, debug, debug2
     128# log debug;
     129
     130padding
     131{
     132        maximum_length 20;      # maximum padding length.
     133        randomize off;          # enable randomize length.
     134        strict_check off;       # enable strict check.
     135        exclusive_tail off;     # extract last one octet.
     136}
     137
     138# Interfaces a ecouter (IPv4 et/ou v6)
     139# Si aucune, ecoute sur toutes les interfaces de la machine
     140listen
     141{
     142        # pour le client IPv4
     143        isakmp 10.40.0.13 [500];
     144        # pour le client IPv6
     145        # isakmp ::1 [7000];
     146}
     147
     148# Temporisateurs d echange de cle
     149timer
     150{
     151        counter 5;              # maximum trying count to send.
     152        interval 20 sec;        # maximum interval to resend.
     153        persend 1;              # the number of packets per a send.
     154
     155        # Temps max. pour chaque phase
     156        phase1 2 min;
     157        phase2 4 min;
     158}
     159
     160# Cas du client1
     161remote 10.40.0.9
     162{
     163        exchange_mode aggressive,main;
     164        doi ipsec_doi;
     165        situation identity_only;
     166
     167        nonce_size 16;
     168        lifetime time 60 min;   # sec,min,hour
     169        initial_contact on;
     170        support_proxy on;
     171        proposal_check obey;    # obey, strict or claim
     172
     173        proposal {
     174                encryption_algorithm blowfish;
     175                hash_algorithm sha1;
     176                authentication_method pre_shared_key ;
     177                dh_group 5 ;
     178        }
     179}
     180
     181# Cas du client1
     182sainfo anonymous
     183{
     184        pfs_group 5;
     185        lifetime time 48 hour;
     186        encryption_algorithm 3des, cast128, blowfish 448, des;
     187        authentication_algorithm hmac_md5, hmac_sha1;
     188        compression_algorithm deflate ;
     189}
     190EOF
     191}}}
     192   -> A présent, lancez:
     193{{{
     194$ /usr/local/sbin/racoon -l /var/log/racoon.log -f /chemin/vers/racoon.conf
     195}}}
     196Un fichier de log (utile pour le debug) sera crée à l'adresse /var/log/racoon.log
     197   -> ''' Votre Racoon est lancé  !! '''
    74198[[BR]]
    75199----