]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/pf.conf
Split the FILES list across multiple lines as in rc.d/Makefile
[FreeBSD/FreeBSD.git] / etc / pf.conf
1 #       $FreeBSD$
2 #       $OpenBSD: pf.conf,v 1.21 2003/09/02 20:38:44 david Exp $
3 #
4 # See pf.conf(5) and /usr/share/examples/pf for syntax and examples.
5 # Required order: options, normalization, queueing, translation, filtering.
6 # Macros and tables may be defined and used anywhere.
7 # Note that translation rules are first match while filter rules are last match.
8
9 # Macros: define common values, so they can be referenced and changed easily.
10 #ext_if="ext0"  # replace with actual external interface name i.e., dc0
11 #int_if="int0"  # replace with actual internal interface name i.e., dc1
12 #internal_net="10.1.1.1/8"
13 #external_addr="192.168.1.1"
14
15 # Tables: similar to macros, but more flexible for many addresses.
16 #table <foo> { 10.0.0.0/8, !10.1.0.0/16, 192.168.0.0/24, 192.168.1.18 }
17
18 # Options: tune the behavior of pf, default values are given.
19 #set timeout { interval 10, frag 30 }
20 #set timeout { tcp.first 120, tcp.opening 30, tcp.established 86400 }
21 #set timeout { tcp.closing 900, tcp.finwait 45, tcp.closed 90 }
22 #set timeout { udp.first 60, udp.single 30, udp.multiple 60 }
23 #set timeout { icmp.first 20, icmp.error 10 }
24 #set timeout { other.first 60, other.single 30, other.multiple 60 }
25 #set timeout { adaptive.start 0, adaptive.end 0 }
26 #set limit { states 10000, frags 5000 }
27 #set loginterface none
28 #set optimization normal
29 #set block-policy drop
30 #set require-order yes
31 #set fingerprints "/etc/pf.os"
32
33 # Normalization: reassemble fragments and resolve or reduce traffic ambiguities.
34 #scrub in all
35
36 # Queueing: rule-based bandwidth control.
37 #altq on $ext_if bandwidth 2Mb cbq queue { dflt, developers, marketing }
38 #queue dflt bandwidth 5% cbq(default)
39 #queue developers bandwidth 80%
40 #queue marketing  bandwidth 15%
41
42 # Translation: specify how addresses are to be mapped or redirected.
43 # nat: packets going out through $ext_if with source address $internal_net will
44 # get translated as coming from the address of $ext_if, a state is created for
45 # such packets, and incoming packets will be redirected to the internal address.
46 #nat on $ext_if from $internal_net to any -> ($ext_if)
47
48 # rdr: packets coming in on $ext_if with destination $external_addr:1234 will
49 # be redirected to 10.1.1.1:5678. A state is created for such packets, and
50 # outgoing packets will be translated as coming from the external address.
51 #rdr on $ext_if proto tcp from any to $external_addr/32 port 1234 -> 10.1.1.1 port 5678
52
53 # rdr outgoing FTP requests to the ftp-proxy
54 #rdr on $int_if proto tcp from any to any port ftp -> 127.0.0.1 port 8021
55
56 # spamd-setup puts addresses to be redirected into table <spamd>.
57 #table <spamd> persist
58 #no rdr on { lo0, lo1 } from any to any
59 #rdr inet proto tcp from <spamd> to any port smtp -> 127.0.0.1 port 8025
60
61 # Filtering: the implicit first two rules are
62 #pass in all
63 #pass out all
64
65 # block all incoming packets but allow ssh, pass all outgoing tcp and udp
66 # connections and keep state, logging blocked packets.
67 #block in log all
68 #pass  in  on $ext_if proto tcp from any to $ext_if port 22 keep state
69 #pass  out on $ext_if proto { tcp, udp } all keep state
70
71 # pass incoming packets destined to the addresses given in table <foo>.
72 #pass in on $ext_if proto { tcp, udp } from any to <foo> port 80 keep state
73
74 # pass incoming ports for ftp-proxy
75 #pass in on $ext_if inet proto tcp from any to $ext_if port > 49151 keep state
76
77 # Alternate rule to pass incoming ports for ftp-proxy
78 # NOTE: Please see pf.conf(5) BUGS section before using user/group rules.
79 #pass in on $ext_if inet proto tcp from any to $ext_if user proxy keep state
80
81 # assign packets to a queue.
82 #pass out on $ext_if from 192.168.0.0/24 to any keep state queue developers
83 #pass out on $ext_if from 192.168.1.0/24 to any keep state queue marketing