moat and the tools you filter with today.

iptables and nftables filter inside the network stack, where they can track connections. moat filters earlier, at XDP, where dropping a packet costs the least, and gives you a language, tests and tools that hand-written XDP programs leave to you.

TopicmoatiptablesnftablesXDP in C
Where packets are filteredAt XDP: in the driver, before the network stack, on NICs with native XDPNetfilter hooks, inside the network stackNetfilter hooks, inside the network stackAt XDP, the same hook
Connection stateNone: every packet is judged on its ownYes, with conntrackYes, with ctOnly what you build in maps
How rules are writtenA small rule language in a .moat fileOne command line per ruleThe nft languageC, against the kernel helpers
ToolchainOne binary, no compilerThe iptables toolsThe nft toolclang, LLVM and a loader such as libbpf
Test before it touches trafficCase files run in the kernel or in a model, and moat explain shows whyA syntax check (iptables-restore --test)A syntax check (nft -c)Your own harness around BPF_PROG_TEST_RUN
Rate limits per sourcelimit ... per ip.src or per networkhashlimitMeters and sets with limitMaps and timing code you write
Ban lists that fill themselvesadd ip.src to a set with a ttlipset with timeouts, or recentDynamic sets with timeoutsMaps you write and expire
Change rules without a gapreload swaps the program at once and keeps setsiptables-restore replaces a table at oncenft -f applies a ruleset as one transactionUp to your loader
NAT, forwarding, loggingNo: moat only passes or dropsYesYesRedirect or bounce packets, by hand
Existing rulesmoat import iptables and nftablesNot applicableiptables-translate from iptablesRewrite by hand

Use moat in front

To drop floods, bogus sources and known bad traffic before the stack spends anything on them, with rules you can read and test.

Keep a stateful firewall behind it

iptables or nftables still own what needs state: established connections, NAT, forwarding and logging. moat cuts the volume they have to look at.

Write XDP in C when you must

When a program has to rewrite, bounce or redirect packets, or keep its own state, C is the tool. For pass or drop, moat writes and tests the program for you.