aboutsummaryrefslogtreecommitdiff
path: root/sbin/ipfw/ipfw.8
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2004-06-09 20:10:38 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2004-06-09 20:10:38 +0000
commitcd8b5ae0aea22e6eb4f07930341a87e97acf82b0 (patch)
tree75de0420ffeefb842b539c0cbc464d8e78cc60e1 /sbin/ipfw/ipfw.8
parentcf4572847a3a879f3721d702b1b7bc0eef0d45e8 (diff)
downloadsrc-cd8b5ae0aea22e6eb4f07930341a87e97acf82b0.tar.gz
src-cd8b5ae0aea22e6eb4f07930341a87e97acf82b0.zip
Introduce a new feature to IPFW2: lookup tables. These are useful
for handling large sparse address sets. Initial implementation by Vsevolod Lobko <seva@ip.net.ua>, refined by me. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=130281
Diffstat (limited to 'sbin/ipfw/ipfw.8')
-rw-r--r--sbin/ipfw/ipfw.863
1 files changed, 61 insertions, 2 deletions
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index 42656869eeb9..1845c68a9e6f 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -1,7 +1,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 1, 2003
+.Dd June 9, 2004
.Dt IPFW 8
.Os
.Sh NAME
@@ -43,6 +43,15 @@
.Cm set show
.Pp
.Nm
+.Cm table Ar number Cm add Ar addr Ns Oo / Ns Ar masklen Oc Op Ar value
+.Nm
+.Cm table Ar number Cm delete Ar addr Ns Op / Ns Ar masklen
+.Nm
+.Cm table Ar number Cm flush
+.Nm
+.Cm table Ar number Cm list
+.Pp
+.Nm
.Brq Cm pipe | queue
.Ar number
.Cm config
@@ -758,13 +767,26 @@ The second format (
.Em or-block
with multiple addresses) is provided for convenience only and
its use is discouraged.
-.It Ar addr : Oo Cm not Oc Brq Cm any | me | Ar addr-list | Ar addr-set
+.It Ar addr : Oo Cm not Oc Bro
+.Cm any | me |
+.Cm table Ns Pq Ar number Ns Op , Ns Ar value
+.Ar | addr-list | addr-set
+.Brc
.It Cm any
matches any IP address.
.It Cm me
matches any IP address configured on an interface in the system.
The address list is evaluated at the time the packet is
analysed.
+.It Cm table Ns Pq Ar number Ns Op , Ns Ar value
+Matches any IP address for which an entry exists in the lookup table
+.Ar number .
+If an optional 32-bit unsigned
+.Ar value
+is also specified, an entry will match only if it has this value.
+See the
+.Sx LOOKUP TABLES
+section below for more information on lookup tables.
.It Ar addr-list : ip-addr Ns Op Ns , Ns Ar addr-list
.It Ar ip-addr :
A host or subnet address specified in one of the following ways:
@@ -1248,6 +1270,43 @@ the Cisco IOS command:
This option can be used to make anti-spoofing rules to reject all
packets whose source address is unreachable.
.El
+.Sh LOOKUP TABLES
+Lookup tables are useful to handle large sparse address sets,
+typically from a hundred to several thousands of entries.
+There could be 128 different lookup tables, numbered 0 to 127.
+.Pp
+Each entry is represented by an
+.Ar addr Ns Op / Ns Ar masklen
+and will match all addresses with base
+.Ar addr
+(specified as a dotted quad or a hostname)
+and mask width of
+.Ar masklen
+bits.
+If
+.Ar masklen
+is not specified, it defaults to 32.
+When looking up an IP address in a table, the most specific
+entry will match.
+Associated with each entry is a 32-bit unsigned
+.Ar value ,
+which can optionally be checked by a rule matching code.
+When adding an entry, if
+.Ar value
+is not specified, it defaults to 0.
+.Pp
+An entry can be added to a table
+.Pq Cm add ,
+removed from a table
+.Pq Cm delete ,
+a table can be examined
+.Pq Cm list
+or flushed
+.Pq Cm flush .
+.Pp
+Internally, each table is stored in a Radix tree, the same way as
+the routing table (see
+.Xr route 4 ) .
.Sh SETS OF RULES
Each rule belongs to one of 32 different
.Em sets