How to install APF on centos

APF is a popular, capable firewall that many system administrators prefer because it is simple to configure and manage. Here’s how to install APF on CentOS.
You can install APF in two ways: download it from this link and install it with the rpm command, or install it from the repository. For the repository method, first update the repository list:
yum update yum install apf
After installation, these are the main paths APF uses:
| /etc/apf/apf.conf |
| /usr/bin/apf |
| /usr/share/man/man1/apf.1.xz |
| /var/cache/apf |
To change the configuration, edit /etc/apf/apf.conf. The picture below shows some of its key parameters:
Here are the most useful APF switches and commands:
/usr/local/sbin/apf -s // To start APF
/usr/local/sbin/apf -r // To restart APF
/usr/local/sbin/apf -f // To stop APF.
/usr/local/sbin/apf -l // To list all the firewall rules.
/usr/local/sbin/apf -t // To view the output log status.
/usr/local/sbin/apf -a <IP Address> // To allow a host in the firewall
/usr/local/sbin/apf -d <IP Address> // To deny a host in the firewall
/usr/local/sbin/apf -o // To view all the configuration options
/usr/local/sbin/apf –help // To view all the options provided by the firewall.