131 lines
2.7 KiB
HTML
131 lines
2.7 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Firewall mark classifier in tc</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Firewall mark classifier in tc</H1>
|
|
Section: Linux (8)<BR>Updated: 21 Oct 2015<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<P>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
fw - fwmark traffic control filter
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
<BR>
|
|
|
|
<B>tc</B> <B>filter</B> ... <B>fw</B> [ <B>classid</B>
|
|
|
|
<I>CLASSID</I> ] [
|
|
|
|
<B>action</B>
|
|
|
|
<I>ACTION_SPEC</I> ]
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
the
|
|
<B>fw</B>
|
|
|
|
filter allows to classify packets based on a previously set
|
|
<B>fwmark</B> by <B>iptables</B>.
|
|
|
|
If it is identical to the filter's
|
|
<B>handle</B>,
|
|
|
|
the filter matches.
|
|
<B>iptables</B>
|
|
|
|
allows to mark single packets with the
|
|
<B>MARK</B>
|
|
|
|
target, or whole connections using
|
|
<B>CONNMARK</B>.
|
|
|
|
The benefit of using this filter instead of doing the
|
|
heavy-lifting with
|
|
<B>tc</B>
|
|
|
|
itself is that on one hand it might be convenient to keep packet filtering and
|
|
classification in one place, possibly having to match a packet just once, and on
|
|
the other users familiar with
|
|
<B>iptables</B> but not <B>tc</B>
|
|
|
|
will have a less hard time adding QoS to their setups.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>classid</B><I> CLASSID</I>
|
|
|
|
<DD>
|
|
Push matching packets to the class identified by
|
|
<I>CLASSID</I>.
|
|
|
|
<DT id="2"><B>action</B><I> ACTION_SPEC</I>
|
|
|
|
<DD>
|
|
Apply an action from the generic actions framework on matching packets.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
Take e.g. the following tc filter statement:
|
|
<P>
|
|
<DL COMPACT><DT id="3"><DD>
|
|
|
|
tc filter add ... handle 6 fw classid 1:1
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
will match if the packet's
|
|
<B>fwmark</B>
|
|
|
|
value is
|
|
<B>6</B>.
|
|
|
|
This is a sample
|
|
<B>iptables</B>
|
|
|
|
statement marking packets coming in on eth0:
|
|
<P>
|
|
<DL COMPACT><DT id="4"><DD>
|
|
|
|
iptables -t mangle -A PREROUTING -i eth0 -j MARK --set-mark 6
|
|
|
|
</DL>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc">tc</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+iptables">iptables</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+iptables-extensions">iptables-extensions</A></B>(8)
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="5"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="6"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="7"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="8"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="9"><A HREF="#lbAF">EXAMPLES</A><DD>
|
|
<DT id="10"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:17 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|