1 .TH "VLAN manipulation action in tc" 8 "12 Jan 2015" "iproute2" "Linux"
4 vlan - vlan manipulation module
8 .BR tc " ... " "action vlan" " { " pop " |"
9 .IR PUSH " | " MODIFY " } [ " CONTROL " ]"
13 .BR push " [ " protocol
21 .BR modify " [ " protocol
29 .BR reclassify " | " pipe " | " drop " | " continue " | " pass " | " goto " " chain " " CHAIN_INDEX " }"
33 action allows to perform 802.1Q en- or decapsulation on a packet, reflected by
35 .IR POP ", " PUSH " and " MODIFY .
38 mode is simple, as no further information is required to just drop the
39 outer-most VLAN encapsulation. The
40 .IR PUSH " and " MODIFY
41 modes require at least a
43 and allow to optionally choose the
49 Decapsulation mode, no further arguments allowed.
52 Encapsulation mode. Requires at least
57 Replace mode. Existing 802.1Q tag is replaced. Requires at least
62 Specify the VLAN ID to encapsulate into.
64 is an unsigned 16bit integer, the format is detected automatically (e.g. prefix
67 for hexadecimal interpretation, etc.).
69 .BI protocol " VLANPROTO"
70 Choose the VLAN protocol to use. At the time of writing, the kernel accepts only
71 .BR 802.1Q " or " 802.1ad .
73 .BI priority " VLANPRIO"
74 Choose the VLAN priority to use. Decimal number in range of 0-7.
77 How to continue after executing this action.
81 Restarts classification by jumping back to the first filter attached to this
85 Continue with the next action, this is the default.
88 Packet will be dropped without running further actions.
91 Continue classification with next filter in line.
94 Return to calling qdisc for packet processing. This ends the classification
98 The following example encapsulates incoming ICMP packets on eth0 from 10.0.0.2
103 #tc qdisc add dev eth0 handle ffff: ingress
104 #tc filter add dev eth0 parent ffff: pref 11 protocol ip \\
105 u32 match ip protocol 1 0xff flowid 1:1 \\
106 match ip src 10.0.0.2 flowid 1:1 \\
107 action vlan push id 123
111 Here is an example of the
113 function: Incoming VLAN packets on eth0 are decapsulated and the classification
114 process then restarted for the plain packet:
118 #tc qdisc add dev eth0 handle ffff: ingress
119 #tc filter add dev $ETH parent ffff: pref 1 protocol 802.1Q \\
120 u32 match u32 0 0 flowid 1:1 \\
121 action vlan pop reclassify