Annotation of src/etc/pf.conf, Revision 1.9
1.9 ! henning 1: # $OpenBSD: pf.conf,v 1.8 2002/11/24 19:56:45 pb Exp $
1.1 kjell 2: #
1.2 smart 3: # See pf.conf(5) for syntax and examples
1.7 ian 4: # General order: options, scrub rules, NAT/rdr, and filter rules.
1.9 ! henning 5: # Note that NAT is first match while packet filters are last match,
1.4 henning 6: #
1.8 pb 7: ext_if="ext0" # replace with actual external interface name i.e., dc0
8: internal_net="10.1.1.1/8"
9: external_addr="192.168.1.1"
1.5 henning 10:
1.6 fgsch 11: # Normalize: reassemble fragments and resolve or reduce traffic ambiguities
1.5 henning 12: # scrub in all
13:
1.7 ian 14: # nat: packets going out through $ext_if with source address $internal_net will get
15: # translated as coming from $external_addr, a state is created for such packets,
1.4 henning 16: # and incoming packets will be redirected to the internal address.
17:
1.7 ian 18: # nat on $ext_if from $internal_net to any -> $external_addr
1.4 henning 19:
1.7 ian 20: # rdr: packets coming in on $ext_if with destination $external_addr:1234 will
21: # be redirected to 10.1.1.1:5678. A state is created for such packets, and
1.4 henning 22: # outgoing packets will be translated as coming from the external address.
1.1 kjell 23:
1.7 ian 24: # rdr on $ext_if proto tcp from any to $external_addr/32 port 1234 -> 10.1.1.1 port 5678
1.4 henning 25:
26: # filter rules
27: # the implicit first two rules are
1.1 kjell 28: # pass in all
29: # pass out all
1.4 henning 30:
1.9 ! henning 31: # block all incoming packets but allow ssh, pass all outgoing tcp and udp
1.4 henning 32: # connections and keep state
1.6 fgsch 33: # log blocked packets
1.4 henning 34:
35: # block in log all
1.7 ian 36: # pass in on $ext_if proto tcp from any to $ext_if port 22 keep state
37: # pass out on $ext_if proto { tcp, udp } all keep state