]> git.proxmox.com Git - mirror_iproute2.git/blob - man/man8/tc-vlan.8
ip-xfrm: Add support for OUTPUT_MARK
[mirror_iproute2.git] / man / man8 / tc-vlan.8
1 .TH "VLAN manipulation action in tc" 8 "12 Jan 2015" "iproute2" "Linux"
2
3 .SH NAME
4 vlan - vlan manipulation module
5 .SH SYNOPSIS
6 .in +8
7 .ti -8
8 .BR tc " ... " "action vlan" " { " pop " |"
9 .IR PUSH " | " MODIFY " } [ " CONTROL " ]"
10
11 .ti -8
12 .IR PUSH " := "
13 .BR push " [ " protocol
14 .IR VLANPROTO " ]"
15 .BR " [ " priority
16 .IR VLANPRIO " ] "
17 .BI id " VLANID"
18
19 .ti -8
20 .IR MODIFY " := "
21 .BR modify " [ " protocol
22 .IR VLANPROTO " ]"
23 .BR " [ " priority
24 .IR VLANPRIO " ] "
25 .BI id " VLANID"
26
27 .ti -8
28 .IR CONTROL " := { "
29 .BR reclassify " | " pipe " | " drop " | " continue " | " pass " | " goto " " chain " " CHAIN_INDEX " }"
30 .SH DESCRIPTION
31 The
32 .B vlan
33 action allows to perform 802.1Q en- or decapsulation on a packet, reflected by
34 the operation modes
35 .IR POP ", " PUSH " and " MODIFY .
36 The
37 .I POP
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
42 .I VLANID
43 and allow to optionally choose the
44 .I VLANPROTO
45 to use.
46 .SH OPTIONS
47 .TP
48 .B pop
49 Decapsulation mode, no further arguments allowed.
50 .TP
51 .B push
52 Encapsulation mode. Requires at least
53 .B id
54 option.
55 .TP
56 .B modify
57 Replace mode. Existing 802.1Q tag is replaced. Requires at least
58 .B id
59 option.
60 .TP
61 .BI id " VLANID"
62 Specify the VLAN ID to encapsulate into.
63 .I VLANID
64 is an unsigned 16bit integer, the format is detected automatically (e.g. prefix
65 with
66 .RB ' 0x '
67 for hexadecimal interpretation, etc.).
68 .TP
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 .
72 .TP
73 .BI priority " VLANPRIO"
74 Choose the VLAN priority to use. Decimal number in range of 0-7.
75 .TP
76 .I CONTROL
77 How to continue after executing this action.
78 .RS
79 .TP
80 .B reclassify
81 Restarts classification by jumping back to the first filter attached to this
82 action's parent.
83 .TP
84 .B pipe
85 Continue with the next action, this is the default.
86 .TP
87 .B drop
88 Packet will be dropped without running further actions.
89 .TP
90 .B continue
91 Continue classification with next filter in line.
92 .TP
93 .B pass
94 Return to calling qdisc for packet processing. This ends the classification
95 process.
96 .RE
97 .SH EXAMPLES
98 The following example encapsulates incoming ICMP packets on eth0 from 10.0.0.2
99 into VLAN ID 123:
100
101 .RS
102 .EX
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
108 .EE
109 .RE
110
111 Here is an example of the
112 .B pop
113 function: Incoming VLAN packets on eth0 are decapsulated and the classification
114 process then restarted for the plain packet:
115
116 .RS
117 .EX
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
122 .EE
123 .RE
124
125 .SH SEE ALSO
126 .BR tc (8)