IPSec & IKEv2
IPSec is two layers wearing one name, and almost every confusion about it comes from that: IKEv2 is a userspace control plane and the ESP data path on Linux is the kernel's XFRM stack, so the daemon installs the security association over netlink and then never touches a packet. The consequence this module leads with is a number. When the far end disappears, the tunnel blackholes for minutes — because there is no dead-peer-detection timeout to tune on an IKEv2 connection at all, so what you actually wait through is the idle interval you configured plus the entire retransmission sequence after it, each attempt 1.8 times longer than the last, 165 seconds of it at stock settings against a 30-second interval. The daemon sums that total itself and strongSwan publishes the stock result as a kernel sysctl written to /proc/sys/net/core/xfrm_acq_expires, which makes the retransmission count a control-plane slider that moves a kernel timeout. Underneath that sits the fact the documentation does not quite state: whether your data traffic counts as liveness depends on whether there is a NAT. The IKE SA's notion of recent use is written by inbound IKE messages, and ESP traffic reaches the calculation only through the CHILD_SAs and only when UDP encapsulation puts them on the same path — so with no NAT, a tunnel saturated with ESP still looks idle and is asked the question every interval, while the same tunnel behind a NAT goes quiet. The four opening messages are drawn against the encoder's own rule table, where whether payloads are wrapped is a boolean column rather than a convention: IKE_SA_INIT is false in both directions and IKE_AUTH true, and the rule is enforced payload by payload as the message is built. That table also shows what message three really is — every payload optional, with three of them flagged so that one is enough, which is why an EAP round trip carries no AUTH payload and why an IKE_AUTH with no CHILD_SA in it is a valid message. The CHILD_SA is then two separate installs, the policies and the SA, which is the reason a tunnel can be genuinely up in every status output and still pass nothing; and perfect forward secrecy turns out to be a transform inside the CHILD proposal rather than a daemon-wide switch, with the branch that skips it commented 'no PFS' in the source. ESP's seal is drawn to the byte: the SPI and sequence number are authenticated and travel in the clear, everything after them is encrypted and authenticated by a single call, transport mode leaves the inner addresses visible where tunnel mode wraps them, and the packet fails outright once the sequence counter cycles — a lifetime measured in packets, not only seconds. NAT traversal is priced honestly: a four-byte marker on every IKE message that the encoder subtracts from its own fragmentation budget, eight bytes on every ESP packet because ESP has no ports for a NAT to rewrite or demultiplex, and a single-byte keepalive sent only by the side actually behind the NAT. Change the exchange, the proposal, PFS, the DPD interval, the retransmission count, NAT traversal, the keepalive interval, the mode and the protocol, and watch the server-computed cascade across the IKEv2 exchange, the CHILD_SA, ESP and AH, dead peer detection and NAT traversal. Validated against strongSwan 6.0.7 source, with AH packet behaviour cited to RFC 4302 because the pinned userland data path implements ESP only.
- All current + future modules
- Full kata library
- Progress dashboard + weak area analysis
Cancel anytime. Billed annually.