man-pages/man8/tc-matchall.8.html
2021-03-31 01:06:50 +01:00

150 lines
3.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Match-all classifier in tc</TITLE>
</HEAD><BODY>
<H1>Match-all 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">&nbsp;</A>
<H2>NAME</H2>
matchall - traffic control filter that matches every packet
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<BR>
<B>tc</B> <B>filter</B> ... <B>matchall</B> [
<B>skip_sw</B> | <B>skip_hw</B>
] [
<B>action</B>
<I>ACTION_SPEC</I> ] [
<B>classid</B>
<I>CLASSID</I> ]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The
<B>matchall</B>
filter allows to classify every packet that flows on the port and run a
action on it.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>action</B><I> ACTION_SPEC</I>
<DD>
Apply an action from the generic actions framework on matching packets.
<DT id="2"><B>classid</B><I> CLASSID</I>
<DD>
Push matching packets into the class identified by
<I>CLASSID</I>.
<DT id="3"><B>skip_sw</B>
<DD>
Do not process filter by software. If hardware has no offload support for this
filter, or TC offload is not enabled for the interface, operation will fail.
<DT id="4"><B>skip_hw</B>
<DD>
Do not process filter by hardware.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>EXAMPLES</H2>
To create ingress mirroring from port eth1 to port eth2:
<DL COMPACT><DT id="5"><DD>
<P>
tc qdisc add dev eth1 handle ffff: ingress
tc filter add dev eth1 parent ffff: \
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matchall&nbsp;skip_sw&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action&nbsp;mirred&nbsp;egress&nbsp;mirror&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dev&nbsp;eth2
</DL>
<P>
The first command creats an ingress qdisc with handle
<B>ffff:</B>
on device
<B>eth1</B>
where the second command attaches a matchall filters on it that mirrors the
packets to device eth2.
<P>
To create egress mirroring from port eth1 to port eth2:
<DL COMPACT><DT id="6"><DD>
<P>
tc qdisc add dev eth1 handle 1: root prio
tc filter add dev eth1 parent 1: \
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matchall&nbsp;skip_sw&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action&nbsp;mirred&nbsp;egress&nbsp;mirror&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dev&nbsp;eth2
</DL>
<P>
The first command creats an egress qdisc with handle
<B>1:</B>
that replaces the root qdisc on device
<B>eth1</B>
where the second command attaches a matchall filters on it that mirrors the
packets to device eth2.
<P>
To sample one of every 100 packets flowing into interface eth0 to psample group
12:
<DL COMPACT><DT id="7"><DD>
<P>
tc qdisc add dev eth0 handle ffff: ingress
tc filter add dev eth0 parent ffff: matchall \
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action&nbsp;sample&nbsp;rate&nbsp;100&nbsp;group&nbsp;12
</DL>
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?8+tc">tc</A></B>(8),
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="8"><A HREF="#lbAB">NAME</A><DD>
<DT id="9"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="10"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="11"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="12"><A HREF="#lbAF">EXAMPLES</A><DD>
<DT id="13"><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>