How to enable PF on FreeBSD 12.1
-
Input this commmand:
sysrc pf_enable=yes
-
Download the file "pf.conf" and upload in your-option-folder.
NOTE: Please you need modificate the pf.conf PORTS for your PORTS or maybe you will be blocked.
-
Configure the rules with the pf.conf
sysrc pf_rules=/your-option-folder/pf.conf
If you want logs you can active with this commands:
-
First command for enable Logs.
sysrc pflog_enable=yes
-
Second command for specify archive destination logs.
sysrc pflog_logfile=/var/log/pflog
a) Command for start Firewall:
service pf start
b) Command for start Logs:
service pflog start
c) Command for stop Firewall:
service pf stop
d) Command for restart Firewall:
serve pf restart
e) Command for check Firewall status:
service pf status
-
Show all abusive hosts:
pfctl -t abusive_hosts -T show
-
Delete all Banned Clients:
pfctl -t abusive_hosts -T flush
-
Add one IP for Ban:
pfctl -t abusive_hosts -T add IP
-
Delete one IP Banned:
pfctl -t abusive_hosts -T del IP