Firewall Hero Hints

Mac Firewall pf

To adjust the Mac command-line firewall, edit this file:
sudo nano /etc/pf.conf
Add lines like this to block ports, as shown below.
block in quick inet proto { tcp, udp } from any to any port 20

This command tests the firewall configuration for errors:

sudo pfctl -vnf /etc/pf.conf
This command activates the firewall:
sudo pfctl -evf /etc/pf.conf
This command disables the firewall:
sudo pfctl -d

Posted 11-15-17 by Sam Bowne
Revised to fix the enabling flags 11-16-17