freebsd kernel with SKQ
Go to file
Cy Schubert 05ddbb8d93 Import IP-Filter 5.1.2 into vendor branches using the existing license that
the current version of IP-Filter in FreeBSD is under as per email received
from Darren Reed on Mon, 08 Jul 2013 23:54:16 +1000.

Approved by:	glebius (Mentor), Darren Reed <darrenr@reed.wattle.id.au>
2013-08-11 14:28:45 +00:00
4bsd Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
AIX Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
BSD Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
BSDOS Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
BSDOS3 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
BSDOS4 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
etc Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
FreeBSD Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
FreeBSD-2.2 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
FreeBSD-3 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
FreeBSD-4.0 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
FWTK Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
HPUX Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
iplang Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ipsd Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ipsend Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
IRIX Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
l4check Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
lib Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
Linux Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
man Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
NetBSD Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
NetBSD-1.2 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
OpenBSD Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
OpenBSD-2 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
OpenBSD-3 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
OSF Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
perl Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
rules Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
samples Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
SunOS4 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
SunOS5 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
sys Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
test Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
tools Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
.cvsignore Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
arc4random.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
BNF Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
bsdinstall As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
BugReport As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
buildsunos Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
COMPILE.2.5 As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
COMPILE.Solaris2 As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
FAQ.FreeBSD Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
fil.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
HISTORY Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
hpux.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
IMPORTANT As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
INST.FreeBSD-2.2 As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
INSTALL.BSDOS As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
INSTALL.BSDOS3 As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
INSTALL.FreeBSD Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
INSTALL.IRIX Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
INSTALL.Linux Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
INSTALL.NetBSD As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
INSTALL.Sol2 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
INSTALL.SunOS As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
INSTALL.Tru64 Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
INSTALL.xBSD As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
ip_auth.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_auth.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_compat.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_dns_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_dstlist.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_dstlist.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_aix.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_compat.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_freebsd.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_hpux.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_irix.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_linux.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_netbsd.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_openbsd.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_osf.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_solaris.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil_sunos4.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_fil.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_frag.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_frag.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_ftp_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_htable.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_htable.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_ipsec_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_irc_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_log.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_lookup.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_lookup.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_nat6.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_nat.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_nat.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_netbios_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_pool.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_pool.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_pptp_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_proxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_proxy.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_raudio_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_rcmd_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_rpcb_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_scan.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_scan.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_state.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_state.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_sync.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_sync.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ip_tftp_pxy.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ipf_rb.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ipf.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
IPF.KANJI As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
IPFILTER.LICENCE As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
ipl.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ipmon.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ipt.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
kmem.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
LICENCE As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
linux.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
linux.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
Makefile Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
md5.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
md5.h As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
mkfilters Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
ml_ipl.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mlf_ipl.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mlf_rule.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mlfk_ipl.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mlfk_rule.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mlh_rule.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mli_ipl.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mln_ipl.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mln_rule.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mlo_ipl.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mlo_rule.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mls_ipl.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mls_rule.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
mlso_rule.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
NAT.FreeBSD Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
opts.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
pcap-ipf.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
radix_ipf.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
radix_ipf.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
README As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
snoop.h Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
solaris.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
STYLE.TXT As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
todo Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
tru64.c Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
WhatsNew40.txt As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00
WhatsNew50.txt Import IP-Filter 5.1.2 into vendor branches using the existing license that 2013-08-11 14:28:45 +00:00
Y2K As per the developers handbook (5.3.1 step 1), prepare the vendor trees for 2013-07-19 05:41:57 +00:00

IP Filter - What's this about ?
============================
Web site: http://coombs.anu.edu.au/~avalon/ip-filter.html
How-to: http://www.obfuscation.org/ipf/ipf-howto.txt

  The idea behind this package is allow those who use Unix workstations as
routers (a common occurance in Universities it appears) to apply packet
filtering to packets going in and out of them.  This package has been
tested on all versions of SunOS 4.1 and Solaris 2.4/2.5, running on Sparcs.
It is also quite possible for this small kernel extension to be installed
and used effectively on Sun workstations which don't route IP, just for
added security.  It can also be integrated with the multicast patches.
It has also been tested successfully on all of the modern free BSDs as
well as BSDI, and SGI's IRIX 6.2.

   The filter keeps a rule list for both inbound and outbound sides of
the IP packet queue and a check is made as early as possible, aiming to
stop the packet before it even gets as far as being checked for source
route options.  In the file "BNF", a set of rules for constructing filter
rules understood by this package is given.  The files in the directory
"rules", "example.1" ... "example.sr" show example rules you might apply.

   In practise, I've successfully isolated a workstation from all
machines except the NFS file servers on its local subnets (yeah, ok, so
this doesn't really increase security, because of NFS, but you get the
drift on how it can be applied and used).  I've also successfully
setup and maintained my own firewalls using it with TIS's Firewall Toolkit,
including using it on an mbone router.

   When using it with multicast IP, the calls to fr_check() should be
before the packet is unwrapped and after it is encapsulated.  So the
filter routines will see the packet as a UDP packet, protocol XYZ.
Whether this is better or worse than having it filter on class D addresses
is debateable, but the idea behind this package is to be able to
discriminate between packets as they are on the 'wire', before they
get routed anywhere, etc.

   It is worth noting, that it is possible, using a small MTU and
generating tiny fragmented IP packets to generate a TCP packet which
doesn't contain enough information to filter on the "flags".  Filtering
on these types of packets is possible, but under the more general case
of the packets being "short".  ICMP and UDP packets which are too small
(they don't contain a complete header) are dropped and logged, no questions
asked.  When filtering on fragmented packets, the last fragment will get
through for TCP/UDP/ICMP packets.

Bugs/Problems
-------------
If you have a problem with IP Filter on your operating system, please email
a copy of the file "BugReport" with the details of your setup as required
and email to darrenr@pobox.com.

Some general notes.
-------------------
   To add/delete a rule from memory, access to the device in /dev is needed,
allowing non-root maintenaince.  The filter list in kernel memory is built
from the kernel's heap.  Each packet coming *in* or *out* is checked against
the appropriate list, rejects dropped, others passed through.  Thus this will
work on an individual host, not just gateways.  Presently there is only one
list for all interfaces, the changes required to make it a per-interface list
require more .o replacements for the kernel.  When checking a packet, the
packet is compared to the entire list from top to bottom, the last matching
line being effective.


What does what ?
----------------
if_fil.o  (Loadable kernel module)
	- additional kernel routines to check an access list as to whether
	  or not to drop or pass a packet.  It currently defaults to pass
	  on all packets.

ipfstat
	- digs through your kernel (need to check #define VMUNIX in fils.c)
	  and /dev/kmem for the access filter list and mini stats table.
	  Obviously needs to be run priviledged if required.

ipf
	- reads the files passed as parameters as input files containing new
	  filter rules to add/delete to the kernel list.  The lines are
	  inserted in order; the first line is inserted first, and ends up
	  first on the list.  Subsequent invocations append to the list
	  unless specified otherwise.

ipftest
	- test the ruleset given by filename.  Reads in the ruleset and then
	  waits for stdin.

	  See the man pages (ipf.1, ipftest.1, ipfstat.8) for more detailed
	  information on what the above do.

mkfilters
	- suggests a set of filter rules to employ and suggests how to add
	  routes to back these up.

BNF
	- BNF rule set for the filter rules

Darren Reed
darrenr@pobox.com
http://coombs.anu.edu.au/~avalon/ip-filter.html