Back to search

iptables

command firewall

Configure packet filtering rules (netfilter)

Required Packages

sudo apt install -y iptables

Options

Select the table (default: filter)

Empty for all chains (useful with -L/-F)

e.g. 1024:65535, 80

e.g. 22, 80, 443, 8080:8090

e.g. 192.168.1.0/24, 10.0.0.1

e.g. eth0, ens33 (for INPUT/FORWARD/PREROUTING)

e.g. eth0, ens33 (for OUTPUT/FORWARD/POSTROUTING)

e.g. NEW, ESTABLISHED, RELATED (comma-separated)

Generated Command

sudo iptables -A -j ACCEPT