Initial import from FreeBSD RELENG_4:
[dragonfly.git] / share / examples / ipfilter / ipf.conf.restrictive
1 # $FreeBSD: src/share/examples/ipfilter/ipf.conf.restrictive,v 1.1.2.1 2002/04/27 20:04:18 darrenr Exp $
2 #--------------------------------------------------------------------------
3 # ed1 - external interface
4 # fxp0 - internal interface
5 #--------------------------------------------------------------------------
6 # First, nasty packets which we don't want near us at all
7 # packets which are too short to be real except echo replies on lo0
8 pass in log quick on lo0 proto icmp from 127.0.0.1/8 to 127.0.0.1/8 with short
9 block in log quick all with short
10 block in log quick all with opt lsrr
11 block in log quick all with opt ssrr
12 #--------------------------------------------------------------------------
13 # loopback packets left unmolested
14 pass in log quick on lo0 all
15 pass out log quick on lo0 all
16 #--------------------------------------------------------------------------
17 # Group setup:
18 # 100 incoming ed1
19 # 150 outgoing ed1
20 # 200 incoming fxp0
21 # 250 outgoing fxp0
22 #--------------------------------------------------------------------------
23 block in log body on ed1 all head 100
24 block out log body on ed1 all head 150
25 #--------------------------------------------------------------------------
26 block in log on fxp0 all head 200
27 block out log on fxp0 all head 250
28 #--------------------------------------------------------------------------
29 # incoming ed1 traffic - group 100
30 # 1) prevent localhost spoofing
31 block in log quick from 127.0.0.1/32 to 192.168.0.0/24 group 100
32 block in log quick from 127.0.0.1/32 to 192.168.1.0/24 group 100
33 block in log quick from any to 127.0.0.1/8 group 100
34 #--------------------------------------------------------------------------
35 # 2) deny pakets which should not be seen on th internet (paranoid)
36 block in log quick from 10.0.0.0/8 to any group 100
37 block in log quick from any to 10.0.0.0/8 group 100
38 block in log quick from 172.16.0.0/16 to any group 100
39 block in log quick from any to 172.16.0.0/16 group 100
40 block in log quick from 192.168.0.0/16 to any group 100
41 block in log from any to 192.168.0.0/16 group 100
42 # 3) implement policy
43 # allow incoming ftp-data
44 pass in log quick proto tcp/udp from any to 192.168.1.1/24 keep state group 100
45 # if nothing applies, block and return icmp-replies (unreachable and rst)
46 block return-icmp(net-unr) in proto udp from any to any group 100
47 block return-rst in log proto tcp from any to any group 100
48 #--------------------------------------------------------------------------
49 # outgoing ed1 traffic - group 150
50 # Setup outgoing DNS
51 pass out log quick proto tcp/udp from any to 212.40.0.10 port = 53 keep state group 150
52 pass out log quick proto tcp/udp from any to 212.40.5.50 port = 53 keep state group 150
53 # allow outgoing http-service
54 pass out log quick proto tcp from any to any port = 80 flags S/SA keep state keep frags group 150
55 # allow outgoing smtp traffic
56 pass out log quick proto tcp from 192.168.1.1/24 to any port = 25 flags S/SA keep state group 150
57 # allow outgoing pop3 traffic
58 pass out log quick proto tcp from 192.168.1.1/24 to any port = 110 flags S/SA keep state group 150
59 # allow outgoing ftp traffic
60 pass out log quick proto tcp/udp from 192.168.1.1/24 to any port = ftp keep state group 150
61 pass out log quick proto icmp from any to any keep state keep frags group 150
62 #--------------------------------------------------------------------------
63 # incoming traffic on fxp0 - group 200
64 #--------------------------------------------------------------------------
65 # 1) prevent localhost spoofing
66 block in log quick from 127.0.0.0/8 to any group 200
67 block in log quick from 192.168.0.1/32 to any group 200
68 block in log quick from 192.168.1.110/24 to any group 200
69 pass in log quick from any to any group 200
70 #--------------------------------------------------------------------------
71 # outgoing traffic on fxp0 - group 250
72 #--------------------------------------------------------------------------
73 block out log quick from 127.0.0.0/8 to any group 250
74 block out quick from any to 127.0.0.0/8 group 250
75 block out log quick from any to 192.168.0.1/32 group 250
76 pass out log quick from any to nay group 250
77 #--------------------------------------------------------------------------