Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to do something that I thought would be relatively simple: Block all the traffic to a test server, other than my company's subnet.

I've tried things along these lines ( is my placeholder for this example), but only the block seems to work:

block in all
pass in from
pass in on en0 from
pass in all from

None of those pass in lines seem to work (I know some of those might throw a syntax error, as I'm just grabbing all the lines I've commented out while testing).

Is this less simple than I assumed? Am I missing something obvious?

share|improve this question
up vote 4 down vote accepted

its because its specifying a single ip, you need to write it with the subnet:

pass in from

man pf.conf should list a few methods of defining ranges and blocks. A side note, take care to ensure there are no drop quick kind of rules above your pass, and no rules below that could accidently match and block your packets.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.