Configuring APF Advanced Policy Firewall

System Administration Add comments

Not sure if anyone would ever need this but there might come a time I need to install it again so hey, it’s going in my blog.

Introduction
APF is a policy based iptables firewall system designed for ease of use and configuration. It employs a subset of features to satisfy the veteran
Linux user and the novice alike. Packaged in tar.gz and RPM formats, APF is ideal for deployment in any linux server environment.

This guide will show you how to install and configure APF firewall on your server.

1. Type cd /usr/local/src

2. wget http://www.rfxnetworks.com/downloads/apf-current.tar.gz

3. tar -xvzf apf-current.tar.gz

4. cd apf-x.x/ (the x.x stands for the apf version)

5. ./install.sh
The message below will appear once APF is installed.

.: APF installed
Install path: /etc/apf
Config path: /etc/apf/conf.apf
Executable path: /usr/local/sbin/apf

6. pico /etc/apf/conf.apf

Note: The settings below are recommend for cPanel servers.

Common ingress (inbound) ports
IG_TCP_CPORTS=”21,22,25,53,80,110,143,443,2082,2083, 2086,2087, 2095, 2096,30000_35000″

Common ingress (inbound) UDP ports
IG_UDP_CPORTS=”53″

Common egress (outbound) TCP ports
EG_TCP_CPORTS=”21,25,80,443,43″

Common egress (outbound) UDP ports
EG_UDP_CPORTS=”20,21,53″

7. Simply press Crtl + X then Y to save & quit.

8. Starting the firewall
/usr/local/sbin/apf -s

9. If everything is fine after the firewall is being started, key in
pico /etc/apf/conf.apf

Change DEVM=”1″ to DEVM=”0″

10. Again, press Ctrl+X then Y

11. To restart the firewall, type /usr/local/sbin/apf -r

Currently Listening to: Hoobastank - Inside of You

Leave a Reply

You must be logged in to post a comment.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in