Iptables rules under linux

when writing iptables rules under linux, I don"t understand which chain is written in which table? Excuse me, is there any pattern in this?

Mar.23,2021

the purpose of each table is different, which is easier to distinguish. For example, the filter table is used for Filter packets, and nat is used to do nat.

as for chains, it is a series of rules in a table, and different chains act at different times.

The reason why you don't understand, I think, is that you don't know the function of each table and the timing of each chain. In fact, on the Internet, the content of iptables in books will mention the explanation of commonly used tables and chains. if you really don't want to read, just read the man manual, which also has an introduction , directly man iptables

. < hr >

I recommend this tutorial , which is very detailed and quite good, but in English.

there is a diagram that basically contains the flow order of packets on commonly used tables and chains

Menu