I often see that there are some stateful matching rules in a iptables' chain such as INPUT.
I known what they are doing, and I'm interested in that
Should I do the same for the chains of the table NAT?
For example, in my home router, I want it accepts ssh, and also acts as a NAT router.
If we have:
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
should I do follows for better performance?
-t nat -A POSTROUTING -m state --state RELATED,ESTABLISHED -j MASQUERADE
-t nat -A POSTROUTING -s 192.168.1.0/24 -o wan0 -m state --state NEW -j MASQUERADE
I guess that I should NOT do the same for the POSTROUTING chain, but should for the FORWARD.
Thanks!