0:00–0:10
Recap
0:10–1:50
Lab 5D
1:50–2:00
Wrap
0:00 – 0:10Recap · 10 min
0:10 – 1:50Lab 5D · 100 min

Lab 5D — Part 1: Migrate IPSec to cert auth. Part 2: Build WireGuard tunnel. Part 3: Compare.

Part 1 — Migrate to certificate authentication (45 min)

Part 2 — Build a WireGuard tunnel (45 min)

Part 3 — Compare IPSec and WireGuard (10 min)

Lab 5D complete when: ipsec status shows cert-based SA (DN visible in output). S2 can ping S3's LAN through IPSec tunnel. WireGuard wg show shows latest handshake. ping 10.0.0.2 from S1 succeeds. Comparison table completed with thoughtful answers.
1:50 – 2:00Wrap · 10 min

Learning outcomes — by end of Day 4, students can…

Migrate IPSec from PSK to certificate authUpdate ipsec.secrets to RSA, add leftcert/leftid/rightid to ipsec.conf, and verify the SA re-establishes
Configure a WireGuard tunnelGenerate key pairs, write [Interface] and [Peer] config sections, bring up with wg-quick, verify with wg show
Explain WireGuard AllowedIPsDescribe how AllowedIPs serves as both a routing table and a packet filter in WireGuard
Compare IPSec and WireGuardArticulate the key differences in complexity, cryptographic flexibility, state management, and use cases

Common issues and fixes

IssueLikely causeFix
IPSec cert tunnel: "no trusted CA found" in syslogcaCert.pem not in /etc/ipsec.d/cacerts/ on one sideCheck: ls /etc/ipsec.d/cacerts/ on both S1 and S3. Both must have caCert.pem. Copy it if missing
IPSec cert tunnel: "no matching peer config"leftid or rightid in ipsec.conf doesn't exactly match the DN in the certificateRun: ipsec pki --print --in /etc/ipsec.d/certs/s1Cert.pem and compare the subject DN to leftid in ipsec.conf. They must match character for character including spaces and capitalisation
WireGuard wg show shows no peers or no handshakePublic key mismatch, wrong endpoint IP, or UDP 51820 blocked by firewallVerify public keys are exactly correct (copy-paste error is common). Check UFW: sudo ufw allow 51820/udp. Ping the endpoint IP first to confirm connectivity
wg-quick up fails: "Cannot find device wg0"WireGuard kernel module not loadedLoad manually: sudo modprobe wireguard. Then retry wg-quick up wg0
← Day 3 Lab 5D Handout Day 5 →