Practical tools for system, network, security, and operations administrators.

NET-C0209 · Network Security & VPN

iptables vs nftables

Choose iptables or nftables for one host you administer, and delete any permit-any the translator invented.

Updated 25 October 2026 · Comparison

This is an original planning guide. It is not a vendor manual, an official standard, or legal advice. Example addresses use documentation ranges. Review every command before you paste it.

What this hour is for

nftables is the newer packet filter on Linux. iptables is the older one, still present on many hosts. The translator and the generators draft rules. They do not install them. A pf draft is a different family. Do not paste it onto Linux.

Read the draft. A rule that accepts any source to any destination is a line you delete. Management of the host stays limited to a prefix you are on, and you keep a second session before you imagine applying anything.

One host, one table. A blocklist of addresses you did not review does not get installed. You do not use the draft against a host you do not administer.

The change window is later. This hour is the reading.

The change you can finish

Apply nothing during the writing of the note. When the lab window opens, it is one change on the device named in the ticket. Read the draft, then the device, then decide.

Rollback is the file or the revision you saved first. You do not invent a rollback after the only copy is gone.

  1. Name one host you administer.
  2. Choose iptables or nftables.
  3. Draft and read.
  4. Delete any any-source accept.
  5. Keep a second session in the later window.
  6. Do not install during the reading.

Mistakes that outlive the command

iptables vs nftables goes wrong in a small set of ways. The list is here so the ticket can forbid them before the window.

Decisions to write down

One decision for iptables vs nftables: The host is yours. One family is chosen. Permit-any is gone. Nothing was installed. And the later window has a second session.

Checks before you call it done

Confirm this before you call the change done: The host is named. The family is written. The draft was edited. No wide accept remains. And the live filter is unchanged. If one of those fails, stop.

FilterWhat you are looking atDelete
iptablesThe chains you already runAn accept of any to any
nftablesThe tables that replace those chainsThe same wide accept
pfA different operating systemDo not paste it here

Before you leave the device

iptables vs nftables ends when the hostname on the device matches the hostname in the ticket. If it does not, you are on the wrong box. Stop. A command that succeeded on the wrong box is not progress.

The draft stays a draft until a person has read the names in it. A generator does not log into the device and does not know which interface is the uplink. You delete a line that names a device, a zone, or a prefix you did not write down.

0.0.0.0/0 is not kept because a sample included it. A source you can say is the source you keep. 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, and 2001:db8::/32 are documentation. They belong in the note. They are not prefixes you type onto a production device because they appeared in a draft.

prompt-for-this is a reminder that a secret is missing. It is not a password, a key, a community string, or a pre-shared key you save in the ticket or in git. The real secret stays in the store.

One change is the window. A VLAN and a routing protocol and a VPN do not share it. If two things move and the result is wrong, you will not know which one did it. The next feature waits for its own page.

If the same step fails twice, stop for the day. The failure is the result. Adding a forum command beside a half-applied config produces a device nobody can rebuild. Restore the copy you took first.

A second person reads the device name and the change aloud. If they cannot find them in the ticket, the note is not done. Silence is not agreement. Then leave the device alone.

This page is a planning guide. It is not a vendor manual, not an official standard, and not a permission to touch a network you do not administer. The pillar guide owns the wider design. This page owns one lab proof.

Tools for this guide

These tools run in the browser on this site. They do not log into your machines.

More in this cluster

The pillar for this page, and the next published pages filed with it.