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:
mhnoyes 2003-12-28 15:48:01 +00:00
parent 0152a59fc8
commit 9feb0d8e1d

View File

@ -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 &#34;<ulink
url="GnuCopyright.htm">GNU Free Documentation License</ulink>&#34;.</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 &#34;accounting&#34; and can thus be displayed using
&#34;shorewall show accounting&#34;. 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 &#34;tcpflags&#34; and
&#34;maclist&#34;. If your kernel doesn&#39;t support the connection
tracking match extension (Kernel 2.4.21) then some traffic rejected under
&#39;norfc1918&#39; 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&#39;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&#39;t attempt to match any
following accounting rules. </para>
following accounting rules.</para>
</listitem>
<listitem>
<para><emphasis>&#60;chain&#62;</emphasis> - The name of a chain to
jump to. Shorewall will create the chain automatically. If the name
of the chain is followed by &#34;:COUNT&#34; 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 &#60;chain&#62;.
Chain names must start with a letter, must be composed of letters
and digits, and may contain underscores (&#34;_&#34;) and periods
(&#34;.&#34;). Beginning with Shorewall version 1.4.8, chain names
man also contain embedded dashes (&#34;-&#34;) 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 &#34;-&#34; then
the &#34;accounting&#34; 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 &#34;:&#34; 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
&#34;-&#34;,&#34;any&#34; and &#34;all&#34; 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 &#39;filter&#39;
table. This is the same environment where the &#39;rules&#39; 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 &#34;shorewall show web&#34; 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 &#34;shorewall show web&#34; 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