<!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-dscp">

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

<refnamediv>
<refdescriptor>sanewall-dscp</refdescriptor>
<refname>sanewall-dscp</refname>
<refpurpose>set the DSCP field in the packet header</refpurpose>
</refnamediv>

<refsynopsisdiv>
  <cmdsynopsis>
    <command>dscp</command>
    <group choice="req">
       <arg choice="plain"><replaceable>value</replaceable></arg>
       <arg choice="plain">class <replaceable>classid</replaceable></arg>
    </group>
    <arg choice="plain"><replaceable>chain</replaceable></arg>
    <arg choice="opt"><replaceable>rule-params</replaceable></arg>
  </cmdsynopsis>
</refsynopsisdiv>

<refsect1><title>Description</title>
  <para>
    The <command>dscp</command> helper command sets the DSCP field in
    the header of packets traffic, to allow QoS shaping.
  </para>
  <note><para>
     There is also a <command>dscp</command> parameter
     which allows matching DSCP values within individual rules
     (see <xref linkend="rule-params"/>).
  </para></note>
  <para>
    Set <replaceable>value</replaceable> to a decimal or hexadecimal
    (0xnn) number to set an explicit DSCP value or use <option>class</option>
    <replaceable>classid</replaceable> to use an iptables DiffServ class,
    such as EF, BE, CSxx or AFxx
    (see <userinput>iptables -j DSCP --help</userinput> for more information).
  </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>dscp</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 DSCP field to 32, packets sent by the local machine
dscp 32 OUTPUT

# set DSCP field to 32 (hex 20), packets routed by the local machine
dscp 0x20 FORWARD

# set DSCP to DiffServ class EF, packets routed by the local machine
#              and destined for port TCP/25 of 198.51.100.1
dscp class EF 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>administration tool for IPv4 firewalls: iptables(8)</member>
    <member>show / manipulate routing, devices, policy routing and tunnels: ip(8)</member>
    <member><ulink url="http://www.lartc.org/lartc.html">Linux Advanced Routing &amp; Traffic Control HOWTO</ulink></member>
    <member><xref linkend="rule-params"/></member>
  </simplelist>
</refsect1>

</refentry>
