|
Packit Service |
3880ab |
.TH "IFE action in tc" 8 "22 Apr 2016" "iproute2" "Linux"
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH NAME
|
|
Packit Service |
3880ab |
IFE - encapsulate/decapsulate metadata
|
|
Packit Service |
3880ab |
.SH SYNOPSIS
|
|
Packit Service |
3880ab |
.in +8
|
|
Packit Service |
3880ab |
.ti -8
|
|
Packit Service |
3880ab |
.BR tc " ... " " action ife"
|
|
Packit Service |
3880ab |
.IR DIRECTION " [ " ACTION " ] "
|
|
Packit Service |
3880ab |
.RB "[ " dst
|
|
Packit Service |
3880ab |
.IR DMAC " ] "
|
|
Packit Service |
3880ab |
.RB "[ " src
|
|
Packit Service |
3880ab |
.IR SMAC " ] "
|
|
Packit Service |
3880ab |
.RB "[ " type
|
|
Packit Service |
3880ab |
.IR TYPE " ] "
|
|
Packit Service |
3880ab |
.RI "[ "
|
|
Packit Service |
3880ab |
.IR CONTROL " ] "
|
|
Packit Service |
3880ab |
.RB "[ " index
|
|
Packit Service |
3880ab |
.IR INDEX " ] "
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.ti -8
|
|
Packit Service |
3880ab |
.IR DIRECTION " := { "
|
|
Packit Service |
3880ab |
.BR decode " | " encode " }"
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.ti -8
|
|
Packit Service |
3880ab |
.IR ACTION " := { "
|
|
Packit Service |
3880ab |
.BI allow " ATTR"
|
|
Packit Service |
3880ab |
.RB "| " use
|
|
Packit Service |
3880ab |
.IR "ATTR value" " }"
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.ti -8
|
|
Packit Service |
3880ab |
.IR ATTR " := { "
|
|
Packit Service |
3880ab |
.BR mark " | " prio " | " tcindex " }"
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.ti -8
|
|
Packit Service |
3880ab |
.IR CONTROL " := { "
|
|
Packit Service |
3880ab |
.BR reclassify " | " use " | " pipe " | " drop " | " continue " | " ok " | " goto " " chain " " CHAIN_INDEX " }"
|
|
Packit Service |
3880ab |
.SH DESCRIPTION
|
|
Packit Service |
3880ab |
The
|
|
Packit Service |
3880ab |
.B ife
|
|
Packit Service |
3880ab |
action allows for a sending side to encapsulate arbitrary metadata, which is
|
|
Packit Service |
3880ab |
then decapsulated by the receiving end. The sender runs in encoding mode and
|
|
Packit Service |
3880ab |
the receiver in decode mode. Both sender and receiver must specify the same
|
|
Packit Service |
3880ab |
ethertype. In the future, a registered ethertype may be available as a default.
|
|
Packit Service |
3880ab |
.SH OPTIONS
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.B decode
|
|
Packit Service |
3880ab |
For the receiving side; decode the metadata if the packet matches.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.B encode
|
|
Packit Service |
3880ab |
For the sending side. Encode the specified metadata if the packet matches.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.B allow
|
|
Packit Service |
3880ab |
Encode direction only. Allows encoding specified metadata.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.B use
|
|
Packit Service |
3880ab |
Encode direction only. Enforce static encoding of specified metadata.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR mark " [ "
|
|
Packit Service |
3880ab |
.IR u32_value " ]"
|
|
Packit Service |
3880ab |
The value to set for the skb mark. The u32 value is required only when
|
|
Packit Service |
3880ab |
.BR use " is specified. If
|
|
Packit Service |
3880ab |
.BR mark " value is zero, it will not be encoded, instead
|
|
Packit Service |
3880ab |
"overlimits" statistics increment and
|
|
Packit Service |
3880ab |
.BR CONTROL " action is taken.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR prio " [ "
|
|
Packit Service |
3880ab |
.IR u32_value " ]"
|
|
Packit Service |
3880ab |
The value to set for priority in the skb structure. The u32 value is required
|
|
Packit Service |
3880ab |
only when
|
|
Packit Service |
3880ab |
.BR use " is specified."
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR tcindex " ["
|
|
Packit Service |
3880ab |
.IR u16_value " ]"
|
|
Packit Service |
3880ab |
Value to set for the traffic control index in the skb structure. The u16 value
|
|
Packit Service |
3880ab |
is required only when
|
|
Packit Service |
3880ab |
.BR use " is specified."
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BI dmac " DMAC"
|
|
Packit Service |
3880ab |
.TQ
|
|
Packit Service |
3880ab |
.BI smac " SMAC"
|
|
Packit Service |
3880ab |
Optional six byte destination or source MAC address to encode.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BI type " TYPE"
|
|
Packit Service |
3880ab |
Optional 16-bit ethertype to encode. If not specified value of 0xED3E will be used.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BI CONTROL
|
|
Packit Service |
3880ab |
Action to take following an encode/decode.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BI index " INDEX"
|
|
Packit Service |
3880ab |
Assign a unique ID to this action instead of letting the kernel choose one
|
|
Packit Service |
3880ab |
automatically.
|
|
Packit Service |
3880ab |
.I INDEX
|
|
Packit Service |
3880ab |
is a 32bit unsigned integer greater than zero.
|
|
Packit Service |
3880ab |
.SH EXAMPLES
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
On the receiving side, match packets with ethertype 0xdead and restart
|
|
Packit Service |
3880ab |
classification so that it will match ICMP on the next rule, at prio 3:
|
|
Packit Service |
3880ab |
.RS
|
|
Packit Service |
3880ab |
.EX
|
|
Packit Service |
3880ab |
# tc qdisc add dev eth0 handle ffff: ingress
|
|
Packit Service |
3880ab |
# tc filter add dev eth0 parent ffff: prio 2 protocol 0xdead \\
|
|
Packit Service |
3880ab |
u32 match u32 0 0 flowid 1:1 \\
|
|
Packit Service |
3880ab |
action ife decode reclassify
|
|
Packit Service |
3880ab |
# tc filter add dev eth0 parent ffff: prio 3 protocol ip \\
|
|
Packit Service |
3880ab |
u32 match ip protocol 0xff flowid 1:1 \\
|
|
Packit Service |
3880ab |
action continue
|
|
Packit Service |
3880ab |
.EE
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
Match with skb mark of 17:
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.RS
|
|
Packit Service |
3880ab |
.EX
|
|
Packit Service |
3880ab |
# tc filter add dev eth0 parent ffff: prio 4 protocol ip \\
|
|
Packit Service |
3880ab |
handle 0x11 fw flowid 1:1 \\
|
|
Packit Service |
3880ab |
action ok
|
|
Packit Service |
3880ab |
.EE
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
Configure the sending side to encode for the filters above. Use a destination
|
|
Packit Service |
3880ab |
IP address of 192.168.122.237/24, then tag with skb mark of decimal 17. Encode
|
|
Packit Service |
3880ab |
the packaet with ethertype 0xdead, add skb->mark to whitelist of metadatum to
|
|
Packit Service |
3880ab |
send, and rewrite the destination MAC address to 02:15:15:15:15:15.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.RS
|
|
Packit Service |
3880ab |
.EX
|
|
Packit Service |
3880ab |
# tc qdisc add dev eth0 root handle 1: prio
|
|
Packit Service |
3880ab |
# tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \\
|
|
Packit Service |
3880ab |
match ip dst 192.168.122.237/24 \\
|
|
Packit Service |
3880ab |
match ip protocol 1 0xff \\
|
|
Packit Service |
3880ab |
flowid 1:2 \\
|
|
Packit Service |
3880ab |
action skbedit mark 17 \\
|
|
Packit Service |
3880ab |
action ife encode \\
|
|
Packit Service |
3880ab |
type 0xDEAD \\
|
|
Packit Service |
3880ab |
allow mark \\
|
|
Packit Service |
3880ab |
dst 02:15:15:15:15:15
|
|
Packit Service |
3880ab |
.EE
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH SEE ALSO
|
|
Packit Service |
3880ab |
.BR tc (8),
|
|
Packit Service |
3880ab |
.BR tc-u32 (8)
|