Annotation of src/etc/pf.conf, Revision 1.15
1.15 ! dhartmei 1: # $OpenBSD: pf.conf,v 1.14 2002/12/23 17:34:45 henning Exp $
1.1 kjell 2: #
1.12 henning 3: # See pf.conf(5) and /usr/share/pf for syntax and examples.
4: # General order: options, scrub rules, translation rules, and filter rules.
5: # Note that translation rules are first match while filter rules are last match.
1.4 henning 6: #
1.12 henning 7: # Macros: define common values, so they can be referenced and changed easily.
1.8 pb 8: ext_if="ext0" # replace with actual external interface name i.e., dc0
9: internal_net="10.1.1.1/8"
10: external_addr="192.168.1.1"
1.5 henning 11:
1.12 henning 12: # Options: tune the behavior of pf, default values are given.
13: #set timeout { interval 30, frag 10 }
14: #set timeout { tcp.first 120, tcp.opening 30, tcp.established 86400 }
1.13 henning 15: #set timeout { tcp.closing 900, tcp.finwait 45, tcp.closed 90 }
1.12 henning 16: #set timeout { udp.first 60, udp.single 30, udp.multiple 60 }
17: #set timeout { icmp.first 20, icmp.error 10 }
18: #set timeout { other.first 60, other.single 30, other.multiple 60 }
1.15 ! dhartmei 19: #set limit { states 10000, frags 5000 }
1.12 henning 20: #set loginterface none
1.14 henning 21: #set optimization normal
1.12 henning 22: #set block-policy drop
23: #set require-order yes
24:
25: # Normalize: reassemble fragments and resolve or reduce traffic ambiguities.
1.10 deraadt 26: #scrub in all
1.5 henning 27:
1.12 henning 28: # nat: packets going out through $ext_if with source address $internal_net will
29: # get translated as coming from the address of $ext_if, a state is created for
30: # such packets, and incoming packets will be redirected to the internal address.
31: #nat on $ext_if from $internal_net to any -> ($ext_if)
1.4 henning 32:
1.7 ian 33: # rdr: packets coming in on $ext_if with destination $external_addr:1234 will
34: # be redirected to 10.1.1.1:5678. A state is created for such packets, and
1.4 henning 35: # outgoing packets will be translated as coming from the external address.
1.10 deraadt 36: #rdr on $ext_if proto tcp from any to $external_addr/32 port 1234 -> 10.1.1.1 port 5678
1.4 henning 37:
1.12 henning 38: # anchor where spamd-setup(8) attaches spam-redirection to spamd(8).
39: #no rdr on { lo0, lo1 } from any to any
40: #rdr-anchor spamd inet proto tcp from any to any port = smtp
41:
42: # filter rules: the implicit first two rules are
1.10 deraadt 43: #pass in all
44: #pass out all
1.4 henning 45:
1.9 henning 46: # block all incoming packets but allow ssh, pass all outgoing tcp and udp
1.12 henning 47: # connections and keep state, logging blocked packets.
1.10 deraadt 48: #block in log all
49: #pass in on $ext_if proto tcp from any to $ext_if port 22 keep state
50: #pass out on $ext_if proto { tcp, udp } all keep state