Tech Support Notes

APF

Advanced Policy Firewall aka APF is an iptables(netfilter) based firewall system designed around the essential needs of today’s Internet deployed servers and the unique needs of custom deployed Linux installations.

To install APF you can use the following commands:

wget http://www.rfxn.com/downloads/apf-current.tar.gz  
tar -zxvf http://www.rfxn.com/downloads/apf-current.tar.gz  
cd apf-*  
sh ./install.sh

To deny an IP

apf -d IPADDRESS

To allow an IP

apf -a IPADDRESS

To reload the rules

apf -r 

More Commands:

usage /usr/local/sbin/apf [OPTION]
-s|--start ......................... load all firewall rules
-r|--restart ....................... stop (flush) & reload firewall rules
-f|--stop........ .................. stop (flush) all firewall rules
-l|--list .......................... list all firewall rules
-t|--status ........................ output firewall status log
-e|--refresh ....................... refresh & resolve dns names in trust rules
-a HOST CMT|--allow HOST COMMENT ... add host (IP/FQDN) to allow_hosts.rules and
                                     immediately load new rule into firewall
-d HOST CMT|--deny HOST COMMENT .... add host (IP/FQDN) to deny_hosts.rules and
                                     immediately load new rule into firewall
-u|--remove HOST ................... remove host from [glob]*_hosts.rules
                                     and immediately remove rule from firewall
-o|--ovars ......................... output all configuration options

APF tricks/tips from the Softlayer Blog