238 lines
5.7 KiB
HTML
238 lines
5.7 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of IFE action in tc</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>IFE action in tc</H1>
|
|
Section: Linux (8)<BR>Updated: 22 Apr 2016<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>
|
|
|
|
IFE - encapsulate/decapsulate metadata
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
<BR>
|
|
|
|
<B>tc</B> ... <B> action ife</B>
|
|
|
|
<I>DIRECTION</I> [ <I>ACTION</I> ]
|
|
|
|
[ <B>dst</B>
|
|
|
|
<I>DMAC</I> ]
|
|
|
|
[ <B>src</B>
|
|
|
|
<I>SMAC</I> ]
|
|
|
|
[ <B>type</B>
|
|
|
|
<I>TYPE</I> ]
|
|
|
|
[
|
|
|
|
<I>CONTROL</I> ]
|
|
|
|
[ <B>index</B>
|
|
|
|
<I>INDEX</I> ]
|
|
|
|
<P>
|
|
<BR>
|
|
|
|
<I>DIRECTION</I> := {
|
|
|
|
<B>decode</B> | <B>encode</B> }
|
|
|
|
<P>
|
|
<BR>
|
|
|
|
<I>ACTION</I> := {
|
|
|
|
<B>allow</B><I> ATTR</I>
|
|
|
|
| <B>use</B>
|
|
|
|
<I>ATTR value</I> }
|
|
|
|
<P>
|
|
<BR>
|
|
|
|
<I>ATTR</I> := {
|
|
|
|
<B>mark</B> | <B>prio</B> | <B>tcindex</B> }
|
|
|
|
<P>
|
|
<BR>
|
|
|
|
<I>CONTROL</I> := {
|
|
|
|
<B>reclassify</B> | <B>use</B> | <B>pipe</B> | <B>drop</B> | <B>continue</B> | <B>ok</B> | <B>goto</B> <B>chain</B> <B>CHAIN_INDEX</B> }
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>ife</B>
|
|
|
|
action allows for a sending side to encapsulate arbitrary metadata, which is
|
|
then decapsulated by the receiving end. The sender runs in encoding mode and
|
|
the receiver in decode mode. Both sender and receiver must specify the same
|
|
ethertype. In the future, a registered ethertype may be available as a default.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>decode</B>
|
|
|
|
<DD>
|
|
For the receiving side; decode the metadata if the packet matches.
|
|
<DT id="2"><B>encode</B>
|
|
|
|
<DD>
|
|
For the sending side. Encode the specified metadata if the packet matches.
|
|
<DT id="3"><B>allow</B>
|
|
|
|
<DD>
|
|
Encode direction only. Allows encoding specified metadata.
|
|
<DT id="4"><B>use</B>
|
|
|
|
<DD>
|
|
Encode direction only. Enforce static encoding of specified metadata.
|
|
<DT id="5"><B>mark</B> [
|
|
|
|
<DD>
|
|
<I>u32_value</I> ]
|
|
|
|
The value to set for the skb mark. The u32 value is required only when
|
|
<B>use</B> is specified. If
|
|
|
|
<B>mark</B> value is zero, it will not be encoded, instead
|
|
|
|
"overlimits" statistics increment and
|
|
<B>CONTROL</B> action is taken.
|
|
|
|
<DT id="6"><B>prio</B> [
|
|
|
|
<DD>
|
|
<I>u32_value</I> ]
|
|
|
|
The value to set for priority in the skb structure. The u32 value is required
|
|
only when
|
|
<B>use</B> is specified.
|
|
|
|
<DT id="7"><B>tcindex</B> [
|
|
|
|
<DD>
|
|
<I>u16_value</I> ]
|
|
|
|
Value to set for the traffic control index in the skb structure. The u16 value
|
|
is required only when
|
|
<B>use</B> is specified.
|
|
|
|
<DT id="8"><B>dmac</B><I> DMAC</I>
|
|
|
|
<DD>
|
|
|
|
<B>smac</B><I> SMAC</I>
|
|
|
|
Optional six byte destination or source MAC address to encode.
|
|
<DT id="9"><B>type</B><I> TYPE</I>
|
|
|
|
<DD>
|
|
Optional 16-bit ethertype to encode. If not specified value of 0xED3E will be used.
|
|
<DT id="10"><B>CONTROL</B>
|
|
|
|
<DD>
|
|
Action to take following an encode/decode.
|
|
<DT id="11"><B>index</B><I> INDEX</I>
|
|
|
|
<DD>
|
|
Assign a unique ID to this action instead of letting the kernel choose one
|
|
automatically.
|
|
<I>INDEX</I>
|
|
|
|
is a 32bit unsigned integer greater than zero.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
<P>
|
|
On the receiving side, match packets with ethertype 0xdead and restart
|
|
classification so that it will match ICMP on the next rule, at prio 3:
|
|
<DL COMPACT><DT id="12"><DD>
|
|
|
|
# tc qdisc add dev eth0 handle ffff: ingress
|
|
# tc filter add dev eth0 parent ffff: prio 2 protocol 0xdead \
|
|
<TT> </TT>u32 match u32 0 0 flowid 1:1 \<BR>
|
|
<TT> </TT>action ife decode reclassify<BR>
|
|
# tc filter add dev eth0 parent ffff: prio 3 protocol ip \
|
|
<TT> </TT>u32 match ip protocol 0xff flowid 1:1 \<BR>
|
|
<TT> </TT>action continue<BR>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
Match with skb mark of 17:
|
|
<P>
|
|
<DL COMPACT><DT id="13"><DD>
|
|
|
|
# tc filter add dev eth0 parent ffff: prio 4 protocol ip \
|
|
<TT> </TT>handle 0x11 fw flowid 1:1 \<BR>
|
|
<TT> </TT>action ok<BR>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
Configure the sending side to encode for the filters above. Use a destination
|
|
IP address of 192.168.122.237/24, then tag with skb mark of decimal 17. Encode
|
|
the packaet with ethertype 0xdead, add skb->mark to whitelist of metadatum to
|
|
send, and rewrite the destination MAC address to 02:15:15:15:15:15.
|
|
<P>
|
|
<DL COMPACT><DT id="14"><DD>
|
|
|
|
# tc qdisc add dev eth0 root handle 1: prio
|
|
# tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \
|
|
<TT> </TT>match ip dst 192.168.122.237/24 \<BR>
|
|
<TT> </TT>match ip protocol 1 0xff \<BR>
|
|
<TT> </TT>flowid 1:2 \<BR>
|
|
<TT> </TT>action skbedit mark 17 \<BR>
|
|
<TT> </TT>action ife encode \<BR>
|
|
<TT> </TT>type 0xDEAD \<BR>
|
|
<TT> </TT>allow mark \<BR>
|
|
<TT> </TT>dst 02:15:15:15:15:15<BR>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
<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+tc-u32">tc-u32</A></B>(8)
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="15"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="16"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="17"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="18"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="19"><A HREF="#lbAF">EXAMPLES</A><DD>
|
|
<DT id="20"><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>
|