I recently learned about the scrub feature in pf, that sounds like a great thing to enable on my web server.
So I read all I can find about it, which is essentially just the same man paged reposted on the docs of every different bsd system that exists
Everything seems simple enough, but I can't get it to work! Every time I add scrub in all to my pf.conf, it gives me an error that Rules must be in order: options, normalization, queueing, translation, filtering.
I don't have that many rules. My setup is not very complicated yet everywhere I try to add scrubbing, causes this order syntax error.
Here's my full ruleset, its pretty short. Note that this is my local test server, hence the local IPs and rules that seem redundant. But on the real server, there are multiple physical connections and multiple IPs.
When its commented out, everything works great. When its not commented, anywhere I put it causes the order error.
Also as I look at my rules, near the bottom I'm blocking the 152.58 subnet. But all of the pass rules are "pass in quick" so that last block rule should never actually get triggered huh? Thats not related but just something I'm seeing now. I don't remember why I even put it in there, guess I'll remove that.
So I read all I can find about it, which is essentially just the same man paged reposted on the docs of every different bsd system that exists
Everything seems simple enough, but I can't get it to work! Every time I add scrub in all to my pf.conf, it gives me an error that Rules must be in order: options, normalization, queueing, translation, filtering.
I don't have that many rules. My setup is not very complicated yet everywhere I try to add scrubbing, causes this order syntax error.
Here's my full ruleset, its pretty short. Note that this is my local test server, hence the local IPs and rules that seem redundant. But on the real server, there are multiple physical connections and multiple IPs.
INI:
set skip on lo0
table <badhosts_a> persist
table <badhosts_b> persist
#scrub in all
block in quick from <badhosts_a> to any
block in quick from <badhosts_b> to any
block in all
pass in quick proto tcp from any to 172.16.2.16 port { 80 443 } keep state
pass in quick proto tcp from any to 172.16.2.16 port { 25 587 993 } keep state
pass in quick from 172.16.4.1/24 to any keep state
pass in quick proto icmp from any to any keep state
pass in quick proto esp from any to 172.16.2.16 keep state
pass in quick proto udp from any to 172.16.2.16 port { 500 1701 4500 } keep state
block in quick from 152.58.1.1/16
#Outbound traffic
pass out proto { tcp, udp, icmp } from any to any keep state
When its commented out, everything works great. When its not commented, anywhere I put it causes the order error.
Also as I look at my rules, near the bottom I'm blocking the 152.58 subnet. But all of the pass rules are "pass in quick" so that last block rule should never actually get triggered huh? Thats not related but just something I'm seeing now. I don't remember why I even put it in there, guess I'll remove that.