Skip to main content
3 of 3
improve question
athena
  • 12.5k
  • 8
  • 61
  • 137

Control packets with pfctl

Looking for a way to control precisely which process or application is allowed to communicate with the network in a low connectivity context, I found the pfctl command which seems to be designed for the job.

I would like to allow only a few applications to connect to the network (ie: ping and Mail) and remove Apple unnecessary services.

Here is my current /etc/pf.conf file:

scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
rdr-anchor "com.apple/*"
dummynet-anchor "com.apple/*"
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"

I try to understand the pfctl status with this command:

$ sudo pfctl -sr
No ALTQ support in kernel
ALTQ related functions disabled
scrub-anchor "com.apple/*" all fragment reassemble
anchor "com.apple/*" all

Is it possible to achieve the filtering I want with pfctl and how?

Martin Delille
  • 795
  • 2
  • 9
  • 20