einat

Full Cone NAT for Linux, implemented in eBPF on TC hooks

Image 1 of 1: Diagram of einat on a router: eBPF TC hooks on the WAN interface with binding and CT records

Endpoint-Independent NAT on TC egress and ingress hooks, for TCP, UDP and ICMP, with IPv6 NAPT as an option. A Rust frontend reconfigures on address changes and sets up hairpin routing, on Linux routers and OpenWrt.

Trade-offs

  • A NAT engine written from scratch on TC hooks, not built on Netfilter conntrack as the out-of-tree kernel modules are. That avoids its Address and Port-Dependent behavior.
  • Aya as the default loader, since it needs no native dependencies on the target beyond libc. A libbpf loader stays available as an option.
  • NAT66 behind a feature flag, because enabling it raises the load time of the eBPF programs to about 4 times.

Q&A2

Compliant except REQ-14, receiving out-of-order fragments. Each requirement is tracked, including the recommendations it does not follow.

Reviews

Loading reviews

    More in eBPF

    See all 8 →
    • XDPerfXDP traffic generator with WASM packet plugins
    • BeeperApplication-layer parser for eBPF programs
    • rocketplaneIOSelf-hosted Kubernetes observability with transaction-gated agent actions
    • GhostScopeSource-aware eBPF tracer for live userspace processes
    • kernwatchTerminal dashboard for Linux kernel observability
    • ProcInShWeb-based Linux process inspector with a 3D process space

    More in Networking

    See all 23 →
    • blitcpFile copier that reads in disk order, dedupes and streams over raw SSH
    • SnitchPer-app network monitor and outbound firewall for the desktop
    • ConduitSSH, Mosh and SFTP client for phones with no account and no cloud sync
    • rustbgpdAn API-first BGP daemon in Rust for route servers and route reflectors
    • ADNSAndroid Private DNS controller with a native NextDNS dashboard and no VPN
    • Reticulum Mobile AppOff-grid encrypted messaging over LoRa or TCP on the Reticulum mesh, for phones

    More in Linux

    See all 42 →
    • OmarollPhoto and video viewer and library for Omarchy that follows the desktop theme
    • FrescoLive video and GIF wallpapers for X11 and Wayland, decoded on the GPU
    • LordOSDebian-based Linux distribution with its own desktop stack
    • OmafilesKeyboard-first multi-panel file manager for Omarchy on Qt6
    • TesseraDebian and Flathub apps on Android, each in its own window on the phone's GPU
    • OmarchistNative settings app for Omarchy: themes, Hyprland config, keybinds and flows