Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

iptables

Direct answer

iptables is the legacy Netfilter userspace rule model for filter, NAT and related tables/chains; modern systems may implement its interface through an nftables compatibility backend, making backend and live-rule ownership critical.

When to use this

Use it when configuring, checking or troubleshooting iptables in Linux Security.

First 30 seconds

1. iptables is the legacy firewall interface (often iptables-nft backend now).

2. Default policies and rule order.

3. Persist with iptables-persistent/netfilter-persistent.

4. Don't mix with nft rules carelessly.

5. Migrate to nftables.

Operational verification

packet → chain rules → target

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common traps

An iptables rule/counter shows the selected frontend exposed or matched live Netfilter state, but it does not show backend ownership, persistence or end-to-end delivery.

Suspicious evidence: legacy/nft frontend mixed, duplicate rulesets, wrong namespace, default policy, persistence absent, firewalld/UFW overwrite, IPv6 separate or NAT/filter tuple confusion.

Platform / version applicability
Platform and workload security
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformPlatform and workload security
Scope / prerequisiteUse it when configuring, checking or troubleshooting iptables in Linux Security.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

packet/namespace → Netfilter hook/table → built-in/user chains → ordered matches/targets → conntrack/NAT/verdict → endpoint → persistence reload

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • iptables command output ≠ legacy kernel backend necessarily in use.
  • Rule saved ≠ rule loaded after boot or manager reload.
  • Configuration file present ≠ parsed, loaded and effective runtime state.
  • One allow/deny result ≠ complete DAC, privilege, LSM, firewall and application outcome.
Key checks
  • iptables -L -n -v --line-numbers — filter rules
  • iptables -t nat -L -n -v — NAT rules
  • iptables-save > rules.v4 — save
ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

An iptables rule/counter shows the selected frontend exposed or matched live Netfilter state, but it does not show backend ownership, persistence or end-to-end delivery.

In depth

iptables is the classic Linux packet filtering tool. On modern distributions the iptables command usually runs as iptables-nft, translating rules into nftables, but the syntax and many scripts remain in use.

iptables -P INPUT DROP
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -s 10.0.10.0/24 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
iptables -L -n -v --line-numbers
iptables-save > /etc/iptables/rules.v4

Remember IPv6 needs separate ip6tables rules — a common gap. For new systems, prefer nftables or firewalld; avoid mixing management tools on the same host.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Commands

iptables -L -n -v --line-numbers
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -s 10.99.0.0/24 -j ACCEPT
iptables -P INPUT DROP
iptables-save > /etc/iptables/rules.v4

Documented example, not captured output. Remember ip6tables for IPv6. On modern distributions iptables is often iptables-nft (translated to nftables); do not mix legacy and nft backends.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docPlatform and workload security current

Authoritative/upstream documentation reviewed for bounded claims in Linux Security → iptables. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/security/ · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
Linux iptables firewalllegacy Netfilter rulesiptables security
Embedded reference data

Quick lookup tables

Linux Security → iptables proof map

Fast scope, effective-state, runtime-evidence and closure boundaries for Linux Security → iptables.

BoundaryEstablishDoes not establish
ScopeExact host, role, build/kernel, identity, workload and expected controlDoes not prove policy receipt or effective runtime state
Effective stateResultant/loaded policy, precedence, mode, labels/rules/keys and active services/kernel controlsConfiguration presence does not prove enforcement
Runtime evidenceCorrelated events/audit, process/token/credential, packet/syscall and workload resultOne event, clean status or allow/deny does not prove complete security
ClosureOriginal allowed/denied workload works, unsafe state is removed and recovery/regression passCommit, restart, block or compliance result alone is not closure
Confirmation

Confirm action

Continue?