How to Delete All IP Deny From APF (deny_host.rules)

APF () Is a system firewall for LinuxBased on (Netfilter). 
When APFBlocked access to the server multiple IPs, there are two options that you can remove these limitations. The first option would be controlled directly from the console (or ssh) through which you can remove the blocked IPs in turn. You can do this by ordering:

apf -u 117.41.182.209

Where “117.41.182.209"Is the IP that was blocked by APF. The message resulting from the order will be:

apf(7931): {trust} removed 117.41.182.209 from trust system

Where is a number of blocked IPsThe method above we would take some time before we remove it all. To delete all IPs will need to clean the file that is stored IPs blocked. Ie file deny_hosts.rules from / Etc / APF .
To achieve this, we delete the deny_host.rules file and restart the apf service. The commands below:

rm -rf /etc/apf/deny_host.rules 

/etc/init.d/apf restart
Restart APF Linux Firewall

It has been erased IPs blocked by APF and restart service. If you want to recover IPs blocked by APF, open the file deny_hosts.rules.back.

Advanced Policy Firewall Commands

usage / usr / local / sbin / APF [OPTION]
-s | –start ……………………. load all firewall rules
-r|–restart ………………….. stop (flush) & reload firewall rules
-f | –stop …… .. ……………… stop (flush) all firewall rules
-l | –list …………………… .. list all firewall rules
-t | –status …………………… output firewall status log
-e | –refresh ………………… .. refresh & resolve dns names in trust rules
-a HOST CMT | –allow HOST COMMENT… add host (IP / FQDN) to allow_hosts.rules and
                                     immediately load a new rule into a firewall
-d HOST CMT | –deny HOST COMMENT…. add host (IP / FQDN) to deny_hosts.rules and
                                     immediately load a new rule into a firewall
-u | –remove HOST ………………. remove host from [glob] * _ hosts.rules
                                     and immediately remove rule from firewall
-o | –ovars ……………………. output all configuration options

STEALTH SETTINGS - ALL CLEAR LIST OF BLOCKED IPs ADVANCED FIREWALL POLICY.

Founder and editor Stealth Settings, from 2006 to the present. Experience on operating systems Linux (in particular CentOS), Mac OS X, Windows XP> Windows 10 si WordPress (CMS).

How to » Linux » How to Delete All IP Deny From APF (deny_host.rules)
Leave a Comment