Server: Setting a Firewall With Iptables

  • Copy the file iptables.sh in the directory /etc/init.d with these rules (but obviously you need to customize them).
  • Make the file executable.
  • Assuming the current run level is the second one:ln -s /etc/init.d/iptables.sh /etc/rc2.d/S97iptables
    Actually you should link the script in any runlevel to cover the case you change runlevel, even temporary.

******************************************************************

iptables script

******************************************************************

Useful Commands:
List of active rules:
iptables -L
Removes all the rules
iptables -F

This entry was posted in LAMP Server Setup, Linux, Security, System Maintenance, Web Dev Security. Bookmark the permalink.

Leave a Reply