Skip to content

4.4 Configuration Default Filter

Gurdeep Singh (Guru) edited this page Aug 10, 2024 · 1 revision

Configuration - Default Filter

PHPFirewall has 2 databases where it stores information of IP addresses that it filters.

  1. Main database - Filters in this database are configured by the administrator of the firewall.
  2. Default database - If there is no match for an IP in the main database, the IP is checked in the default database and if not found, adds a new entry in it. Default database can be used for monitoring purpose so you can fine tune your main database filters.

The default database creates filters of filter address type host and the filter rule is set to the default filter set via the configuration. By default (initial configuration), the rule is to allow every IP address. Before you start adding filter rules and bring the firewall in production, you should change the default filter to "block", so any IP that does not match the filters from main database, will be added to the default filter database.

Via CLI

admin@phpterminal:firewall(config)# set default filter block

SET DEFAULT FILTER BLOCK OUTPUT
...
FIREWALL DETAILS > DEFAULT_FILTER : block
...

admin@phpterminal:firewall(config)#

Via PHP Firewall Class

$firewall->setConfigDefaultFilter('block');