Well to get optimum security for your server its necessary to install a good firewall. ConfigServer Security & Firewall is a free software based security system developed as an SPI iptables firewall that is comprehensive, straight-forward, easy and flexible to configure.
For Detailed Features Follow the link below:-
http://configserver.com/cp/csf.html
How To Install ConfigServer Security & Firewall:-
Command:-
rm -fv csf.tgz
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
Now you check do your server has required iptables or not
Command:-
perl /etc/csf/csftest.pl
If you server has control panel like direct admin or cpanel you can configure CSF from inside your control pane and track everything using GUI.
How To Uninstall CSF:-
Command:-
On cPanel servers:
cd /etc/csf
sh uninstall.shOn DirectAdmin servers:
cd /etc/csf
sh uninstall.directadmin.shOn generic linux servers:
cd /etc/csf
sh uninstall.generic.sh