[BACK]Return to pf.conf CVS log [TXT][DIR] Up to [local] / src / etc

Annotation of src/etc/pf.conf, Revision 1.18

1.18    ! david       1: #      $OpenBSD: pf.conf,v 1.17 2003/02/28 00:34:13 david Exp $
1.1       kjell       2: #
1.12      henning     3: # See pf.conf(5) and /usr/share/pf for syntax and examples.
1.17      david       4: # Required order: options, normalization, queueing, translation, filtering.
                      5: # Macros and tables may be defined and used anywhere.
1.12      henning     6: # Note that translation rules are first match while filter rules are last match.
1.18    ! david       7:
1.12      henning     8: # Macros: define common values, so they can be referenced and changed easily.
1.17      david       9: #ext_if="ext0" # replace with actual external interface name i.e., dc0
                     10: #internal_net="10.1.1.1/8"
                     11: #external_addr="192.168.1.1"
                     12:
                     13: # Tables: similar to macros, but more flexible for many addresses.
                     14: #table <foo> { 10.0.0.0/8, !10.1.0.0/16, 192.168.0.0/24, 192.168.1.18 }
1.5       henning    15:
1.12      henning    16: # Options: tune the behavior of pf, default values are given.
                     17: #set timeout { interval 30, frag 10 }
                     18: #set timeout { tcp.first 120, tcp.opening 30, tcp.established 86400 }
1.13      henning    19: #set timeout { tcp.closing 900, tcp.finwait 45, tcp.closed 90 }
1.12      henning    20: #set timeout { udp.first 60, udp.single 30, udp.multiple 60 }
                     21: #set timeout { icmp.first 20, icmp.error 10 }
                     22: #set timeout { other.first 60, other.single 30, other.multiple 60 }
1.15      dhartmei   23: #set limit { states 10000, frags 5000 }
1.12      henning    24: #set loginterface none
1.14      henning    25: #set optimization normal
1.12      henning    26: #set block-policy drop
                     27: #set require-order yes
                     28:
1.17      david      29: # Normalization: reassemble fragments and resolve or reduce traffic ambiguities.
1.10      deraadt    30: #scrub in all
1.5       henning    31:
1.17      david      32: # Queueing: rule-based bandwidth control.
                     33: #altq on $ext_if bandwidth 2Mb cbq queue { dflt, developers, marketing }
                     34: #queue dflt bandwidth 5% cbq(default)
                     35: #queue developers bandwidth 80%
                     36: #queue marketing  bandwidth 15%
                     37:
                     38: # Translation: specify how addresses are to be mapped or redirected.
1.12      henning    39: # nat: packets going out through $ext_if with source address $internal_net will
                     40: # get translated as coming from the address of $ext_if, a state is created for
                     41: # such packets, and incoming packets will be redirected to the internal address.
                     42: #nat on $ext_if from $internal_net to any -> ($ext_if)
1.4       henning    43:
1.7       ian        44: # rdr: packets coming in on $ext_if with destination $external_addr:1234 will
                     45: # be redirected to 10.1.1.1:5678. A state is created for such packets, and
1.4       henning    46: # outgoing packets will be translated as coming from the external address.
1.10      deraadt    47: #rdr on $ext_if proto tcp from any to $external_addr/32 port 1234 -> 10.1.1.1 port 5678
1.4       henning    48:
1.17      david      49: # spamd-setup puts addresses to be redirected into table <spamd>.
1.16      jason      50: #table <spamd> persist
1.12      henning    51: #no rdr on { lo0, lo1 } from any to any
1.17      david      52: #rdr inet proto tcp from <spamd> to any port smtp -> 127.0.0.1 port 8025
1.12      henning    53:
1.17      david      54: # Filtering: the implicit first two rules are
1.10      deraadt    55: #pass in all
                     56: #pass out all
1.4       henning    57:
1.9       henning    58: # block all incoming packets but allow ssh, pass all outgoing tcp and udp
1.12      henning    59: # connections and keep state, logging blocked packets.
1.10      deraadt    60: #block in log all
                     61: #pass  in  on $ext_if proto tcp from any to $ext_if port 22 keep state
                     62: #pass  out on $ext_if proto { tcp, udp } all keep state
1.17      david      63:
                     64: # pass incoming packets destined to the addresses given in table <foo>.
                     65: #pass in on $ext_if proto { tcp, udp } from any to <foo> port 80 keep state
                     66:
                     67: # assign packets to a queue.
                     68: #pass out on $ext_if from 192.168.0.0/24 to any keep state queue developers
                     69: #pass out on $ext_if from 192.168.1.0/24 to any keep state queue marketing