pf
It matches against ALL rules... Avoid with quick
.
Terminology
- Tables:
- Macros:
- Anchors:
Add a rule
Rules
Macros.
tcp_pass = "{ 80 22 25 110 123 137:139 631 }"
udp_pass = "{ 53 110 631 }"
block all
pass out proto tcp to port $tcp_pass
pass out log on fxp0 proto udp to any port $udp_pass keep state
pass in quick on fxp0 proto tcp to any port 80 keep state
Macros with names.
tcp_pass = "{ www ssh ntp smtp pop3 }" # /etc/services
block all
pass out on fxp0 proto tcp to any port $tcp_pass keep state
Tables
Show tables with pfctl -t local -T show
pfctl
Arguments
d
Disable the packet filter.e
Enable the packet filter.f
Replace the current ruleset with the rules contained in file.g
Include output helpful for debugging.n
Do not actually load rules, just parse them.N
Do not perform domain name resolution.q
Quiet.v
Verbose.
Test the syntax of the rules
Re/load rules.
Show rules
Add an address to a table
Delete an address from a table
Enable
It should be enabled.
Enable logging
Read log
Realtime