IKE / ISAKMP 101
ISAKMP
The ISAKMP framework is a collection of methods used to manage the establishment of SAs and the keys involved in the process. IKE is a protocol that implements the ISAKMP framework. ISAKMP requires and IKE implements a 2 phase process for establishing an IPSec SA. In the 1st phase, an ISAKMP SA is established. The ISAKMP SA is then used to protect the negotiations for the IPSec SA in the 2nd phase.
There are 2 version of IKE: IKEv1 (RFC2409) and IKEv2(RFC 4306).
The ISAKMP policy includes:
An authentication method to ensure the identity of the peers
An encryption method to protect the data and ensure privacy
A HMAC (Hased Message Authentication Code) method to ensure the identiy of the sender and to ensure that the message has not been modified in transit
A DH group (Diffie-Hellman) to determine the strenght of the encryption-key-algorithm. This algorithm is then used to derive the encryption and hash keys
A session lifetime of the encryption key before it needs to be replaced.
ISAKMP separates the negotiation in 2 phases:
Phase 1: The two peers establish a secure and authenticated tunnel. This tunnel is known as ISAKMAP SA. In this phase the tunnel protects the Control Plan between the peers. This communication runs on UDP 500 and UDP 4500. For IKEv2 there are 4 messages exchanged. For IKE v1 Phase 1 can run in two modes:
IKE Main Mode: Uses a minimum of 6 messages before the SA is established. Also provides identity protection.
IKE Aggressive Mode: Uses a minimum of 3 messages before the SA is established. Does not provide identity protection.
Phase 2: In this pahse the peers negotiate key materials and algorithms for the encryption (SAs) of the data to be transfered over the IPSec tunnel. In this phase the tunnel protects the Data Plane and ESP is used to encapsulate and encrypt the traffic. This phase is also called Quick Mode
IKE Quick Mode: Similar to IKE Aggressive Mode, but protected by the ISAKMP SA negotiated in Phase 1
Configuring ISAKMP Phase 1
By default, a Cisco router uses Main Mode in Phase 1, except when pre-shared keys are used. This can be disabled with:
In ISAKMP phase 1, the router looks up through the set of ISAKMP policies, in order of the SEQ. To define the ISAKMP policy, use the following commands:
There is a default is a isakmp policy that doesn't support pre-shared keys so when you want to use pre-shared keys you have to define a manual entry in the ISAKMP set of rules. You can see it with:
IKE Authentication
IKE authentication can be performed using pre-shared keys, PKI with digital certificates (X.509) or using RSA encrypted nonce. Depending on the authentication method you specified in the ISAKMP policy you will have to define one set of parameters or another.
Pre-Shared Key
Pre-shared keys are a simple way of authentication. To configure a pre-shared key, use:
RSA encrypted nonces
Follow these steps to generate RSA keys: First, set the hostname and domain:
Verify the key exists with:
Now, you need to configure the public key-chain, with the public keys of the other peers:
PKI with digital certificates (X.509)
This will be discussed in a later topic
Additional ISAKMP configuration
To completely disable IKE, use:
You will have to manually specify all IPSEC SA information in the crypto maps. By default, each peer is identified by the IP address of the interface where the crypto map is applied. You can change this to either the hostname (used when the interface IP is not knwon – DHCP, or when multiple interfaces are used for IKE.) or to the DN (distinguished name – used for certificate-based authentication)
To enable the recovery from “Invalid SPI” erros, use:
To enable Dead Peer Detection, use:
If IPSec is used with NAT, you can enable the router to send periodic keepalives just to keep the NAT translation active:
Last updated