Skip to main content
rfxn
APFGPL v2v2.0.1Since 2003
100

Advanced Policy Firewall

iptables-based firewall with intuitive policy syntax

Advanced Policy Firewall (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. The configuration is designed to be very informative and present the user with an easy to follow process, from top to bottom of the configuration file.

APF employs a three-fold filtering approach. Static rule-based policies provide unchanging firewall instructions. Connection-based stateful policies distinguish legitimate packets for known connections. Sanity-based policies match traffic patterns against known attack methods and enforce Internet standards compliance such as source IP forgery detection.

Stars

100

Forks

43

Last Push

Feb 21, 2026

Latest Release
v2.0.1
Project Downloads & Supporting Files

18

3d

31

7d

139

30d

411

90d

1.72k

1y

Feb 18 — Feb 21

Features

Filtering

  • Granular inbound and outbound network filtering
  • User ID based outbound network filtering
  • Application based network filtering
  • Global TCP/UDP port and ICMP type filtering with multiple methods (drop, reject, prohibit)
  • Advanced packet sanity checks including fragmented UDP, port zero floods, ARP poisoning

Trust & Blocking

  • Trust based rule files with advanced syntax: proto:flow:[s/d]=port:[s/d]=ip(/mask)
  • Global trust system with rules downloaded from a central management server
  • Reactive Address Blocking (RAB) — next generation in-line intrusion prevention
  • DShield.org block list support and Spamhaus DROP list support
  • Configurable policies for each IP on the system with convenience variables

Performance & Configuration

  • Fast load feature allowing 1000+ rules to load in under 1 second
  • Detailed and well-commented configuration file
  • Debug mode for testing new features and configuration setups
  • Inbound and outbound network interfaces independently configurable
  • Dynamic DNS resolver configuration
  • Configurable connection tracking with kernel hooks for syn-flood hardening
  • Comprehensive error checking to prevent configuration mistakes

Installation

bash
$ git clone https://github.com/rfxn/advanced-policy-firewall.git
$ cd advanced-policy-firewall
$ sudo ./install.sh

Verify Download

MD5 Signature Verification

Always verify the integrity of downloaded packages before installation.

bash
$ wget https://www.rfxn.com/downloads/apf-current.tar.gz
$ wget https://www.rfxn.com/downloads/apf-current.tar.gz.md5
$ md5sum -c apf-current.tar.gz.md5