What is the difference between IKEv1 main mode and aggressive mode?
Show the answer
Say this first
Main mode uses six messages: two to agree the policy, two for the Diffie-Hellman values and nonces, and two, already encrypted, to exchange identities and authenticate. Aggressive mode squeezes that into three messages, so the identities go out before encryption is in place. With a pre-shared key, the aggressive-mode hash can be captured and attacked offline, so main mode is preferred. Aggressive mode exists for peers with dynamic addresses where the responder needs the identity to pick the right key.
Go deeper
Main mode
| Msg | Direction | Content |
|---|---|---|
| 1 | initiator to responder | SA proposals |
| 2 | responder to initiator | chosen proposal |
| 3 | initiator to responder | DH public value, nonce (plus NAT-D hashes with NAT-T) |
| 4 | responder to initiator | DH public value, nonce (plus NAT-D) |
| 5 | initiator to responder | encrypted: identity, authentication |
| 6 | responder to initiator | encrypted: identity, authentication |
Aggressive mode
| Msg | Direction | Content |
|---|---|---|
| 1 | initiator to responder | SA proposals, DH value, nonce, identity |
| 2 | responder to initiator | chosen SA, DH value, nonce, identity, authentication hash |
| 3 | initiator to responder | authentication hash |
The PSK catch in main mode
With a PSK, the keys that protect messages 5 and 6 are derived from the PSK, so the responder must
choose the key before it has seen the peer's identity. It can only choose by source IP address. That
is why main mode with PSK and dynamic peer addresses needs a wildcard key
(crypto isakmp key KEY address 0.0.0.0), and why certificates or IKEv2 are the better answer.
They will ask next
Does IKEv2 have an aggressive mode?
No. IKEv2 has one way to start: four messages in two exchanges, IKE_SA_INIT and IKE_AUTH, and identities are always sent encrypted in IKE_AUTH.
How can you tell the modes apart in IOS show output?
The ISAKMP SA states differ. Main mode states start with MM_ (MM_NO_STATE, MM_SA_SETUP, MM_KEY_EXCH), aggressive mode states with AG_. Both end in QM_IDLE once phase 1 is complete.
Traps
- Saying aggressive mode uses weaker ciphers. Same ciphers; the weakness is identity exposure and offline cracking of the PSK.