forked from extern/shorewall_code
fixed quotes, add CVS Id
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@990 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
0152a59fc8
commit
9feb0d8e1d
@ -2,6 +2,8 @@
|
||||
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
<article>
|
||||
<!--$Id$-->
|
||||
|
||||
<articleinfo>
|
||||
<title>Shorewall Traffic Accounting</title>
|
||||
|
||||
@ -26,8 +28,8 @@
|
||||
document under the terms of the GNU Free Documentation License, Version
|
||||
1.2 or any later version published by the Free Software Foundation; with
|
||||
no Invariant Sections, with no Front-Cover, and with no Back-Cover
|
||||
Texts. A copy of the license is included in the section entitled "<ulink
|
||||
url="GnuCopyright.htm">GNU Free Documentation License</ulink>".</para>
|
||||
Texts. A copy of the license is included in the section entitled
|
||||
<quote><ulink url="GnuCopyright.htm">GNU Free Documentation License</ulink></quote>.</para>
|
||||
</legalnotice>
|
||||
</articleinfo>
|
||||
|
||||
@ -36,13 +38,14 @@
|
||||
|
||||
<para>Shorewall accounting rules are described in the file
|
||||
/etc/shorewall/accounting. By default, the accounting rules are placed in a
|
||||
chain called "accounting" and can thus be displayed using
|
||||
"shorewall show accounting". All traffic passing into, out of or
|
||||
through the firewall traverses the accounting chain including traffic that
|
||||
will later be rejected by interface options such as "tcpflags" and
|
||||
"maclist". If your kernel doesn't support the connection
|
||||
tracking match extension (Kernel 2.4.21) then some traffic rejected under
|
||||
'norfc1918' will not traverse the accounting chain.</para>
|
||||
chain called <quote>accounting</quote> and can thus be displayed using
|
||||
<quote>shorewall show accounting</quote>. All traffic passing into, out of
|
||||
or through the firewall traverses the accounting chain including traffic
|
||||
that will later be rejected by interface options such as <quote>tcpflags</quote>
|
||||
and <quote>maclist</quote>. If your kernel doesn't support the
|
||||
connection tracking match extension (Kernel 2.4.21) then some traffic
|
||||
rejected under <quote>norfc1918</quote> will not traverse the accounting
|
||||
chain.</para>
|
||||
|
||||
<para>The columns in the accounting file are as follows:</para>
|
||||
|
||||
@ -54,75 +57,75 @@
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>COUNT- Simply count the match and continue trying to match the
|
||||
packet with the following accounting rules </para>
|
||||
packet with the following accounting rules</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>DONE- Count the match and don't attempt to match any
|
||||
following accounting rules. </para>
|
||||
following accounting rules.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis><chain></emphasis> - The name of a chain to
|
||||
jump to. Shorewall will create the chain automatically. If the name
|
||||
of the chain is followed by ":COUNT" then a COUNT rule
|
||||
of the chain is followed by <quote>:COUNT</quote> then a COUNT rule
|
||||
matching this rule will automatically be added to <chain>.
|
||||
Chain names must start with a letter, must be composed of letters
|
||||
and digits, and may contain underscores ("_") and periods
|
||||
("."). Beginning with Shorewall version 1.4.8, chain names
|
||||
man also contain embedded dashes ("-") and are not required
|
||||
to start with a letter.</para>
|
||||
and digits, and may contain underscores (<quote>_</quote>) and
|
||||
periods (<quote>.</quote>). Beginning with Shorewall version 1.4.8,
|
||||
chain names man also contain embedded dashes (<quote>-</quote>) and
|
||||
are not required to start with a letter.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="bold">CHAIN</emphasis> - The name of the chain
|
||||
where the accounting rule is to be added. If empty or "-" then
|
||||
the "accounting" chain is assumed.</para>
|
||||
where the accounting rule is to be added. If empty or <quote>-</quote>
|
||||
then the <quote>accounting</quote> chain is assumed.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="bold">SOURCE</emphasis> - Packet Source. The name
|
||||
of an interface, an address (host or net) or an interface name followed
|
||||
by ":" and a host or net address.</para>
|
||||
by <quote>:</quote> and a host or net address.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="bold">DESTINATION</emphasis> - Packet Destination
|
||||
Format the same as the SOURCE column. </para>
|
||||
Format the same as the SOURCE column.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="bold">PROTOCOL</emphasis> - A protocol name (from
|
||||
/etc/protocols) or a protocol number. </para>
|
||||
/etc/protocols) or a protocol number.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="bold">DEST PORT</emphasis> - Destination Port
|
||||
number. Service name from /etc/services or port number. May only be
|
||||
specified if the protocol is TCP or UDP (6 or 17). </para>
|
||||
specified if the protocol is TCP or UDP (6 or 17).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para> <emphasis role="bold">SOURCE PORT</emphasis>- Source Port number.
|
||||
<para><emphasis role="bold">SOURCE PORT</emphasis>- Source Port number.
|
||||
Service name from /etc/services or port number. May only be specified if
|
||||
the protocol is TCP or UDP (6 or 17).</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>In all columns except ACTION and CHAIN, the values
|
||||
"-","any" and "all" are treated as wild-cards.</para>
|
||||
<para>In all columns except ACTION and CHAIN, the values <quote>-</quote>,<quote>any</quote>
|
||||
and <quote>all</quote> are treated as wild-cards.</para>
|
||||
|
||||
<para>The accounting rules are evaluated in the Netfilter 'filter'
|
||||
table. This is the same environment where the 'rules' file rules are
|
||||
evaluated and in this environment, DNAT has already occurred in inbound
|
||||
packets and SNAT has not yet occurred on outbound ones.</para>
|
||||
<para>The accounting rules are evaluated in the Netfilter <quote>filter</quote>
|
||||
table. This is the same environment where the <quote>rules</quote> file
|
||||
rules are evaluated and in this environment, DNAT has already occurred in
|
||||
inbound packets and SNAT has not yet occurred on outbound ones.</para>
|
||||
|
||||
<para>Accounting rules are not stateful -- each rule only handles traffic in
|
||||
one direction. For example, if eth0 is your internet interface and you have
|
||||
a web server in your DMZ connected to eth1 then to count HTTP traffic in
|
||||
both directions requires two rules: </para>
|
||||
both directions requires two rules:</para>
|
||||
|
||||
<programlisting> #ACTION CHAIN SOURCE DESTINATION PROTOCOL DEST SOURCE
|
||||
# PORT PORT
|
||||
@ -140,8 +143,8 @@
|
||||
web:COUNT - eth1 eth0 tcp - 443
|
||||
DONE web</programlisting>
|
||||
|
||||
<para>Now "shorewall show web" will give you a breakdown of your web
|
||||
traffic:</para>
|
||||
<para>Now <quote>shorewall show web</quote> will give you a breakdown of
|
||||
your web traffic:</para>
|
||||
|
||||
<programlisting> [root@gateway shorewall]# shorewall show web
|
||||
Shorewall-1.4.6-20030821 Chain web at gateway.shorewall.net - Wed Aug 20 09:48:56 PDT 2003
|
||||
@ -168,8 +171,8 @@
|
||||
COUNT web eth0 eth1
|
||||
COUNT web eth1 eth0</programlisting>
|
||||
|
||||
<para>Now "shorewall show web" simply gives you a breakdown by input
|
||||
and output:</para>
|
||||
<para>Now <quote>shorewall show web</quote> simply gives you a breakdown by
|
||||
input and output:</para>
|
||||
|
||||
<programlisting> [root@gateway shorewall]# shorewall show accounting web
|
||||
Shorewall-1.4.6-20030821 Chains accounting web at gateway.shorewall.net - Wed Aug 20 10:27:21 PDT 2003
|
||||
|
Loading…
Reference in New Issue
Block a user