iptables

Linux Firewall Rule Visualizer

1Packet Flow Diagram

2Table & Chain Reference

The filter table is the default table for packet filtering — allowing or denying packets. Most firewall rules go here.

INPUT FORWARD OUTPUT

The nat table is consulted for packets that create a new connection. Used for Network Address Translation (SNAT, DNAT, MASQUERADE).

PREROUTING OUTPUT POSTROUTING

The mangle table is used for specialized packet alteration — modifying TTL, TOS, MARK fields, etc. Applied to all 5 chains.

PREROUTING INPUT FORWARD OUTPUT POSTROUTING

The raw table has the highest priority and is mainly used to configure exemptions from connection tracking (NOTRACK). Applied before connection tracking.

PREROUTING OUTPUT

3Rule Builder filter table

iptables command
iptables -A INPUT -j ACCEPT
nftables equivalent
nft add rule ip filter input accept

Current Ruleset

No rules yet — build one above or load a template.

4Common Rule Templates

5Default Chain Policies

The default policy is the action taken when a packet reaches the end of a chain without matching any rule. Toggle to see the effect.

6Quick Reference Cheatsheet