APF Advance Policy firewall that provides you an easy way to configure iptables rules. This is a short snippet how can you install/configure or uninstall APF on your Linux Server.
tar -zxvf apf-current.tar.gz
APF installation is completed.
How to allow specific incoming ports in APF ? e.g 80,21
One thing more, When you start APF for the first time, it runs in DEVEL mode so you have to disable that else it would flush all rules every 5 minutes.
To disable devel mode, Set it to “0″
To block certain IP e.g 123.456.7.89 add it to /etc/apf/deny_hosts.rules
To allow certain ip for specific port e.g allow 126.96.36.199 to access 8088
Add following rule to /etc/apf/allow_hosts.rules
Make sure, what ever changes you made to those files you need to reload APF service.
service apf restart
How to Uninstall APF Firewall?
chkconfig apf off
rm -rf /etc/apf
rm -f /etc/cron.daily/fw
rm -f /etc/init.d/apf
Verify, you should not see any rule.
iptables -L -n