1/15
Looks like no tags are added yet.
What will the first tunnel ping look like on eth1 if we forget the NAT exclusion?
the plaintext packet leaves with a private destination
Explain the structure of swanctl.conf
A connections section holds one or more connections; each has version = 2, local_addrs, remote_addrs, proposals, a local and a remote block (each with auth and id) and a children block
A child names the traffic selectors local_ts and remote_ts, esp_proposals, mode = tunnel, start_action and dpd_action
A secrets section holds PSKs (ike-name { id-1 = ...; id-2 = ...; secret = "..." })
Unlike the old ipsec.conf, there is no left/right swapping: local is always this machine, so the two ends are written the same way round
What is the swanctl.conf working loop?
(1) Edit the file
(2) swanctl --load-all
(3) swanctl --initiate --child NAME (or let start_action = start do it)
(4) swanctl --list-sas
What is the output of swanctl.conf?
the IKE SA state, the algorithms, the ids, the uptime and, per child, the selectors, SPIs and byte counters
What is the first clue that traffic is not entering the tunnel?
Counters that do not move
What does ip xfrm policy do?
lists what the kernel will encrypt (a pair of selectors per direction, plus forwarding)
What does ip xfrm state do?
lists the negotiated SAs with their SPIs
What does tcpdump -i eth1 esp do?
shows what the classroom sees: only the outer addresses and an SPI
If the SA is up but ip xfrm policy shows no policy, or the counters never rise, where is the problem?
in the traffic selectors, not in IKE
What is a PSK’s weakness?
It’s too simple. One secret, known to both ends, agreed out of band. Use a long random value, never a word. Two peers that compromise each other's host lose the secret for both
What is the likely cause and fix for the following issue: No SA after load
PSK or ids differ, wrong addresses, or the other end is not loaded
Read journalctl -u strongswan; compare ids and addresses; confirm both ends ran swanctl --load-all
What is the likely cause and fix for the following issue: "no proposal chosen"
The two ends specify different proposals
Use identical IKE and ESP proposals on both ends
What is the likely cause and fix for the following issue: SA is up but the ping fails
MASQUERADE has not been excluded, a traffic selector is wrong, or forwarding is off
Capture on eth1; check ip xfrm policy; check the nat rule and ip_forward
What is the likely cause and fix for the following issue: S2 lost internet after the fix
The rule excludes too much, or was not re-added
Check iptables -t nat -S POSTROUTING; the internet traffic must still match MASQUERADE
What is the likely cause and fix for the following issue: Tunnel drops after a reboot
The connection is not loaded at start, or the rule was not persisted
Confirm the service is enabled and the saved rules include the new rule
What is the likely cause and fix for the following issue: Replies vanish with a good SA
Reverse-path filtering, or the partner's exclusion is missing
Check sysctl net.ipv4.conf.all.rp_filter on both ends and the partner's nat rule