XTABLES-LEGACY(8)
โจ XTABLES-LEGACY(8) โจ
Okay bestie, the manual name is xtables-legacy, and it's giving "iptables but make it old-school" ๐
It's iptables using the old getsockopt/setsockopt-based kernel API ๐ฆ
๐ธ NAME ๐ธ
xtables-legacy โ iptables using old getsockopt/setsockopt-based kernel API ๐
๐ DESCRIPTION ๐
okay so, xtables-legacy are the original versions of iptables, and they talk to the kernel through the old getsockopt/setsockopt interface โจ That interface has some limitations, which is why iptables can also be used with the newer nf_tables based API. For the xtables-nft variants of iptables, check out xtables-nft(8) ๐ง
๐ฆ USAGE ๐ฆ
so the xtables-legacy-multi binary can be linked to the traditional names, like this:
/sbin/iptables -> /sbin/iptables-legacy-multi
/sbin/ip6tables -> /sbin/ip6tables-legacy-multi
/sbin/iptables-save -> /sbin/ip6tables-legacy-multi
/sbin/iptables-restore -> /sbin/ip6tables-legacy-multi
The iptables version string tells you which API you're on, legacy (get/setsockopt) or the new nf_tables one ๐ Check it with:
iptables -V
iptables v1.7 (legacy)
๐จ LIMITATIONS ๐จ
โ ๏ธ bestie, this part is important: when you insert a rule withiptables -Aoriptables -I, iptables first has to grab the current active ruleset, tweak it to include your new rule, and then commit the result back. So if two instances of iptables are running at the same time, one of the updates might get lost ๐ญ The--waitoption can help with this, but only partially ๐
also, there's no built-in way to watch for changes to the ruleset ๐ Your only real option is periodically running iptables-legacy-save and checking for differences in the output. xtables-monitor(8) needs the xtables-nft(8) versions to work, so it can't show changes made with the iptables-legacy tools. Not it, not that ๐
๐ SEE ALSO ๐
xtables-nft(8), xtables-translate(8) ๐ซถ
๐ AUTHORS ๐
Rusty Russell originally wrote iptables, in early consultation with Michael Neuling. Iconic origin story, no cap ๐ฅ
๐ Source: System Manager's Manual ยท xtables-legacy(8) ยท dated June 2018, periodt โจ
๐ฆ where this page comes from
- debian trixie: iptables 1.8.11-2 ยท GPL-2.0-only
- ubuntu questing: iptables 1.8.11-2ubuntu2 ยท GPL-2.0-only
- ubuntu resolute: iptables 1.8.11-2ubuntu3 ยท GPL-2.0-only
- ubuntu stonking: iptables 1.8.11-2ubuntu3 ยท GPL-2.0-only
- Copyright 2016-2017, Arturo Borrero Gonzalez <arturo@netfilter.org>
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms