A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
The Cisco IOS IPsec configuration has a distinct four-part structure: IKE policy (Phase 1 parameters), pre-shared key, IPsec transform set (Phase 2 parameters), and crypto map (which binds the policy to interfaces and traffic). Miss any part, and the tunnel silently fails to establish.
IPsec negotiation happens in two phases. Phase 1 establishes a secure channel between the two peers so they can negotiate safely. Phase 2 negotiates the actual encryption parameters for data traffic, resulting in the IPsec Security Associations.
| Phase | Purpose | Parameters negotiated |
|---|---|---|
| IKE Phase 1 | Establish secure management channel | Encryption, hash, authentication method, DH group, lifetime |
| IKE Phase 2 | Establish data encryption SAs | Encryption, hash, mode (tunnel/transport), lifetime, PFS |
Phase 1 uses Diffie-Hellman to establish a shared secret without ever transmitting it. Both peers derive the same key independently. Phase 2 reuses the secure channel from Phase 1 to negotiate the actual data encryption — this is faster because the peers trust each other after Phase 1.
Both peers must have matching Phase 1 parameters (encryption, hash, auth, DH group) and matching Phase 2 parameters (encryption, hash, mode, PFS). A single mismatch and the tunnel won't establish. When troubleshooting, compare `show crypto isakmp sa` and `show crypto ipsec sa` on both ends.
! === Phase 1: IKE Policy ===crypto isakmp policy 10encryption aes 256hash sha256authentication pre-sharegroup 14lifetime 86400exit! Pre-shared key for the peercrypto isakmp key StrongPSK123 address 203.0.113.2! === Phase 2: IPsec Transform Set ===crypto ipsec transform-set TS_AES256 esp-aes 256 esp-sha256-hmacmode tunnelexit! === Crypto ACL: which traffic to encrypt ===ip access-list extended VPN_TRAFFICpermit ip 10.10.10.0 0.0.0.255 10.10.20.0 0.0.0.255exit! === Crypto Map: binds it all together ===crypto map VPN_MAP 10 ipsec-isakmpset peer 203.0.113.2set transform-set TS_AES256match address VPN_TRAFFICexit! Apply to the WAN interfaceinterface gigabitEthernet0/0crypto map VPN_MAPexit
The structure is: IKE policy (Phase 1 params), pre-shared key, transform set (Phase 2 params), ACL defining interesting traffic, crypto map binding it together, and application to the WAN interface. Same config on both sides, with mirrored peer addresses and matching crypto ACLs.
`QM_IDLE` (Quick Mode Idle) means the IKE SA is established and waiting. `ACTIVE` confirms it's usable. If the state is `MM_NO_STATE` or `MM_KEY_EXCH`, Phase 1 is still negotiating or failed — usually a parameter mismatch.
The `#pkts encaps` and `#pkts decaps` counters confirm traffic is flowing through the tunnel. If both are zero, either no interesting traffic is being generated, or the tunnel isn't up. Check the routing first, then the crypto ACL matches.
Finish the lesson once you have worked through the material. This awards ★ 30 XP.