I am trying to follow this answer on OS X 11.x

block return from any to

The console displays :

-bash: block: command not found

So, I tried to install it using brew:

brew install block

However, I got another error .

  • How to install this firewall utility?
  • 1
    block is not a command; that is a line from the pf configuration file /etc/pf.conf – user4556274 Sep 19 '16 at 15:50
  • 1
    @user4556274 if you know how to use it on Mac OS X, please post an answer. – derobert Sep 19 '16 at 15:51
  • @derobert : my question is already about Mac OS X 10.11.6 El capitan – Abdennour TOUMI Sep 21 '16 at 6:50

On recent versions of OS X, pf is installed and running by default. The linked question is referring to changing the pf configuration, not installing a new utility. Modifying a firewall on a production system is not something which should be done without reading the documentation (man pf.conf , man pfctl).

To add that block line (or experiment with other configuration changes), you would add it to the configuration file /etc/pf.conf with your preferred editor, and then reload the firewall configuration with

$ sudo pfctl -f /etc/pf.conf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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