kernel - Add kabylake NIC PCI IDs
[dragonfly.git] / share / examples / pf / faq-example1
blob7fc8bda996ab30cae0fcdbc250d6bf932ea6812c
1 # $OpenBSD: faq-example1,v 1.3 2005/07/02 16:16:39 joel Exp $
2 # $DragonFly: src/share/examples/pf/faq-example1,v 1.1 2005/12/13 01:58:27 corecode Exp $
5 # Firewall for Home or Small Office
6 # http://www.openbsd.org/faq/pf/example1.html
10 # macros
11 int_if = "fxp0"
12 ext_if = "ep0"
14 tcp_services = "{ 22, 113 }"
15 icmp_types = "echoreq"
17 priv_nets = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"
19 comp3 = "192.168.0.3"
21 # options
22 set block-policy return
23 set loginterface $ext_if
25 # scrub
26 scrub in all
28 # nat/rdr
29 nat on $ext_if from $int_if:network to any -> ($ext_if)
30 rdr on $int_if proto tcp from any to any port 21 -> 127.0.0.1 \
31    port 8021
32 rdr on $ext_if proto tcp from any to any port 80 -> $comp3
34 # filter rules
35 block all
37 pass quick on lo0 all
39 block drop in  quick on $ext_if from $priv_nets to any
40 block drop out quick on $ext_if from any to $priv_nets
42 pass in on $ext_if inet proto tcp from any to ($ext_if) \
43    port $tcp_services flags S/SA keep state
45 pass in on $ext_if proto tcp from any to $comp3 port 80 \
46    flags S/SA synproxy state
48 pass in on $ext_if inet proto tcp from port 20 to ($ext_if) \
49    user proxy flags S/SA keep state
51 pass in inet proto icmp all icmp-type $icmp_types keep state
53 pass in  on $int_if from $int_if:network to any keep state
54 pass out on $int_if from any to $int_if:network keep state
56 pass out on $ext_if proto tcp all modulate state flags S/SA
57 pass out on $ext_if proto { udp, icmp } all keep state