]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/ipfilter/README
MFC r368207,368607:
[FreeBSD/stable/10.git] / contrib / ipfilter / README
1 IP Filter - What's this about ?
2 ============================
3 Web site: http://coombs.anu.edu.au/~avalon/ip-filter.html
4 How-to: http://www.obfuscation.org/ipf/ipf-howto.txt
5
6   The idea behind this package is allow those who use Unix workstations as
7 routers (a common occurance in Universities it appears) to apply packet
8 filtering to packets going in and out of them.  This package has been
9 tested on all versions of SunOS 4.1 and Solaris 2.4/2.5, running on Sparcs.
10 It is also quite possible for this small kernel extension to be installed
11 and used effectively on Sun workstations which don't route IP, just for
12 added security.  It can also be integrated with the multicast patches.
13 It has also been tested successfully on all of the modern free BSDs as
14 well as BSDI, and SGI's IRIX 6.2.
15
16    The filter keeps a rule list for both inbound and outbound sides of
17 the IP packet queue and a check is made as early as possible, aiming to
18 stop the packet before it even gets as far as being checked for source
19 route options.  In the file "BNF", a set of rules for constructing filter
20 rules understood by this package is given.  The files in the directory
21 "rules", "example.1" ... "example.sr" show example rules you might apply.
22
23    In practise, I've successfully isolated a workstation from all
24 machines except the NFS file servers on its local subnets (yeah, ok, so
25 this doesn't really increase security, because of NFS, but you get the
26 drift on how it can be applied and used).  I've also successfully
27 setup and maintained my own firewalls using it with TIS's Firewall Toolkit,
28 including using it on an mbone router.
29
30    When using it with multicast IP, the calls to fr_check() should be
31 before the packet is unwrapped and after it is encapsulated.  So the
32 filter routines will see the packet as a UDP packet, protocol XYZ.
33 Whether this is better or worse than having it filter on class D addresses
34 is debateable, but the idea behind this package is to be able to
35 discriminate between packets as they are on the 'wire', before they
36 get routed anywhere, etc.
37
38    It is worth noting, that it is possible, using a small MTU and
39 generating tiny fragmented IP packets to generate a TCP packet which
40 doesn't contain enough information to filter on the "flags".  Filtering
41 on these types of packets is possible, but under the more general case
42 of the packets being "short".  ICMP and UDP packets which are too small
43 (they don't contain a complete header) are dropped and logged, no questions
44 asked.  When filtering on fragmented packets, the last fragment will get
45 through for TCP/UDP/ICMP packets.
46
47 Bugs/Problems
48 -------------
49 If you have a problem with IP Filter on your operating system, please email
50 a copy of the file "BugReport" with the details of your setup as required
51 and email to darrenr@pobox.com.
52
53 Some general notes.
54 -------------------
55    To add/delete a rule from memory, access to the device in /dev is needed,
56 allowing non-root maintenaince.  The filter list in kernel memory is built
57 from the kernel's heap.  Each packet coming *in* or *out* is checked against
58 the appropriate list, rejects dropped, others passed through.  Thus this will
59 work on an individual host, not just gateways.  Presently there is only one
60 list for all interfaces, the changes required to make it a per-interface list
61 require more .o replacements for the kernel.  When checking a packet, the
62 packet is compared to the entire list from top to bottom, the last matching
63 line being effective.
64
65
66 What does what ?
67 ----------------
68 if_fil.o  (Loadable kernel module)
69         - additional kernel routines to check an access list as to whether
70           or not to drop or pass a packet.  It currently defaults to pass
71           on all packets.
72
73 ipfstat
74         - digs through your kernel (need to check #define VMUNIX in fils.c)
75           and /dev/kmem for the access filter list and mini stats table.
76           Obviously needs to be run priviledged if required.
77
78 ipf
79         - reads the files passed as parameters as input files containing new
80           filter rules to add/delete to the kernel list.  The lines are
81           inserted in order; the first line is inserted first, and ends up
82           first on the list.  Subsequent invocations append to the list
83           unless specified otherwise.
84
85 ipftest
86         - test the ruleset given by filename.  Reads in the ruleset and then
87           waits for stdin.
88
89           See the man pages (ipf.1, ipftest.1, ipfstat.8) for more detailed
90           information on what the above do.
91
92 mkfilters
93         - suggests a set of filter rules to employ and suggests how to add
94           routes to back these up.
95
96 BNF
97         - BNF rule set for the filter rules
98
99 Darren Reed
100 darrenr@pobox.com
101 http://coombs.anu.edu.au/~avalon/ip-filter.html