Iptables is a built‑in Linux firewall utility that controls network traffic by applying filtering rules. It is used by system administrators to block unwanted access, allow specific traffic, and secure servers from network attacks.
iptables checks every network packet and applies rules to decide whether to allow, block, or modify it. The decision process is based on three key concepts: Tables, Chains, and Rules.
1. Tables
Tables define the type of packet processing.
Common Tables:
Syntax:
sudo iptables -t
Examples:
2. Chains
Chains are lists of rules that packets pass through.
Common Chains:
Syntax:
Examples:
3. Rules
Rules specify conditions and actions for packets.
Syntax:
Examples:
Useful Commands
Read related: https://blog.vcclhosting.com/what-are-iptables-and-how-it-works/: How to use iptables with Practical Examples
-Written By Vijay Powar