Configure firewall from command line?

Joined
Aug 11, 2012
Messages
85
Reaction score
1
Points
8
Location
San Diego, CA
I'm trying to find some basic commands and examples for pfctl I come from a Linux background and am pretty comfortable with iptables Most of the info about the Mac pf firewall involves monkeying with GUI stuff, and so far all of the command line references I'm finding are for BSD and don't appear to be relevant (references to contents of /etc/pf.conf that just don't look anything like what I'm seeing in mine).

How do I get a list of all current firewall rules ( iptables -L )?

How do I start the pf firewall and flush any and all rulesets?

How do I set default policies?

I usually start by denying all inbound connections except for those related to established outbound connections.

I found IceFloor, but that appears to configure my firewall as opposed to generating rules. I want to wind up with command-line commands that can be added to a script... it's tedious enough standing up new hosts without having to go through a clickfest to configure every little thing.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top