apf commands

1. Command to start apf

# apf -s

2. Command to restart apf

# apf -r

3. Command to stop/flush apf

# apf -f

4. Command to list all firewall rules.

# apf -l

5. Command to output firewall status log.

# apf -t

6. To refresh & resolve dns names in trust rules.

# apf -e

7. To output all configuration options.

# apf -o


# apf -o
APF version 9.7 <apf@r-fx.org>
Copyright (C) 2002-2011, R-fx Networks <proj@r-fx.org>
Copyright (C) 2011, Ryan MacDonald <ryan@r-fx.org>
This program may be freely redistributed under the terms of the GNU GPL

INSTALL_PATH "/etc/apf"
IFACE_IN "eth0"
IFACE_OUT "eth0"

8. To remove host from [glob]*_hosts.rules and immediately remove rule from firewall.

# apf -u

9. White-list an IP address:

# apf -a IP
edit /etc/apf/allow_hosts.rules

Always restart apf after white-listing an IP in apf.

10. For blocking an IP in apf

# apf -d IP
edit /etc/apf/deny_hosts.rules

10 APF (Advance Policy Firewall) commands in Linux – Simple usages

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s