Site-to-site IPsec: a private tunnel over the internet
▶ Start the interactive lesson
Burrow opens a new depot in Leeds with a cheap broadband line. Finance in London needs the depot's stock system, and it must be encrypted. You build the tunnel, but the status stays down. Maya reads the log over your shoulder: "phase 1: no proposal chosen." "Both ends have to agree on exactly how…
Key points
- Phase 1 (IKE) builds a secure management channel: peers authenticate (pre-shared key or certificates) and agree encryption, hash, DH group and lifetime. IKE uses UDP 500, and UDP 4500 when NAT is in the path (NAT-T).
- Phase 2 (IPsec SA) builds the data tunnel: agree encryption/hash (and PFS if used) and the selectors (proxy IDs): which local and remote subnets go through it. Mismatched selectors are a classic "phase 1 up, phase 2 down".
- The data itself is carried in ESP (IP protocol 50), or inside UDP 4500 with NAT-T. If an upstream device blocks these, the tunnel won't build.
- Route-based vs policy-based: route-based VPNs create a tunnel interface and you route subnets into it (flexible, supports dynamic routing and redundancy). Policy-based VPNs match traffic by policy/selectors directly. Real designs use two tunnels over two ISPs, or meshes and hub-and-spoke with on-demand shortcuts between spokes. GRE over IPsec carries multicast and routing protocols, and newer IKEv2 options add quantum-resistant key exchange.
- A tunnel that's up isn't the end. You still need a route to the far subnet via the tunnel and policies both ways (LAN ↔ tunnel), with no NAT on that traffic.
The full lesson has more: animations, a hands-on exercise, 3 quiz questions and spaced review cards. Open it free →