Architectural Invariant Design: Cilium eBPF Host-Routing MTU Clamping and WireGuard Overlay Guardrail
Cilium eBPF Host-Routing MTU Clamping and WireGuard Overlay Guardrail defines an industrial-grade behavioral standard for devops engineering. Enforces deterministic MTU calculation and kernel-level MSS path discovery when Cilium native eBPF host-routing is coupled with WireGuard transparent encryption. Bypassing Linux netfilter through eBPF host-routing invalidates traditional iptables TCPMSS clamping, causing silent TCP blackholing when packets with the Don't Fragment (DF) bit exceed the effective overlay payload size. This guardrail mandates explicit MTU deduction for WireGuard headers, ensures ICMP 'Packet Too Big' generation, and eliminates asymmetric routing loops across inter-cluster and cross-subnet topologies. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.
Hazard Analysis: What Breaks Without This Rule
The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:
| Failure Mode | AI Symptom (The Anti-Pattern) | Severity | Production Impact & Remedy |
|---|---|---|---|
| AI Hallucination & Deprecation Drift | Unclamped 1500 MTU with Native eBPF Host Routing and WireGuard Encryption Inducing Silent TCP Blackholes | Critical | Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production. Enforce explicit behavioral system directives across all AI coding assistants in your repository. |
| Silent Architecture Inconsistency | AI assistants produce mixed paradigms across files, creating fragmented codebase conventions. | Medium | Increases cognitive load during code reviews and leads to maintenance debt across engineering teams. Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails. |
Step-by-Step Production Directives
Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:
Engineers MUST ALWAYS explicitly deduct WireGuard encapsulation overhead (minimum 60 bytes for IPv4, 80 bytes for IPv6) from the underlying network interface MTU when configuring Cilium's 'mtu' parameter.
Engineers MUST ALWAYS explicitly deduct WireGuard encapsulation overhead (minimum 60 bytes for IPv4, 80 bytes for IPv6) from the underlying network interface MTU when configuring Cilium's 'mtu' parameter.
Engineers MUST NOT rely on Cilium's automatic MTU discovery when nodes traverse heterogeneous network paths, hybrid cloud VPNs, or underlays with nested encapsulations (e.g., Geneve, VXLAN, AWS VPC 9001 MTU peering with 1500 MTU transit gateways).
Engineers MUST NOT rely on Cilium's automatic MTU discovery when nodes traverse heterogeneous network paths, hybrid cloud VPNs, or underlays with nested encapsulations (e.g., Geneve, VXLAN, AWS VPC 9001 MTU peering with 1500 MTU transit gateways).
Configurations MUST explicitly evaluate 'bpf.hostRouting'
Configurations MUST explicitly evaluate 'bpf.hostRouting': if the kernel is < 5.10 or if dynamic Path MTU Discovery (PMTUD) ICMP Type 3 Code 4 packets fail to reach ingress endpoints due to asymmetric egress bypass, 'bpf.hostRouting' MUST be set to 'false' to route through standard Linux stack TC/netfilter, or eBPF MSS clamping MUST be explicitly bound to the native interface.
Engineers MUST NEVER enable transparent encryption ('encryption.enabled
Engineers MUST NEVER enable transparent encryption ('encryption.enabled: true', 'encryption.type: wireguard') alongside native host-routing ('bpf.hostRouting: true') without configuring explicit device targeting via 'devices' matching regex or network interface names.
Code SHOULD enforce automated CI pre-flight validation on all Helm values to verify that 'tunnel
Code SHOULD enforce automated CI pre-flight validation on all Helm values to verify that 'tunnel: disabled' (direct routing) matches the node subnet topology and does not produce asymmetric return paths when traffic exits via host endpoints.
Frequently Asked Technical Questions
Common questions developers face when configuring AI coding assistants for this stack:
Q:Why is Cilium eBPF Host-Routing MTU Clamping and WireGuard Overlay Guardrail critical for AI coding assistants?
Enforces deterministic MTU calculation and kernel-level MSS path discovery when Cilium native eBPF host-routing is coupled with WireGuard transparent encryption. Bypassing Linux netfilter through eBPF host-routing invalidates traditional iptables TCPMSS clamping, causing silent TCP blackholing when packets with the Don't Fragment (DF) bit exceed the effective overlay payload size. This guardrail mandates explicit MTU deduction for WireGuard headers, ensures ICMP 'Packet Too Big' generation, and eliminates asymmetric routing loops across inter-cluster and cross-subnet topologies. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.
Q:How does adopting this rule prevent AI hallucinations?
This rule explicitly declares what the AI must avoid (Unclamped 1500 MTU with Native eBPF Host Routing and WireGuard Encryption Inducing Silent TCP Blackholes) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.
Q:Which AI coding environments are supported?
This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).
Q:Can I combine this rule with other technology stacks?
Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.