Install Iptables On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora And Raspbian
iptables
Maintainer: Debian Netfilter Packaging Team
Email: [email protected] .
Website: https://www.netfilter.org/
Section: net
Install iptables
-
Debian
apt-get install iptablesClick to copy -
Ubuntu
apt-get install iptablesClick to copy -
Alpine OS
apk add iptablesClick to copy -
Arch Linux
pacman -S iptablesClick to copy -
Kali Linux
apt-get install iptablesClick to copy -
CentOS
yum install iptablesClick to copy -
Fedora
dnf install iptablesClick to copy -
Raspbian
apt-get install iptablesClick to copy
Program that allows configuration of tables, chains and rules provided by the Linux kernel firewall.
How to use iptables?
Below are few example commands for iptables that you can use in the terminal.
View chains, rules, and packet/byte counters for all tables:sudo iptables -vnLClick to copySet chain policy rule:sudo iptables -P chain ruleClick to copyAppend rule to chain policy for IP:sudo iptables -A chain -s ip -j ruleClick to copyAppend rule to chain policy for IP considering protocol and port:sudo iptables -A chain -s ip -p protocol --dport port -j ruleClick to copyDelete chain rule:sudo iptables -D chain rule_line_numberClick to copySave iptables configuration of a given table to a file:sudo iptables-save -t tablename > path/to/iptables_fileClick to copyRestore iptables configuration from a file:sudo iptables-restore < path/to/iptables_fileClick to copy
Installing iptables command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora and Raspbian operating systems. Once you run the command it will install the latest version of iptables 2026 package in your OS.




