NatureNMoon
Restricted
- Jul 8, 2016
- 70
- 124
- 86
I have just checked all the iptables scripts and I have seen that there are a lot of mistakes about IPTABLES Scripts, let me say the first mistake. You shouldn't use "ACCEPT" in your iptables scripts. This rule creates many backdoors and bugs, it may affect your servers very very bad. Instead of ACCEPT, please use RETURN. If you ask why? check the example below;
You wanted to create your iptables and you wanted to block unused protocols, ports or whatever you wanted... and you wrote this script.
The rule, -i externalinterface -p tcp --dport 80 -m connlimit --connlimit-above 15 -j DROP, cannot work well, because there is a rule above which includes "--dport 80 ACCEPT". However, if you use RETURN instead of ACCEPT, your connlimit rule will be worked well by IPTABLES. Moreover, when someone attacks you by using "80 tcp port", they cannot enter into your network!
All in all, you SHOULDN'T USE "ACCEPT" in your iptables rules!
Use RETURN and keep your network alive
Best Regards;
Daniel QUINN
You wanted to create your iptables and you wanted to block unused protocols, ports or whatever you wanted... and you wrote this script.
Code:
-i externalinterface -p tcp --dport 80 -j ACCEPT
-i externalinterface -p udp --dport 9987 -j ACCEPT
-i externalinterface -p tcp --dport 22 -j ACCEPT
-i externalinterface -p tcp --dport 80 -m connlimit --connlimit-above 15 -j DROP
-i externalinterface -j DROP
The rule, -i externalinterface -p tcp --dport 80 -m connlimit --connlimit-above 15 -j DROP, cannot work well, because there is a rule above which includes "--dport 80 ACCEPT". However, if you use RETURN instead of ACCEPT, your connlimit rule will be worked well by IPTABLES. Moreover, when someone attacks you by using "80 tcp port", they cannot enter into your network!
All in all, you SHOULDN'T USE "ACCEPT" in your iptables rules!
Use RETURN and keep your network alive
Best Regards;
Daniel QUINN
Last edited: