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