1MPLS manipulation action in tc(8) Linux MPLS manipulation action in tc(8)
2
3
4
6 mpls - mpls manipulation module
7
9 tc ... action mpls { POP | PUSH | MODIFY | dec_ttl } [ CONTROL ]
10
11 POP := pop protocol MPLS_PROTO
12
13 PUSH := push [ protocol MPLS_PROTO ] [ tc MPLS_TC ] [ ttl MPLS_TTL ]
14 [ bos MPLS_BOS ] label MPLS_LABEL
15
16 MODIFY := modify [ label MPLS_LABEL ] [ tc MPLS_TC ] [ ttl MPLS_TTL ]
17
18 CONTROL := { reclassify | pipe | drop | continue | pass | goto chain
19 CHAIN_INDEX }
20
22 The mpls action performs mpls encapsulation or decapsulation on a
23 packet, reflected by the operation modes POP, PUSH, MODIFY and DEC_TTL.
24 The POP mode requires the ethertype of the header that follows the MPLS
25 header (e.g. IPv4 or another MPLS). It will remove the outer MPLS
26 header and replace the ethertype in the MAC header with that passed.
27 The PUSH and MODIFY modes update the current MPLS header information or
28 add a new header. PUSH requires at least an MPLS_LABEL. DEC_TTL
29 requires no arguments and simply subtracts 1 from the MPLS header TTL
30 field.
31
32
34 pop Decapsulation mode. Requires the protocol of the next header.
35
36 push Encapsulation mode. Requires at least the label option.
37
38 modify Replace mode. Existing MPLS tag is replaced. label, tc, and ttl
39 are all optional.
40
41 dec_ttl
42 Decrement the TTL field on the outer most MPLS header.
43
44 label MPLS_LABEL
45 Specify the MPLS LABEL for the outer MPLS header. MPLS_LABEL is
46 an unsigned 20bit integer, the format is detected automatically
47 (e.g. prefix with '0x' for hexadecimal interpretation, etc.).
48
49 protocol MPLS_PROTO
50 Choose the protocol to use. For push actions this must be
51 mpls_uc or mpls_mc (mpls_uc is the default). For pop actions it
52 should be the protocol of the next header. This option cannot
53 be used with modify.
54
55 tc MPLS_TC
56 Choose the TC value for the outer MPLS header. Decimal number in
57 range of 0-7. Defaults to 0.
58
59 ttl MPLS_TTL
60 Choose the TTL value for the outer MPLS header. Number in range
61 of 0-255. A non-zero default value will be selected if this is
62 not explicitly set.
63
64 bos MPLS_BOS
65 Manually configure the bottom of stack bit for an MPLS header
66 push. The default is for TC to automatically set (or unset) the
67 bit based on the next header of the packet.
68
69 CONTROL
70 How to continue after executing this action.
71
72 reclassify
73 Restarts classification by jumping back to the first fil‐
74 ter attached to this action's parent.
75
76 pipe Continue with the next action, this is the default.
77
78 drop Packet will be dropped without running further actions.
79
80 continue
81 Continue classification with next filter in line.
82
83 pass Return to calling qdisc for packet processing. This ends
84 the classification process.
85
87 The following example encapsulates incoming IP packets on eth0 into
88 MPLS with a label 123 and sends them out eth1:
89
90 #tc qdisc add dev eth0 handle ffff: ingress
91 #tc filter add dev eth0 protocol ip parent ffff: flower \
92 action mpls push protocol mpls_uc label 123 \
93 action mirred egress redirect dev eth1
94
95 In this example, incoming MPLS unicast packets on eth0 are decapsulated
96 and to ip packets and output to eth1:
97
98 #tc qdisc add dev eth0 handle ffff: ingress
99 #tc filter add dev eth0 protocol mpls_uc parent ffff: flower \
100 action mpls pop protocol ipv4 \
101 action mirred egress redirect dev eth0
102
103
105 tc(8)
106
107
108
109iproute2 22 May 2019MPLS manipulation action in tc(8)