IPsec Site-to-Site VPNs
Two offices need to talk as if they shared one wire, even though the only path between them is the public Internet. A site-to-site VPN does exactly that: it encrypts traffic inside a secure tunnel between two edge routers, so the network looks private and reads like private traffic to anyone outside. This lesson covers the VPN concept, the IPsec machinery (IKE, AH vs ESP), the two modes, and why GRE-over-IPsec exists.
- Define a VPN and contrast site-to-site with remote access.
- Explain how IKE establishes the security association and keys.
- Compare the two IPsec protocols AH (authentication only) and ESP (encrypts).
- Distinguish transport mode from tunnel mode and say when each is used.
- Identify confidentiality, integrity, and authentication and where each comes from.
- Explain why GRE over IPsec is used for routing protocols and multicast.
What a VPN is
A Virtual Private Network (VPN) is a private network built on top of a public one. The “virtual” is doing real work: the private segments behave as if directly connected, but the packets actually travel across the Internet inside protected tunnels. The security properties of that tunnel are encryption (no one else can read the data), integrity (no one can silently change it), and authentication (we know which device sent it).
VPNs save money and time: instead of leased lines you use your existing Internet service, and instead of installing client software you can tunnel at the network edge for whole offices. The trade is that everything the tunnel carries becomes dependent on encryption being done right.
Site-to-site vs remote access
VPNs divide by who the endpoints are:
- Site-to-site VPN — a tunnel between two network devices (typically routers or firewalls), joining two whole networks. Neither human logs in: both ends authenticate each other (usually with pre-shared keys or certificates) and encrypt everything between their subnets.
- Remote-access VPN — a tunnel between one roaming client (laptop, phone) and a concentrator at the head office. The user launches a client, authenticates personally, and gets an encrypted channel into the corporate network.
| Characteristic | Site-to-site | Remote access |
|---|---|---|
| Endpoints | Router ↔ router (two sites) | Client software ↔ concentrator |
| Who authenticates | The two devices | The individual user |
| What it secures | Whole subnets behind each edge | One device’s traffic |
| Typical protocol | IPsec (often over GRE) | SSL/TLS VPN or client IPsec |
The exam line to remember: site-to-site = device-to-device, no per-user login; remote access = one user device at a time, per-user authentication.
IPsec and the IKE handshake
IPsec (Internet Protocol Security) is a framework of protocols protecting IP traffic, and it is the standard for site-to-site VPNs. It has two working parts:
- IKE (Internet Key Exchange) — the negotiation phase. The two peers agree on the algorithms, exchange key material, authenticate each other, and derive session keys. IKE originally ran in two phases (ISAKMP phase 1 = secure channel + IKE SA; phase 2 = IPsec SA for the data), and behind the scenes the exam still expects you to know the concept of IKE building a trust channel before data IPsec starts.
- ESP/AH — the data plane. Once the security associations exist, ESP encrypts and authenticates the actual packets, and AH provides integrity/authentication (next section).
IKE is essential because IPsec has no built-in way to agree on keys. It uses UDP port 500 (with IKEv1) and can use a pre-shared key (PSK) or digital certificates for peer authentication. A PSK is a shared secret phrase; a certificate proves identity through a CA. Both are legitimate, and the exam wants you to know the choice exists.
AH vs ESP
IPsec’s data protection comes from two protocols. Pick and compare:
| Protocol | Confidentiality | Integrity / Authentication | Typical use |
|---|---|---|---|
| AH (IP 51) | None — no encryption | Yes, on the whole packet | Rare in modern VPNs; legacy/odd compliance cases |
| ESP (IP 50) | Yes — encrypts the payload | Yes — authenticates the part it processed | The default and near-universal choice |
The one-line contrast to retain: ESP encrypts and authenticates; AH only authenticates. Because AH does not encrypt, it offers integrity and authentication without confidentiality endpoint — and it is blocked by NAT easily, since it authenticates IP addresses (including ones NAT rewrites), which is why ESP dominates in the real world.
Transport vs tunnel mode
IPsec can protect packets in one of two modes, and the exam loves the distinction:
- Transport mode — IPsec only protects the transport segment (the payload above the IP header). The original IP header stays visible and the endpoints are the same hosts whose traffic is protected. Used when the two hosts communicate directly (host-to-host) or when a tunnel protocol like GRE carries the routing information and IPsec secures it in transport mode.
- Tunnel mode — the whole original IP packet is wrapped in a new outer IP header plus IPsec header. The endpoints of the tunnel (the gateways) differ from the underlying hosts, which is exactly the site-to-site situation: host A→host B traffic is wrapped in a packet between gateway 1 and gateway 2. The original addresses are hidden inside the encryption.
The rule of thumb: gateway-to-gateway (site-to-site) → tunnel mode; host-to-host → transport mode. GRE-over-IPsec is the interesting hybrid: GRE handles the tunnelling/multicast job and IPsec runs in transport mode on top, so GRE nesting is not needed twice.
Confidentiality, integrity, and authentication
Encryption is only one pillar of IPsec. The full set is what makes a tunnel trustworthy, and each pillar maps to a distinct mechanism:
| Property | Question it answers | Who provides it |
|---|---|---|
| Confidentiality | Can anyone else read the data? | Encryption by ESP using algorithms like AES |
| Integrity | Was the data changed in transit? | An HMAC/digest in ESP or AH (e.g., SHA-based) |
| Authentication | Is this really the peer we agreed with? | IKE peer auth (PSK or certificate) plus per-packet authentication on ESP/AH |
- Confidentiality — AES is the modern encryption standard for IPsec; DES/3DES are legacy and deprecated.
- Integrity — a message digest (hash) computed on the data; any change in transit makes the digest fail when the receiver re-checks it.
- Authentication — the digest is computed with a secret key (a keyed-hash, HMAC), so only someone with the key could have produced it — which is what proves the peer is genuine and the packet was not spoofed.
GRE over IPsec
Plain IPsec carries unicast IP payloads, but it does not natively support multicast or broadcast. Routing protocols (OSPF, EIGRP), video multicast, and other destination-free traffic therefore cannot cross a bare IPsec tunnel. GRE (Generic Routing Encapsulation) provides the tunnelling that can carry multicast, and it encapsulates the whole payload in a GRE header ending at the far gateway. But GRE alone is unencrypted — anyone on the Internet can read the GRE packets. So the standard design is GRE over IPsec: GRE carries the routing and multicast, then IPsec (in transport mode, protecting the GRE traffic) adds confidentiality, integrity, and authentication.
A site-to-site VPN in IOS
A minimal IOS site-to-site configuration shows the moving parts: an ISAKMP/IKE policy, a transform set (the encryption + integrity pair), the crypto ACL that matches which traffic to protect, and finally the crypto map that ties it to the peer and interface. Here is the skeleton:
! IKE policy: encryption AES, hash SHA, PSK authentication R-A(config)# crypto isakmp policy 10 R-A(config-isakmp)# encryption aes R-A(config-isakmp)# hash sha R-A(config-isakmp)# authentication pre-share R-A(config-isakmp)# group 2 R-A(config-isakmp)# crypto isakmp key SiteKey1234 address 203.0.113.2 R-A(config-isakmp)# exit ! Transform set: AES encryption + HMAC-SHA R-A(config)# crypto ipsec transform-set TS-AES esp-aes esp-sha-hmac ! Traffic to protect: Site-B private subnet R-A(config)# access-list 101 permit ip 10.1.0.0 0.0.0.255 10.2.0.0 0.0.0.255 ! Crypto map bound outbound R-A(config)# crypto map S2S-VPN 10 ipsec-isakmp R-A(config-crypto-map)# set peer 203.0.113.2 R-A(config-crypto-map)# set transform-set TS-AES R-A(config-crypto-map)# match address 101 R-A(config-crypto-map)# exit R-A(config)# interface gigabitethernet0/1 R-A(config-if)# crypto map S2S-VPN R-A(config-if)# end R-A# show crypto isakmp sa R-A# show crypto ipsec sa
Do not memorize the whole config — do internalise the pieces: IKE policy (algorithm +
PSK), transform set (ESP + integrity), crypto ACL (what to protect), crypto map (peer + binding). The
verification commands end with show crypto isakmp sa and show crypto ipsec sa,
and a classic troubleshooting fact: if the crypto ACLs on both ends do not mirror each other, the tunnel
never establishes.
The vocabulary you need
Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics. cisco.com.
- IETF. Request for Comments (RFCs). rfc-editor.org.
- IANA. Internet Assigned Numbers Authority registries. iana.org.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.