After following the instructions listed at https://www.geoghegan.ca/pub/pf-badhost/latest/install/freebsd.txt to get pf-badhost running on FreeBSD 15.0, it seems like the pf-badhost script has run successfully and that pf itself has loaded the pfbadhost table, but it doesn't seem like pf is blocking requests from the addresses in this table.
Here are the contents of /etc/pf.conf
I believe that the rules have been loaded because the following shows up in the output of
In addition,
Running
Since the address matches, I am unsure why this traffic was allowed in the first place. I have also validated the /etc/pf.conf file by running
Here are the contents of /etc/pf.conf
Code:
ext_if = "vtnet0"
set limit table-entries 400000
scrub in all
table <pfbadhost> persist file “/etc/pf-badhost.txt”
block in log quick on egress from <pfbadhost>
block out log quick on egress to <pfbadhost>
antispoof for $ext_if
I believe that the rules have been loaded because the following shows up in the output of
pfctl -sr:
Code:
block drop in log quick on egress from <pfbadhost> to any
block drop out log quick on egress from any to <pfbadhost>
In addition,
pfctl -t pfbadhost -Ts | wc -l gives me back a count of 25,073, which I believe indicates that the table has at least been loaded correctly. In spite of all of this, I am still seeing IP addresses which should be blocked show up in the /var/log/httpd-access.log. For example, here is output from this log which is clearly abnormal:
Code:
176.65.148.161 - - [07/Feb/2026:20:47:21 +0000] "HEAD / HTTP/1.1" 401 -
176.65.148.161 - - [07/Feb/2026:20:47:21 +0000] "HEAD / HTTP/1.1" 401 -
176.65.148.161 - - [07/Feb/2026:20:47:22 +0000] "GET / HTTP/1.1" 301 275
176.65.148.161 - - [07/Feb/2026:20:47:22 +0000] "GET / HTTP/1.1" 301 275
176.65.148.161 - - [07/Feb/2026:20:47:22 +0000] "GET / HTTP/1.1" 401 421
176.65.148.161 - - [07/Feb/2026:20:47:22 +0000] "GET / HTTP/1.1" 401 421
176.65.148.161 - - [07/Feb/2026:20:47:22 +0000] "HEAD /_next HTTP/1.1" 301 -
176.65.148.161 - - [07/Feb/2026:20:47:22 +0000] "HEAD /_next HTTP/1.1" 301 -
176.65.148.161 - - [07/Feb/2026:20:47:22 +0000] "HEAD /_next HTTP/1.1" 401 -
176.65.148.161 - - [07/Feb/2026:20:47:22 +0000] "HEAD /_next HTTP/1.1" 401 -
Running
pfctl -t pfbadhost -Tt 176.65.148.161 gives the following output:
Code:
1/1 addresses match.
Since the address matches, I am unsure why this traffic was allowed in the first place. I have also validated the /etc/pf.conf file by running
pfctl -nf /etc/pf.conf and have ran pfctl -f /etc/pf.conf and restarted my server to ensure that the configuration file has been loaded. I am hoping for feedback on where I may have misconfigured pf so that I can adjust the configuration and ensure that these rules are enforced properly.