0:00–0:10
Recap
0:10–1:50
Lab 5B
1:50–2:00
Debrief
0:00 – 0:10Recap · 10 min
0:10 – 1:50Lab 5B · 100 min

Lab 5B — Install StrongSwan, configure PSK VPN, verify SA and encrypted traffic

Part 1 — Install StrongSwan on S1 and S3 (10 min)

Part 2 — Configure ipsec.secrets (15 min)

Part 3 — Configure ipsec.conf (25 min)

Part 4 — NAT exclusion rule (15 min)

Part 5 — Start ipsec and verify (25 min)

Lab 5B complete when: ipsec status shows 1 SA up. Ping from S2 reaches S3's LAN IP. tcpdump on eth0 shows ESP packets during the ping. Internet access from S2 still works (NAT exclusion working correctly).
1:50 – 2:00Debrief · 10 min

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

Configure a StrongSwan PSK tunnelWrite ipsec.secrets and ipsec.conf on both endpoints with correct left/right configuration
Apply the NAT exclusion ruleWrite an iptables rule that masquerades internet traffic but not VPN-bound traffic
Verify a VPN SA with ipsec statusInterpret the status output and identify a healthy vs failed SA
Confirm encrypted traffic with tcpdumpCapture ESP packets on the external interface and explain what the encrypted payload means

Common issues and fixes

IssueLikely causeFix
ipsec status shows 0 SAs after restartPSK mismatch, wrong IPs in ipsec.conf, or firewall blocking UDP 500Check syslog: sudo grep charon /var/log/syslog | tail -30. Common messages: "no proposal chosen" (cipher mismatch), "authentication failed" (PSK wrong), "peer not responding" (firewall/connectivity)
S2 cannot ping S3's LAN even with SA upNAT exclusion rule not applied, or applied on wrong interfaceCheck: sudo iptables -t nat -L POSTROUTING -n. The rule must show ! -d 192.168.51.0/24. Also verify S3 has the matching exclusion for its MASQUERADE rule
S2 loses internet access after NAT exclusion ruleExclusion rule syntax error — may be excluding all trafficCheck: from S2, ping 8.8.8.8. If failing, verify the ! -d syntax is correct. The ! must precede -d, not -s
← Day 1 Lab 5B Handout Day 3 →