The iptables manual page for -m, --match match
is:
Specifies a match to use, that is, an extension module that tests for a specific property. The set of matches make up the condition under which a target is invoked. Matches are evaluated first to last as specified on the command line and work in short-circuit fashion, i.e. if one extension yields false, evaluation will stop.
I do not understand what this means, specifically, what does the extension module mean?
Also, how is iptables -A INPUT -m tcp ...
different from iptables -A INPUT -p tcp ...
?
Extension modules are just that: they extend the capabilities of
iptables
. For example, consider theowner
module. The iptable options-m owner --uid-owner lp
will select all packets sent by userlp
. This feature is only available if you specify, as above, theowner
module. Likewise, thetcp
module makes available options for selecting, among other things, tcp flags such as ACK or RST. The available modules and their features are detailed in:Also note that iptables is out-of-date. You should be using nftables instead.