Iptables Rules
Hi,
Is that matter if I placed the options/extensions ( -m and -p ) in different orders ?
Please tell me these 4 configurations make any difference ... in term allows ssh to my workstation.
-A INPUT -s 1.2.3.0/24 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s 1.2.3.0/24 -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -s 1.2.3.0/24 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -s 1.2.3.0/24 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
Thanks !
Quoted 3 lines · Minh Cao
Hi,
Is that matter if I placed the options/extensions ( -m and -p ) in different orders ?
No, but it matters between multiple -m.
Quoted 4 lines
-A INPUT -s 1.2.3.0/24 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -s 1.2.3.0/24 -m tcp -p tcp --dport 22 -j ACCEPT
no
Quoted 6 lines
-A INPUT -s 1.2.3.0/24 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -s 1.2.3.0/24 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
no.
(But "-m conntrack --ctstate NEW -m tcp" and
"-m tcp -m conntrack --ctstate NEW" would)