There are several tasks involved when configuring IPSec for IOS-based routers:
Plan for IKE and IPSec
Define the IKE Phase 1 Policy
Define the IKE Phase 2 Policy
Create a crypto map
Apply the crypto map