Skip to content
BENIBIX Learn

iptables

Infrastructure⌨️ Linux & the Command LineFirewall Tools

Also known as iptables Command, ip6tables, iptables Rules

The older Linux firewall tool. It still works, on top of nftables.

Think of it like

Think of it like the old way to write the guard's list. People still use it, but a newer book sits behind it.

Example

Jack follows an old guide that uses iptables. The command works on his new server, and the rule lands in nftables.

Why it matters

Most firewall guides online are written for it. Knowing it lets you read them.

Definition

iptables is the older Linux tool for writing firewall rules. Each rule says what to do with a kind of packet, like accept or drop. Guides from many years still use it, so you will see it often. On current Debian and Ubuntu, the iptables command still works. Behind the scenes, it writes its rules into nftables.

Example code

bash
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
One rule: accept traffic coming in on port 443.
The iptables command still works. It now writes its rules into nftables below it.

Common mistake

Adding iptables rules and expecting them to last. They are lost at reboot unless you save them.

Key takeaways

  1. 1
    The older tool. Still in many guides.
  2. 2
    One rule per line. Match a packet, then act.
  3. 3
    Not saved by default. Rules vanish at reboot.

Compare

Learn it properly