Lab details

L2TP PPP/NCP Docker Interop Lab

Peer-isolated Docker lab for full L2TP PPP/NCP/kernel dataplane evidence.

Overview

The lab runs Ze as an LNS, a real xl2tpd/pppd LAC, and optionally FRR as a BGP peer in separate Docker containers on an isolated bridge network. No container runs privileged: Ze and the LAC hold NET_ADMIN and the host's /dev/ppp device, and neither loads a kernel module. It proves the complete path from L2TP control tunnel through PPP LCP/IPCP, kernel pppN interface creation, dataplane connectivity, and BGP route redistribution from a live PPP session.

Layout

test/interop-l2tp/
  Dockerfile.ze        Ze LNS image (Alpine + tini + iproute2 + ppp; copies the
                       ze-linux the suite preflight cross-compiles)
  ze-linux             the staged daemon, git-ignored and rewritten each run
  Dockerfile.ze-scale  maintained Ze runtime with the scale-only staged daemon
  ze-scale-linux       isolated allocator build, git-ignored
  avp-relay-linux      host-staged relay package, git-ignored
  Dockerfile.lac       LAC image (Alpine + xl2tpd + ppp + iproute2)
  daemons              FRR daemons config (zebra + bgpd)
  vtysh.conf           FRR vtysh config
  scenarios/
    01-ppp-ipv4/       PPP IPv4 dataplane proof
    02-ppp-bgp-redistribute-frr/   BGP route redistribution proof
    03-ze-lac-xl2tpd-lns/   ze as initiator (LAC) vs real xl2tpd LNS
    04-radius-acct-attrs/   subscriber attributes in RADIUS auth and accounting
    dns-resolver-l2tp-subscriber/   IPCP DNS to Ze's LAN resolver, then a lookup
    l2tp-unknown-mandatory-avp-xl2tpd/   unknown AVP, M=0 then M=1, through the relay
    ppp-code-reject-xl2tpd/   unknown LCP and IPCP Codes injected through the relay
    lcp-restart-timer-pppd/   configured retry interval and request budget after live LCP restart
    l2tp-lns-pppd-ipv6cp-rejected-by-lns/   stock pppd's IPv6CP and an injected CCP Protocol-Rejected, IPv4 kept
    l2tp-lns-pppd-noip-rejects-ipcp/   pppd noip rejects IPCP, Ze stops IPCP and ends at the no-NCP bound
    l2tp-lns-pppd-ipcp-terminate-redistribute/   relay and FRR: IPCP Terminate withdraws and reinstalls the /32
    l2tp-many-sessions-kl2tpd/   three LACs, sixteen PPP sessions per tunnel
    l2tp-lns-mru-xl2tpd/   configured MRU, CHAP, live daemon output, and traffic
    l2tp-lns-omitted-mru-xl2tpd/   default peer MRU and Ze-side transmit cap
    l2tp-lns-negotiated-mru-xl2tpd/   unequal configured/negotiated session output
    l2tp-lns-chap-only-xl2tpd/   PAP Nak refused before authentication
    l2tp-proxy-mru-transmit-cap/   accepted proxy AVPs, kernel MTU, and ICMP
    l2tp-radius-acct-wire-fixture/ original accounting fixture regression
internal/le/interoplab/l2tp/
  l2tp.go              Native topology, images, selection, and lifecycle
  checkers.go          Typed protocol assertions for the scenarios
  dns_resolver.go      The dns-resolver-l2tp-subscriber assertions
  mandatory_avp.go     The l2tp-unknown-mandatory-avp-xl2tpd assertions
  ppp_code_reject.go   The ppp-code-reject-xl2tpd assertions
  ppp_ipcp_reopen.go   Its IPCP withdrawal and reopen after the Terminate-Request
  ncp_lifetime.go      The three NCP lifetime scenarios' assertions
  lns_policy.go        MRU and CHAP-only typed assertions and daemon queries
  scale_overlay.go    guarded allocator candidate substitution for scale only
  scale.go            ordered launch, full-population proof and exact teardown
  scale_evidence.go   typed daemon, FRR and accounting evidence
  scale_kernel.go     point-to-point interfaces, routes and IPCP evidence
  scale_window.go     independent control trace and reliable-window proof
  avprelay/            UDP relay between the LAC and Ze, on 172.29.0.4
  radiusmock/          Independent Go RADIUS peer

Each scenario registers its checker, plan, kernel prerequisite and image selection in the owning L2TP lab. Discovery and the catalog read that same registry. Existing scenarios retain their established preparation; the scale scenario declares three kl2tpd LACs and three relays, plus Ze, FRR and FreeRADIUS. Its cleanup container list and failure diagnostics derive from those peer declarations.

The selected image declarations determine which host binaries are staged. Ordinary scenarios use the normal Ze daemon. The scale image reuses the same runtime image and replaces only its daemon with ze-scale-linux. That binary uses a temporary Go overlay to choose the lowest unused nonzero session ID within each tunnel. It retains the allocator's random read and error handling, zero and collision guards, and retry bound. The complete parsed allocator method must match the expected source shape before the overlay is written; allocator drift stops staging for review. The original source is unchanged, and the replacement is removed after compilation. This instrumentation forces legal repeated Ze-local IDs across tunnels. The scenario measures session isolation under that collision.

The relay is compiled from its Go package by the same host staging action and copied into its Alpine image. An RFC recorder overlay therefore reaches the relay that runs, including the PPP framing producer. Staging composes the scale overlay with an inherited recorder overlay, refuses conflicting source replacements, and never changes process-global GOFLAGS.

The scale, relay, xl2tpd and kl2tpd builds send only their Dockerfiles, image-specific ignore files, and any declared staged binaries to the builder.

Many sessions in each tunnel

l2tp-many-sessions-kl2tpd runs three kl2tpd v0.1.8 containers using the maintained pppd 2.5.5 image. Each has one tunnel and sixteen configured PPP sessions. Each session has its own username, pppd interface, link name, log and read-only argument-file mount. The containers initially wait under Suite ownership. The checker launches a configured LAC through detached exec only when it is ready to measure that tunnel's control window, then starts the next LAC after the first sixteen sessions have established.

The scale configuration enables CQM explicitly. After the original complete FRR route census and before either existing teardown, a selector check reads two real subscribers with equal local SIDs on different tunnels. Their detail, FSM history, observer events and all eight traffic counters must carry the selected original identity and listener. An unqualified read or clear must report ambiguity. A guard copied from the other admission must be refused. Those refusals must retain every original subscriber identity and native interface, all 48 FRR routes, independent event histories, the original Accounting-Starts and no Accounting-Stop. The existing selected RADIUS disconnect, 47-survivor proof, peer CDN and 46-survivor/accounting tail then run unchanged.

On 2026-11-19 the full scenario passed in Ze's Linux 7.3 arm64 guest. After both selector refusals preserved all 48 subscribers, the exact-ID RADIUS Disconnect left 47 and the independently selected peer CDN left 46. At each stage the checker verified the exact subscriber routes, accounting records and interface-bound traffic.

The pinned kl2tpd release uses cgo for its Linux PPPoX socket bindings. Its builder installs GCC, musl development headers and Linux headers, then enables cgo for this third-party peer. The runtime remains the maintained Alpine LAC image. Ze and the relay retain their own build settings.

The v0.1.8 peer includes one build-time diff for autonomous HELLOs. Upstream sendHelloMessage bypasses the ACK queue, so a genuine ACK cannot complete the send. The stock peer retried an acknowledged HELLO and closed its sessions after three retry attempts in the real guest. The diff sends HELLO through the existing reliable queue.

The five-second HELLO inputs, retry settings and all scale assertions remain required. The builder checks the original and patched source hashes, applies the diff with zero fuzz, and builds from that source. The runtime image retains the diff and pinned module-download identity under /usr/local/share/ze/. Pinned peer source.

The independent control decoder requires the omitted Receive Window Size AVP in each SCCRQ. Three genuine cumulative ACK advances warm the window before the relay holds Nr alone. The assertion requires five distinct response-producing ICRQs behind that hold, four distinct outstanding Ze controls, and one live reliable snapshot with cwnd=4, peer-rws=4, the held peer Nr and a receive Nr past the fifth request. Retransmissions and zero-length ACKs are not new outstanding controls. The relay forwards legal out-of-order Ze controls unchanged and tracks only four sequence positions from the genuine cumulative ACK. An ACK across an uncaptured predecessor still fails.

When a received ACK opens the window and delivers a request, Ze returns queued controls before its fresh response. A regression checks the sequence numbers and session identities of both responses.

A checker marker releases a genuine held cumulative ACK; a deadline release cannot satisfy the assertion. The queued fifth response and subsequent session progress must then appear.

The checker prints the latest full control snapshot once at each completed window or CDN check, and at the baseline and final checks.

Each detached kl2tpd writes its output to a file in its container. On a failed assertion, the checker collects bounded tails of that file and all 48 PPP logs, plus PID-file and process state, before cleanup. All diagnostic reads share one separate 15-second deadline. Read failures and partial output are retained with the original assertion error.

The baseline is exactly 48 established sessions with distinct addresses in the configured pool. Each must complete IPCP, retain its own Ze and LAC PPP interface and kernel route, and pass a ping bound to that interface in both directions. Captured ICRPs correlate all sixteen wire IDs per relay with daemon tuples. The registered FreeRADIUS server's Accounting-Starts join by full Acct-Session-Id, username and Framed-IP-Address. FRR must report each exact subscriber /32 with a positive path count and a nonempty valid path received from Ze; presence of a JSON key or a direct kernel route does not prove redistribution.

Before each FRR route census, the checker requires the current BGP peer to be Established. A failed census retains the actual state line beside the missing-prefix evidence. A complete valid census must also pass the existing BGP check afterward.

Before traffic, the checker validates each client's final pppd PID file, interface name and process name. Each LAC has sixteen PPP interfaces with the same LNS peer address. The fixture gives each subscriber source /32 a dedicated route table and source rule. It prints the unbound kernel route lookup before and after setup, then requires the exact source, peer, interface and table. These rules exist only in the Suite-owned LAC containers and disappear with them. The two interface-bound traffic probes and all Ze route checks remain required.

One exact accounting-ID Disconnect must receive an authenticated ACK and remove only its selected session, leaving 47 unchanged survivors. The checker then validates a different session's pppd PID file and interface before terminating that process. Its peer CDN must name the exact tunnel/session tuple, leaving 46 survivors. Each step requires matching Accounting-Stops, only the selected /32 withdrawals at FRR with BGP still established, and all remaining sessions' original tuples, addresses, interfaces, routes and traffic. Failures name the numbered assertion: 1 infrastructure and launch, 2 window, 3 IPCP/kernel/traffic, 4 wire/accounting/FRR baseline, 5 Disconnect, 6 peer CDN. The known session-identity defect remains an expected dependency failure; an authentication, capture or prerequisite failure is reported as its actual failing assertion and supplies no identity proof.

The plans choose the Ze, xl2tpd, FRR, and RADIUS peers for each established scenario. The dns-resolver-l2tp-subscriber plan adds Knot DNS on 172.29.0.7, and the l2tp-unknown-mandatory-avp-xl2tpd, ppp-code-reject-xl2tpd, lcp-restart-timer-pppd, l2tp-lns-pppd-ipv6cp-rejected-by-lns and l2tp-lns-pppd-noip-rejects-ipcp plans put the relay on 172.29.0.4, the address their xl2tpd dials as its LNS. The l2tp-lns-pppd-ipcp-terminate-redistribute plan is the one that starts both the relay and FRR: the relay keeps 172.29.0.4, and FRR moves to 172.29.0.6, where that scenario's frr.conf and ze.conf place it. The l2tp-lns-* plans also start the independent RADIUS backend on 172.29.0.5 before Ze and the LAC. The positive plan requires a credential request there; the refusal plan requires none. Both disable xl2tpd redial and pppd persistence, so the evidence belongs to one attempt.

Prerequisites

The lab requires Docker and a host kernel with PPPoL2TP support, built in or loaded by the host: a lab container never loads a kernel module. The preflight check probes for /dev/ppp, ip l2tp, and the l2tp_ppp or pppol2tp kernel module from inside a temporary container that holds the peers' grants (NET_ADMIN, --device /dev/ppp) and nothing more. If any requirement is missing, the runner exits non-zero, names what is missing, and prints the host command that loads it:

sudo modprobe -a ppp_generic l2tp_ppp l2tp_netlink

Ze's kernel builds all three in, so ./le test qemu docker-lab needs none.

Docker Desktop on macOS typically cannot pass this check because its Linux VM lacks PPPoL2TP kernel modules. The runner does not skip or downgrade; it fails strictly.

Setting ZE_L2TP_SKIP_KERNEL_PROBE or ze.l2tp.skip-kernel-probe in the environment causes an immediate refusal.

Running

./le test deployment docker-l2tp-ppp
ZE_L2TP_INTEROP_SCENARIO=01-ppp-ipv4 ./le test deployment docker-l2tp-ppp

To exercise working-tree changes, use a named build:

ZE_L2TP_INTEROP_SCENARIO=l2tp-lns-mru-xl2tpd ./le --name session test deployment docker-l2tp-ppp
ZE_L2TP_INTEROP_SCENARIO=l2tp-lns-chap-only-xl2tpd ./le --name session test deployment docker-l2tp-ppp

Environment variables: FRR_IMAGE (default quay.io/frrouting/frr:10.3.1), NO_BUILD, SESSION_TIMEOUT (default 90s), ZE_L2TP_INTEROP_SCENARIO, and ZE_L2TP_INTEROP_SUFFIX (default PID, for parallel-run isolation).

Scenarios

lcp-restart-timer-pppd

The real xl2tpd/pppd peer completes IPCP and successfully pings Ze first. With l2tp lcp restart-timer 500 and max-configure 3, the checker then arms the relay to inject one empty LCP Configure-Request on that live session and drop the LAC's subsequent LCP packets. L2TP control packets continue to flow. This is packet loss after a working session, so a peer that never opens cannot pass.

The checker requires exactly three Configure-Requests from Ze, with gaps and the final timeout following the configured 500 ms interval, and a CDN from Ze ending that same session. Relay timestamps use one process's monotonic clock; Docker log delivery delay does not decide the measured interval. A 350–900 ms window allows scheduling delay while rejecting even a one-second interval. At least one actual pppd Configure reply must be observed and dropped. Finally, the checker stops xl2tpd and requires both peers' kernel L2TP/PPP resources to disappear. It adds no grants or runtime packages to either peer.

The LAC image pins pppd 2.5.5. Its fsm_rconfreq invokes the down callback and starts a new request when it receives a Configure-Request in Opened, then sends the Ack, Nak or Reject that its option checker selects. The lab reads that reply before discarding it; it does not substitute for pppd's negotiation. Pinned peer source.

Run ZE_L2TP_INTEROP_SCENARIO=lcp-restart-timer-pppd ./le --name session test deployment docker-l2tp-ppp. A successful run requires both the answering-peer control and the silent-peer wire assertions.

01-ppp-ipv4

Proves: L2TP tunnel establishment, PPP LCP/IPCP completion, kernel pppN with correct local/peer addresses, dataplane ping from LAC to Ze through the PPP tunnel, route inject/withdraw log presence, and clean L2TP/PPP teardown (both containers return to empty ip l2tp show tunnel and ip link show type ppp).

02-ppp-bgp-redistribute-frr

Proves: FRR establishes BGP with Ze, a PPP-assigned subscriber /32 appears in FRR's BGP table via Ze's redistribute destination bgp { import l2tp } (real RouteObserver and redistribute-orchestrator path), and the route is withdrawn from FRR after LAC session teardown. BGP session stability is verified after withdrawal.

03-ze-lac-xl2tpd-lns

The inverse topology: ze is the L2TP initiator (LAC/dialer) and a real xl2tpd runs as the LNS answerer. This proves ze's initiator half of the tunnel FSM (SCCRQ initiation → SCCRP handling → SCCCN → established) interoperates with an independent RFC 2661 implementation. Both sides confirm it: ze logs tunnel now established (initiator), and xl2tpd logs Connection established ... LNS session is 'default'. ze is triggered to dial by the request l2tp outgoing-call RPC over its token-guarded REST API.

The typed plan starts xl2tpd and Ze in containers on the isolated lab bridge. Ze's L2TP listener binds 0.0.0.0, because Ze dials from its listener socket and a loopback listener cannot reach the LNS on the bridge; TestZeL2TPListenerReachesTheLabBridge refuses a fixture that binds one. The checker triggers Ze through its REST API and requires both peers to report the established tunnel. The PPPoL2TP preflight is skipped when this control-plane-only scenario is selected alone. xl2tpd cannot answer the OCRQ that follows because it has no outgoing-call answerer (it logs Unimplemented message 7), so the RPC returns an error by design and the established control connection is the interop proof. The full OCRQ→OCRP→OCCN call flow is proven functionally by test/l2tp/lns-outgoing-call.ci. The LAC incoming-call PPP data plane is covered by ./le test deployment gokrazy-l2tp-ppp.

04-radius-acct-attrs

Proves the subscriber attributes ze sends to a RADIUS server for a real PPP session: NAS-Port-Id (RFC 2869 Section 5.17) resolved from the operator's nas-port-id-format in the Access-Request and in the accounting records, and Framed-IP-Address (RFC 2865 Section 5.8) in the Accounting-Start carrying the address pppd actually negotiated (RFC 2866 Section 4.1). The assertion reads what the server decoded, not what ze logged.

The Start record also proves the session attributes ze adds to every Accounting-Request: Event-Timestamp within an hour of the lab clock, and Acct-Delay-Time present. It proves two absences as well. Acct-Terminate-Cause is absent, which RFC 2866 Section 5.10 requires of every record that is not a Stop. Calling-Station-Id is absent because xl2tpd's ICRQ carries Message Type, Assigned Call ID, Call Serial Number and Bearer Type alone, so no Calling Number AVP reaches ze, and RFC 2865 Section 5 forbids sending a text attribute of length zero.

The checker then POSTs clear l2tp session all to ze's REST surface on 127.0.0.1:17012 and reads the Stop record that follows. That teardown is the operator one, so the Stop reports Admin Reset, RFC 2866 Section 5.10 value 6.

The typed plan starts the Go RADIUS peer on 172.29.0.5 before Ze and xl2tpd. The peer answers Access-Request and Accounting-Request packets and writes the decoded attributes that the checker compares. Its Access-Accept carries a Message-Authenticator (RFC 2869 Section 5.14), because ze discards an unsigned answer to an Access-Request unless the server's require-message-authenticator is false (BlastRADIUS, CVE-2024-3596). This scenario uses the same PPPoL2TP preflight as 01 and 02.

dns-resolver-l2tp-subscriber

Proves that a subscriber learns Ze's LAN DNS resolver through IPCP and resolves through it. The pool's dns-primary and dns-secondary are the pool gateway 10.100.0.1, where service dns-resolver listens with allow-from 10.100.0.0/24 and forwards to Knot DNS on 172.29.0.7, the only server that holds the lab zone lab.example. (the BGP lab's test/interop/Dockerfile.knot). pppd runs with usepeerdns, so it asks for both RFC 1877 options and writes what Ze gave it to /etc/ppp/resolv.conf.

The checker waits for PPP session up, requires every nameserver line of that file to be 10.100.0.1, requires the LAC's route to 10.100.0.1 to leave through its ppp interface, and requires busybox nslookup -type=a www.lab.example 10.100.0.1 to answer from that server with exactly 192.0.2.10 and 192.0.2.11. The gateway exists only while a session is up. The resolver sets IP_FREEBIND on its listener sockets, so the listener binds at start, before the first session, and Ze's container needs no sysctl.

auth-method chap-md5 in this scenario's ze.conf is load-bearing, unlike the same leaf in test/l2tp/radius-acct-wire.ci. xl2tpd sends no RFC 2661 Section 4.4.5 proxy LCP AVPs, so ze negotiates LCP itself and the leaf picks the method. Read in xl2tpd v1.3.18 and v1.3.19: avpsend.c has no builder for AVP 26, 27 or 28, and the ICRQ and ICCN branches of control.c carry none. The authentication has to reach a credential, because RFC 2865 Section 4.1 admits no Access-Request without one.

ppp-code-reject-xl2tpd

Proves Ze's PPP Code-Reject against a real xl2tpd and pppd session (RFC 1661 Section 5.6). pppd requests an MRU of 128. Once a ping has crossed the session, the relay sends Ze, as the LAC, two LCP packets with the unknown Code 99 and two IPCP packets with Code 12, all with Identifier 0x42 and 204 octets long. The checker reads Ze's answers off the wire. The two LCP and the two IPCP Code-Rejects carry different Identifiers within each protocol, each fits the 128-octet MRU with a copy of the start of the probe it rejects, and the session stays up. The IPCP answers come from the PPP unit descriptor, where Linux queues IPCP once the channel is connected. Last, the relay sends one IPCP Terminate-Request and Ze must answer with a Terminate-Ack carrying its Identifier. Ze's IPv4 address must leave its pppN, polled inside the one Restart time Ze holds IPCP in Stopping. pppd never asked to terminate, so it renegotiates IPCP on that Terminate-Ack (pppd 2.5.5 fsm_rtermack, case OPENED:): IPCP must open again on both ends, the address return to the same pppN, and a ping cross the session. The full account is in docs/architecture/testing/interop.md, "L2TP and PPPoE lifecycle fault scenarios".

The same scenario checks RFC 1661 Section 6.6 on the real L2TP wire. The relay captures every normal PPP datagram from startup, including IP, with consecutive data_ordinal values starting at one. The checker rejects a missing prefix or gap and requires ff 03 on every Ze-to-LAC frame it reads, with startup Configure, Code-Reject, Echo-Reply and IP witnesses. Assertion 7 owns this framing proof, including a framing failure encountered inside an earlier polling assertion. This is L2TP evidence. It does not exercise PPPoE or turn the lower-layer RFC rows into whole-row proof.

Each normal capture row also carries code_reject_armed, sampled after the relay forwards the packet at the original Code-Reject marker gate. The original stability check excludes only explicitly unarmed startup traffic. It retains the armed triggering packet and every later control packet, including those before the first injection, and refuses missing or retreating phase metadata. An LCP or IPCP packet with Code 1 through 6 in that interval still fails assertion 5.

With pppd's noaccomp and both acknowledged Configure exchanges showing no ACFC option, assertion 8 arms one separately labeled compressed LCP Echo-Request. It uses the peer's actual acknowledged Magic-Number, Identifier 0x6f and Data ff03-receive. The checker requires a following uncompressed Echo-Reply with the same Identifier and Data and Ze's acknowledged Magic-Number. It then verifies the same PPP interfaces and useful traffic. The strict parser for ordinary captured frames remains unchanged. Only that exact, explicitly labeled injected request can omit ff 03.

Linux 7.3 pppol2tp_xmit prepends ff 03. The receive path pppol2tp_recv removes those octets when present. Otherwise it passes the Protocol bytes to PPP.

Section 6.6 permits silent discard of an unnegotiated compressed frame. This experiment requires the accepting Linux/Ze path and its useful response rather than a mandatory discard. No receive rejection is inferred from the transmit rule. Pinned Linux source.

NCP lifetime on the IPv4-only pool

Three scenarios run Ze's IPv4-only pool against pppd 2.5.5 through the relay, so Ze's own IPv6CP never starts. Each reads the relay's complete capture, whose normal data rows carry consecutive data_ordinal values from one; the reader refuses a gap, so an absence assertion never reads a truncated log. The relay's IPCP Terminate-Request marker (/run/ipcp-terminate) and CCP Configure-Request marker (/run/ccp-configure-request) each inject once on the next LAC datagram, with or without the Code-Reject marker. Each scenario's README.md lists its numbered assertions and the pppd functions they rest on.

l2tp-lns-pppd-ipv6cp-rejected-by-lns runs stock pppd, which offers IPv6CP. Ze Protocol-Rejects it, pppd sends no IPv6CP after (ipv6cp_protrej, fsm_lowerdown), and IPv4 carries a ping past ncp timeout 8. The relay then injects one CCP Configure-Request (0x80fd, Code 1, Identifier 0x3c), and Ze answers with an LCP Protocol-Reject naming 0x80fd that carries it. It is goal evidence and owes no revert walk.

l2tp-lns-pppd-noip-rejects-ipcp runs pppd noip, which Protocol-Rejects Ze's IPCP. Ze sends no IPCP after the reject, logs no PPP session up, and ends the call with a CDN at the no-NCP bound (ncp timeout 8, logged as ncp: timeout after 8s with no NCP opened). Its lcp restart-timer 2000 keeps several Restart times inside the bound, so the revert of the Protocol-Reject dispatch shows Ze's IPCP retransmissions after the reject.

l2tp-lns-pppd-ipcp-terminate-redistribute runs pppd noipv6 with FRR on 172.29.0.6. After the injected IPCP Terminate-Request, Ze's address leaves pppN and FRR loses 10.100.0.2/32 within the 10 s Restart time Ze holds IPCP in Stopping, then pppd renegotiates, and the address, the /32 and traffic return. Past ncp timeout 20 from the trigger no CDN follows. The revert of the release event leaves the /32 in FRR.

Run each with ZE_L2TP_INTEROP_SCENARIO=<name> ./le --name session test deployment docker-l2tp-ppp.

l2tp-lns-mru-xl2tpd

Ze is the LNS with mru 1492, auth-method chap-md5, and authentication { allow [ chap-md5 ]; }. The checker requires pppd's decoded trace to show Ze's LCP Configure-Request containing both MRU 1492 and CHAP-MD5, and pppd's Configure-Ack with the same Identifier and options. The client explicitly requests MRU 1493. The trace must show Ze's Nak to 1492 with that request's Identifier, pppd's retry at 1492, and Ze's Ack with the retry's Identifier. Only after both LCP directions converge does the checker accept CHAP Challenge, Response, and Success in order. It requires no PAP protocol packets, a measured client pppN MTU of 1492, an independent RADIUS Access-Request, and a ping across the live PPP session.

The client does not set an MTU cap. In pppd 2.5.5, lcp_addci omits the MRU option at the default 1500, but emits an explicit 1493. lcp_nakci accepts Ze's suggestion of 1492. This input makes the promised Nak observable. The client's receive MRU and Ze's receive MRU remain distinct facts. In particular, show l2tp session id <id> reports the peer receive MRU, which is separate from the local transmit cap and configured local receive request. The checker reaches the running daemon through the token-guarded REST command dispatcher and requires:

  • show l2tp config: mru 1492 and authentication-allow [chap-md5].
  • show l2tp sessions: exactly one live session with a nonzero ID.
  • show l2tp session id <id>: the same session, username alice, assigned address 10.100.0.2, actual negotiated mru 1492 and auth-method chap-md5. Missing or unknown negotiation state fails the assertion.

The wire request is load-bearing: the client's own MRU can limit its MTU even if Ze ignores the new leaf, so an MTU-only assertion would be vacuous. The checker retains the decoded negotiation, measured link JSON and daemon answers in the job log, then stops the LAC and requires both peers' kernel PPP links and L2TP tunnels to disappear.

l2tp-lns-omitted-mru-xl2tpd

Ze again has a 1492 session cap, while pppd uses its default receive MRU and omits the MRU option. The checker requires actual peer Configure-Request records without MRU, a matching Configure-Ack, Ze's separate 1492/CHAP request and its Ack, and a successful CHAP exchange. A configured option or a diagnostic line alone cannot prove omission on the wire.

The checker reads Ze's own pppN interface and requires MTU 1492. A client-only measurement cannot establish Ze's transmit limit. The daemon's effective config remains 1492, while the actual session's peer receive MRU is 1500. The scenario also requires an independent RADIUS credential request and useful traffic across the PPP session before complete kernel teardown. These measurements distinguish peer negotiation from local send policy.

l2tp-lns-chap-only-xl2tpd

Ze is the LNS with auth-method chap-md5 and no explicit allow-list, exercising the derived CHAP-only default. pppd refuses CHAP-MD5, MS-CHAP, MS-CHAPv2 and EAP but allows PAP. The checker requires one pppd connection attempt and the following decoded packets in order:

  1. Ze's CHAP-MD5 Configure-Request.
  2. pppd's Configure-Nak suggesting PAP, with that request's Identifier.
  3. Ze's Terminate-Request.
  4. pppd's Terminate-Ack with that termination's Identifier.

Before Terminate-Request, the peer must not acknowledge a Ze LCP request: in pppd's trace this is a sent [LCP ConfAck ...] with an Identifier from a received Ze Configure-Request in the same connection attempt. Such an Ack can let LCP reach Opened before a later refusal. Ze's independent Ack of the peer's request is permitted: that alone leaves Ze in Ack-Sent. Diagnostic mentions, pre-connection packets and unmatched Identifiers do not establish that the peer acknowledged Ze's request.

Ze must never offer PAP after the Nak. No PAP protocol packet, CHAP credential exchange, IPCP packet or assigned address may appear. The checker then waits for pppd to exit without stopping the LAC, requires the daemon's session list to become empty, and requires no PPP session up event and no request of any kind at the independent RADIUS backend. Only after these refusal assertions does it stop xl2tpd to remove the idle control tunnel and require both peers' kernel PPP/L2TP state to be empty. An absent session alone cannot pass this scenario.

The complete pppd trace is written to /run/lns-policy-pppd.log in the isolated LAC container and copied to the native job log before teardown. pppd's process exit is measured separately: its Exit. message goes to syslog, not that trace file.

l2tp-lns-negotiated-mru-xl2tpd

This separate scenario keeps Ze's configured MRU at 1492 while pppd requests 1400. The checker requires both directional requests and matching Acks in pppd's decoded trace, followed by CHAP success, an independent RADIUS credential request, and traffic through the session. It measures Ze's own pppN transmit MTU as 1400.

The daemon's effective configuration must still report 1492. Both show l2tp sessions and the selected show l2tp session id <id> must report the negotiated peer receive MRU of 1400 and chap-md5. Returning the configured 1492 in either session view fails this proof, even when traffic succeeds. The different values make a configuration copy distinguishable from actual negotiation. The existing snapshot and command tests retain the null-before-Opened/null-after-down behavior and distinct negotiated none.

The MRU Nak and omitted-option scenarios remain separate attempts. Their inputs do not replace this smaller-peer case. New checker tests include positive negotiation plus wrong aggregate output, wrong detail output, and an interface MTU copied from configuration. No live result is claimed by the scenario definition alone.

Peer-source basis for the policy scenarios

The LAC image pins pppd 2.5.5 from the official GitHub tag archive and xl2tpd 1.3.20 from its release archive, each with a SHA256 checksum. The ppp archive contains autotools inputs, not configure. Upstream autogen.sh generates the build system and runs configure with the image's existing installation paths. Build-only autotools dependencies do not enter the runtime image. The subscriber RADIUS LAC uses the same release pins, tag archive and autotools build procedure. Both images derive their runtime library dependencies with scanelf; each keeps its suite-specific runtime tools.

The upstream latest-release URL resolved to pppd 2.5.5 on 2026-11-05. TestLACPeerReleasePinsAgree compares both images' pppd and xl2tpd release/hash declarations and rejects a missing or malformed hash. This check catches paired-image drift; image builds and subscriber scenarios still prove that the selected release operates correctly.

After both native suites build their LAC images, the integration-tagged TestLACPeerRuntimeVersions probes those images through the lab's owned one-shot container lifecycle. It checks pppd --version, including stderr, against each image's own Dockerfile pin and requires the PPPoL2TP plugin at /usr/lib/pppd/<version>/pppol2tp.so. Missing Docker access, images or plugin files fail the test. The real subscriber scenarios prove plugin loading and PPP service separately.

Historical native runs against pppd 2.5.5 passed both L2TP policy scenarios on 2026-11-04. Each scenario failed under its rebuilt producer break and passed again after restoration: ignored MRU configuration for the MRU scenario, and the old broad authentication default for CHAP-only refusal. Those runs preceded the subscriber RADIUS image alignment and are not proof of that image's build or behavior.

In pppd 2.5.5's lcp_reqci, a refused CHAP request is Nak'd toward PAP when EAP is also refused. lcp_printpkt prints the MRU and authentication options the checkers read; lcp_up sets the client MTU from the peer's receive MRU, bounded by the client's own settings. Its fsm_rtermreq acknowledges Terminate-Request in Req-Sent/Ack-Sent but keeps negotiating. The refusal checker therefore waits for Ze's lower-layer teardown, not an assumed immediate exit on Terminate-Request. start_pppd creates the PPPoL2TP socket and launches the pinned pppd plugin with it. These scenarios do not substitute a synthetic PPP peer.

l2tp-proxy-mru-transmit-cap

This scenario runs the existing compiled l2tp/proxy-mru-transmit-cap fixture inside Ze's container. The fixture shares that container's PPP namespace, NET_ADMIN grant and /dev/ppp device. Its native LAC sends the real ICCN proxy AVPs with Last-Sent MRU 1492 and Last-Received MRU 1500, 9000, or no MRU option. Each attempt completes local CHAP and IPCP, reads the kernel interface MTU as 1492, and receives a full-size IPv4 ICMP Echo-Reply through the PPPoL2TP data path. StopCCN must remove the PPP link before the next attempt. This is a native kernel functional proof carried by the interop suite; it does not substitute a synthetic peer for the separate xl2tpd interoperability scenarios.

The shared StageBinaries preflight builds a separate static Linux le personality from the current checkout, with the same feature gates as the daemon, and starts it once with help before any image build, so an le that cannot start stops the run there (docs/architecture/testing/interop.md, "The start probe"). The existing Ze image copies it to /usr/local/bin/le; its name selects the registered fixture commands. The image carries no compiler, and its daemon remains the normal ze_core build. The checker rejects a missing helper, nonzero exit, usage output, or absent MTU, ICMP, CHAP, IPCP or cleanup evidence.

Select it with ZE_L2TP_INTEROP_SCENARIO=l2tp-proxy-mru-transmit-cap when running ./le --name session test deployment docker-l2tp-ppp. The suite retains its normal Docker-host Ze-kernel prerequisite, image staging, peer readiness and cleanup.

l2tp-radius-acct-wire-fixture

This regression scenario runs the original registered fixtures from test/l2tp/radius-acct-wire.ci inside the same Ze container and kernel namespace. The existing shared proxy-handshake extraction also serves that accounting peer, so its original CHAP, IPCP and decoded RADIUS assertions remain part of the required proof. Its Last-Sent and Last-Received MRUs stay 1500; the separate scenario retains the default local cap and the original NAS identifier, template, 60-second accounting interval, pool and link monitoring settings.

The checker uses the existing detached-exec operation because a complete Interim-Update cannot arrive within the ordinary 30-second exec deadline. It starts both original fixtures in a private shared directory, waits for the mock's socket readiness, and polls the worker's published exit status. The worker stops its mock before publishing that status. The checker requires both fixtures' output, Access-Request, Start, Interim-Update and Lost-Carrier Stop evidence, then observes removal of the kernel PPP link. It preserves the original functional carrier's 240-second bound.

Select it with ZE_L2TP_INTEROP_SCENARIO=l2tp-radius-acct-wire-fixture when running ./le --name session test deployment docker-l2tp-ppp. It reuses the proxy-cap scenario's staged helper and the suite's Ze image, readiness, kernel prerequisite and cleanup.

Relationship to Other Evidence

Action What it proves PPPoL2TP required
./le test deployment l2tp Control tunnel and incoming-call session ✕
./le test deployment l2tp-ppp Native Linux full PPP/NCP/kernel proof in peer-isolated netns ✓
./le test deployment docker-l2tp-ppp Peer-isolated Docker lab (this) ✓
./le test deployment gokrazy-l2tp-ppp QEMU gokrazy appliance LNS with a netns LAC ✓
test/plugin/redistribute-l2tp-*.ci Synthetic BGP UPDATE rendering ✕

The native proof and Docker lab catch different failure shapes. The native proof isolates Ze and the LAC in Linux network namespaces joined by a veth underlay; the Docker lab isolates them across a Docker bridge and adds the FRR BGP redistribution scenario.

The gokrazy appliance proof reuses the native LAC shape but puts Ze behind the same gokrazy/QEMU image used for appliance deployment. The appliance attaches to a host bridge by TAP (user-mode slirp cannot deliver the LAC's inbound UDP 1701), so the LAC namespace still exercises a real host PPPoL2TP kernel path while the appliance kernel provides Ze's LNS-side PPPoL2TP support. The image build resolves ze's runtime kernel, the only kernel an appliance image carries. Before it starts, the proof checks the runtime kernel cache entry for its architecture and refuses, before boot, an entry that is absent or cannot carry PPPoL2TP, naming the command that rebuilds it.

Design Pattern

The lab follows the repository's native interop pattern: checked-in scenario configuration, a per-run Docker network with a unique suffix, fixed peer addresses, typed lifecycle plans, and typed assertions. L2TP keeps its own package because its peer roles, image mounts, RADIUS server, and PPP checks are specific to this protocol.