1 .TH "IFE action in tc" 8 "22 Apr 2016" "iproute2" "Linux"
4 IFE - encapsulate/decapsulate metadata
8 .BR tc " ... " " action ife"
9 .IR DIRECTION " [ " ACTION " ] "
22 .IR DIRECTION " := { "
23 .BR decode " | " encode " }"
33 .BR mark " | " prio " | " tcindex " }"
37 .BR reclassify " | " use " | " pipe " | " drop " | " continue " | " ok " | " goto " " chain " " CHAIN_INDEX " }"
41 action allows for a sending side to encapsulate arbitrary metadata, which is
42 then decapsulated by the receiving end. The sender runs in encoding mode and
43 the receiver in decode mode. Both sender and receiver must specify the same
44 ethertype. In the future, a registered ethertype may be available as a default.
48 For the receiving side; decode the metadata if the packet matches.
51 For the sending side. Encode the specified metadata if the packet matches.
54 Encode direction only. Allows encoding specified metadata.
57 Encode direction only. Enforce static encoding of specified metadata.
61 The value to set for the skb mark. The u32 value is required only when
62 .BR use " is specified. If
63 .BR mark " value is zero, it will not be encoded, instead
64 "overlimits" statistics increment and
65 .BR CONTROL " action is taken.
69 The value to set for priority in the skb structure. The u32 value is required
71 .BR use " is specified."
75 Value to set for the traffic control index in the skb structure. The u16 value
77 .BR use " is specified."
82 Optional six byte destination or source MAC address to encode.
85 Optional 16-bit ethertype to encode.
88 Action to take following an encode/decode.
91 Assign a unique ID to this action instead of letting the kernel choose one
94 is a 32bit unsigned integer greater than zero.
97 On the receiving side, match packets with ethertype 0xdead and restart
98 classification so that it will match ICMP on the next rule, at prio 3:
101 # tc qdisc add dev eth0 handle ffff: ingress
102 # tc filter add dev eth0 parent ffff: prio 2 protocol 0xdead \\
103 u32 match u32 0 0 flowid 1:1 \\
104 action ife decode reclassify
105 # tc filter add dev eth0 parent ffff: prio 3 protocol ip \\
106 u32 match ip protocol 0xff flowid 1:1 \\
111 Match with skb mark of 17:
115 # tc filter add dev eth0 parent ffff: prio 4 protocol ip \\
116 handle 0x11 fw flowid 1:1 \\
121 Configure the sending side to encode for the filters above. Use a destination
122 IP address of 192.168.122.237/24, then tag with skb mark of decimal 17. Encode
123 the packaet with ethertype 0xdead, add skb->mark to whitelist of metadatum to
124 send, and rewrite the destination MAC address to 02:15:15:15:15:15.
128 # tc qdisc add dev eth0 root handle 1: prio
129 # tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \\
130 match ip dst 192.168.122.237/24 \\
131 match ip protocol 1 0xff \\
133 action skbedit mark 17 \\
137 dst 02:15:15:15:15:15