XTABLES-LEGACY(8)

๐Ÿ“ฆ
version 1.8.11 ยท 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ 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 with iptables -A or iptables -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 --wait option 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