In this tutorial, I will share my learning and understanding of IPTABLES.
There are a few things that will help in your understanding and configuration of: .
- TABLES
Tables form the basis of the IPTABLES where chains and rules are created base on the tables that the packets fall under. - CHAINS
Each tables have the respective chains that look at the packets as it transverse the various table. Do take note that not all chains are present in all tables. I have highlighted below in another table what are the chains available for each tables. - RULES
Rules are what is configure to allow action to be perform on the packets that transverse the tables and chains.
![](https://dracocybersecurity.com/wp-content/uploads/2022/12/image-1.png)
Here is the list of CHAINS that are available to each TABLE.
![](https://dracocybersecurity.com/wp-content/uploads/2022/12/image-2.png)
You can use the following command to validate the default CHAINS available to each TABLE. You can add in -n to see the numeric representation of the ip and ports, and -v verbose to see additional informations such as packets count.
sudo iptables -t <table name> -L
![](https://dracocybersecurity.com/wp-content/uploads/2022/12/image-3.png)
Below is the basic transversal order of the packets through the chain.
![](https://dracocybersecurity.com/wp-content/uploads/2022/12/image-4.png)
You can look at the tutorial to configure the basic IPTABLES rule to get started.
https://dracocybersecurity.com/iptables-basic-configurations-ubuntu-20-04/