1VLAN manipulation action in tc(8)    Linux   VLAN manipulation action in tc(8)
2
3
4

NAME

6       vlan - vlan manipulation module
7

SYNOPSIS

9       tc ... action vlan { pop | PUSH | MODIFY } [ CONTROL ]
10
11       PUSH := push [ protocol VLANPROTO ]  [ priority VLANPRIO ] id VLANID
12
13       MODIFY  :=  modify  [  protocol  VLANPROTO  ]  [ priority VLANPRIO ] id
14               VLANID
15
16       CONTROL := { reclassify | pipe | drop | continue | pass }
17

DESCRIPTION

19       The vlan action allows to perform 802.1Q  en-  or  decapsulation  on  a
20       packet, reflected by the operation modes POP, PUSH and MODIFY.  The POP
21       mode is simple, as no further information is required to just drop  the
22       outer-most  VLAN  encapsulation.  The  PUSH and MODIFY modes require at
23       least a VLANID and allow to optionally choose the VLANPROTO to use.
24

OPTIONS

26       pop    Decapsulation mode, no further arguments allowed.
27
28       push   Encapsulation mode. Requires at least id option.
29
30       modify Replace mode. Existing 802.1Q tag is replaced. Requires at least
31              id option.
32
33       id VLANID
34              Specify  the VLAN ID to encapsulate into.  VLANID is an unsigned
35              16bit integer, the format is detected automatically (e.g. prefix
36              with '0x' for hexadecimal interpretation, etc.).
37
38       protocol VLANPROTO
39              Choose  the  VLAN  protocol  to use. At the time of writing, the
40              kernel accepts only 802.1Q or 802.1ad.
41
42       priority VLANPRIO
43              Choose the VLAN priority to use. Decimal number in range of 0-7.
44
45       CONTROL
46              How to continue after executing this action.
47
48              reclassify
49                     Restarts classification by jumping back to the first fil‐
50                     ter attached to this action's parent.
51
52              pipe   Continue with the next action, this is the default.
53
54              drop   Packet will be dropped without running further actions.
55
56              continue
57                     Continue classification with next filter in line.
58
59              pass   Return  to calling qdisc for packet processing. This ends
60                     the classification process.
61

EXAMPLES

63       The following example encapsulates incoming ICMP packets on  eth0  from
64       10.0.0.2 into VLAN ID 123:
65
66              #tc qdisc add dev eth0 handle ffff: ingress
67              #tc filter add dev eth0 parent ffff: pref 11 protocol ip \
68                   u32 match ip protocol 1 0xff flowid 1:1 \
69                   u32 match ip src 10.0.0.2 flowid 1:1 \
70                   action vlan push id 123
71
72       Here  is  an example of the pop function: Incoming VLAN packets on eth0
73       are decapsulated and the classification process then restarted for  the
74       plain packet:
75
76              #tc qdisc add dev eth0 handle ffff: ingress
77              #tc filter add dev $ETH parent ffff: pref 1 protocol 802.1Q \
78                   u32 match u32 0 0 flowid 1:1 \
79                   action vlan pop reclassify
80
81

SEE ALSO

83       tc(8)
84
85
86
87iproute2                          12 Jan 2015VLAN manipulation action in tc(8)
Impressum