As stated in the question, I need to block all traffic out to internet except for one port on MAC OS X 10.8.x.

I just need the commands to run from a shell or edit any conf file?

1 Answer 1


assuming that your external interface is en0 you can try the following command (allow https/443 port in this example) :

printf "block all\npass on en0 proto { tcp,udp } from any to any port 443\n"|sudo /sbin/pfctl -Ef -

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.