<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
                 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<!-- For license information see sanewall-manual-info.xml.in -->
<refentry id="helpconf-tos">

<refmeta>
<refentrytitle>tos config helper: sanewall-tos</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>

<refnamediv>
<refdescriptor>sanewall-tos</refdescriptor>
<refname>sanewall-tos</refname>
<refpurpose>set the Type of Service (TOS) of packets</refpurpose>
</refnamediv>

<refsynopsisdiv>
  <cmdsynopsis>
    <command>tos</command>
    <arg choice="plain"><replaceable>value</replaceable></arg>
    <arg choice="plain"><replaceable>chain</replaceable></arg>
    <arg choice="opt"><replaceable>rule-params</replaceable></arg>
  </cmdsynopsis>
</refsynopsisdiv>

<refsect1><title>Description</title>
  <para>
    The <command>tos</command> helper command sets the
    Type of Service (TOS) field in packet headers.
  </para>
  <note><para>
     There is also a <command>tos</command> parameter
     which allows matching TOS values within individual rules
     (see <xref linkend="rule-params"/>).
  </para></note>
  <para>
    The <replaceable>value</replaceable> can be an integer number (decimal
    or hexadecimal) or one of the descriptive values accepted by
    <command>iptables</command> (run
    <userinput>iptables -j TOS --help</userinput> for a list).
  </para>
  <para>
    The <replaceable>chain</replaceable> will be used to find traffic to
    mark. It can be any of the <command>iptables</command> built in chains
    belonging to the <option>mangle</option> table. The chain names
    are: INPUT, FORWARD, OUTPUT, PREROUTING and POSTROUTING. The names are
    case-sensitive.
  </para>
  <para>
    The <option><replaceable>rule-params</replaceable></option> define
    a set of rule parameters to match the traffic that is to be marked
    within the chosen chain.
    See <xref linkend="rule-params"/> for more details.
  </para>
  <para>
    Any <command>tos</command> commands will affect all traffic
    matched. They must be declared before the first router or interface.
  </para>
</refsect1>

<refsect1><title>Examples</title>
    <programlisting>
# set TOS to 16, packets sent by the local machine
tos 16 OUTPUT

# set TOS to 0x10 (16), packets routed by the local machine
tos 0x10 FORWARD

# set TOS to Maximize-Throughput (8), packets routed by the local
#              machine, destined for port TCP/25 of 198.51.100.1
tos Maximize-Throughput FORWARD proto tcp dport 25 dst 198.51.100.1
    </programlisting>
</refsect1>

<refsect1><title>See Also</title>
  <simplelist type="vert">
    <member><xref linkend="sanewall"/></member>
    <member><xref linkend="sanewall.conf"/></member>
    <member><xref linkend="helpconf-tosfix"/></member>
    <member>administration tool for IPv4 firewalls: iptables(8)</member>
    <member><xref linkend="rule-params"/></member>
  </simplelist>
</refsect1>

</refentry>
