Sélection du proposal · Match FVRF · Match adresse locale · ENARSI
La policy fait le lien entre le contexte réseau (adresse locale, VRF) et le proposal à utiliser. Elle est consultée avant l'envoi du IKE_SA_INIT — Cisco sélectionne la policy qui matche, puis envoie ses proposals dans le MSG 1.
| Objet | Rôle | Lié à |
|---|---|---|
| Proposal | Définit les algos (encryption, integrity, DH…) | Référencé dans Policy |
| Policy | Choisit le(s) proposal(s) selon le contexte réseau | Référence Proposal(s) |
| Profile | Gère l'identité et l'authentification (PSK/cert) | Indépendant de Policy |
! ── Créer la policy ───────────────────────────────────────── Router(config)#crypto ikev2 policy ikev2_policy IKEv2 policy MUST have at least one complete proposal attached Router(config-ikev2-policy)# ! ── Commandes disponibles ──────────────────────────────────── Router(config-ikev2-policy)#? exit Exit from IKEv2 policy configuration mode match Match values of local fields no Negate a command or set its defaults proposal Specify Proposal
! ── Attacher un proposal (doit être complet et existant) ───── Router(config-ikev2-policy)#proposal PROP-IKEv2 ! ── Erreur : proposal inexistant ──────────────────────────── Router(config-ikev2-policy)#proposal PROP-INEXISTANT % No Proposal exists with the specified name PROP-INEXISTANT ! ── Erreur : proposal incomplet ───────────────────────────── Router(config-ikev2-policy)#proposal PROP-INCOMPLET Proposal PROP-INCOMPLET is not complete to be attached to policy
! ── Config minimale complète ───────────────────────────────── crypto ikev2 proposal PROP-IKEv2 encryption aes-cbc-256 integrity sha256 group 14 ! crypto ikev2 policy POL-IKEv2 proposal PROP-IKEv2 ← sans match = global VRF, toutes IPs
! ── Exemple : (mpls OR internet) AND (192.168.1.1 OR 2001::1) ── Router(config-ikev2-policy)#match fvrf mpls Router(config-ikev2-policy)#match fvrf internet Router(config-ikev2-policy)#match address local 192.168.1.1 Router(config-ikev2-policy)#match address local 2001::1
! ── Per-peer policy : adresses locales différentes ────────── crypto ikev2 policy Policy1 match address local 192.168.1.1 ← Peer1 : tunnel dest 192.168.1.1 proposal Proposal1 ← AES-GCM-128, DH19 (NGE) ! crypto ikev2 policy Policy2 match address local 192.168.2.1 ← Peer2 : tunnel dest 192.168.2.1 proposal Proposal2 ← AES-CBC-128, DH14
! ── Policy avec deux proposals (GCM + CBC) ─────────────────── crypto ikev2 policy default proposal Proposal1 ← AES-GCM-128, DH19 (préféré) proposal Proposal2 ← AES-CBC-128, DH14 (fallback) ! Les deux partent dans le SA payload du IKE_SA_INIT (MSG 1) ! DH pré-calculé sur Proposal1 (le préféré de l'initiateur)
Router#show crypto ikev2 policy IKEv2 policy : default Match fvrf : any Match address local : any Proposal : default IKEv2 policy : POL-IKEv2 Match fvrf : global Match address local : 192.168.1.1 Proposal : PROP-IKEv2
Router#show crypto ikev2 policy ikev2_policy IKEv2 policy : ikev2_policy Match fvrf : mpls Match fvrf : internet Match address local : 192.168.1.1 Match address local : 2001::1 Proposal : ikev2_proposal1 Proposal : ikev2_proposal2
Router#show run | begin ikev2 policy crypto ikev2 policy POL-IKEv2 match fvrf mpls match address local 192.168.1.1 proposal PROP-IKEv2
Router#show run | begin ikev2 policy crypto ikev2 policy POL-VIDE ! Policy Incomplete ! (MUST have at least one ! complete proposal attached)
Router#terminal monitor Router#debug crypto ikev2 error ! ── Policy trouvée (initiateur) ────────────────────────────── IKEv2:Searching Policy with fvrf 0, local address 192.168.1.1 IKEv2:Found Policy 'default' IKEv2:(SESSION ID = 3,SA ID = 1):Generating IKE_SA_INIT message ! ── Aucune policy (initiateur) ─────────────────────────────── IKEv2:Searching Policy with fvrf 0, local address 192.168.1.1 IKEv2-ERROR:Failed to initiate sa ! ── Aucune policy (répondeur — après IKE_SA_INIT reçu) ─────── IKEv2:Searching Policy with fvrf 0, local address 192.168.1.2 IKEv2-ERROR:(SESSION ID = 851):Failed to locate an item in the database IKEv2:(SESSION ID = 851):Failed SA init exchange IKEv2:(SESSION ID = 851):Abort exchange IKEv2:(SESSION ID = 851):Deleting SA
! Désactiver Router(config)#no crypto ikev2 policy default Router#show crypto ikev2 policy default IKEv2 policy : default Disabled ! Restaurer Router(config)#default crypto ikev2 policy
! Supprimer "any" avant fvrf spécifique Router(config-ikev2-policy)#match fvrf mpls % Specific vrf cannot be configured when fvrf type any is already set. Router(config-ikev2-policy)#no match fvrf any Router(config-ikev2-policy)#match fvrf mpls ← OK
! EDG — show crypto ikev2 proposal IKEv2 proposal: Prop-Ikev2 ← configuré mais jamais utilisé (pas de policy) Encryption : AES-CBC-128 Integrity : SHA256 PRF : SHA256 DH Group : DH_GROUP_1024_MODP/Group 2 IKEv2 proposal: default ← celui qui est réellement utilisé via la default policy Encryption : AES-CBC-256 AES-CBC-192 AES-CBC-128 Integrity : SHA512 SHA384 SHA256 SHA96 MD596 PRF : SHA512 SHA384 SHA256 SHA1 MD5 DH Group : DH_GROUP_1536_MODP/Group 5 DH_GROUP_1024_MODP/Group 2