Concepts / VPNs

VPNs

IPsec

Also called IKE, IKEv2, ESP, security association, SA, SPI, site-to-site VPN, strongSwan, traffic selector

Encryption at the IP layer: IKE agrees keys between two gateways, ESP carries their traffic encrypted.

IKE agrees the keys, ESP carries the packets
IKE agrees the keys, ESP carries the packets

IKE is a short conversation that proves who the gateways are and agrees keys. ESP then carries each whole original packet, encrypted, inside a new packet between the two gateways.

IPsec encrypts packets at the IP layer, between two gateways joining two sites. IKEv2 (UDP 500, or 4500 behind NAT) authenticates the gateways and agrees keys. ESP (IP protocol 50) in tunnel mode carries whole packets, headers included, so the path sees only that the two sites talk. Both ends must agree which traffic goes in (the traffic selectors). The added headers shrink the MTU by 50 to 70 bytes.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab