tc-mpls(8) — Linux manual page


MPLS manipulation action in tc(8)   Linux  MPLS manipulation action in tc(8)

NAME         top

       mpls - mpls manipulation module

SYNOPSIS         top

       tc ... action mpls { POP | PUSH | MODIFY | dec_ttl } [ CONTROL ]

       POP := pop protocol MPLS_PROTO

       PUSH := push [ protocol MPLS_PROTO ]  [ tc MPLS_TC ]  [ ttl MPLS_TTL
               ]  [ bos MPLS_BOS ] label MPLS_LABEL

       MODIFY := modify [ label MPLS_LABEL ]  [ tc MPLS_TC ]  [ ttl MPLS_TTL

       CONTROL := { reclassify | pipe | drop | continue | pass | goto chain
               CHAIN_INDEX }

DESCRIPTION         top

       The mpls action performs mpls encapsulation or decapsulation on a
       packet, reflected by the operation modes POP, PUSH, MODIFY and
       DEC_TTL.  The POP mode requires the ethertype of the header that
       follows the MPLS header (e.g.  IPv4 or another MPLS). It will remove
       the outer MPLS header and replace the ethertype in the MAC header
       with that passed. The PUSH and MODIFY modes update the current MPLS
       header information or add a new header.  PUSH requires at least an
       MPLS_LABEL.  DEC_TTL requires no arguments and simply subtracts 1
       from the MPLS header TTL field.

OPTIONS         top

       pop    Decapsulation mode. Requires the protocol of the next header.

       push   Encapsulation mode. Requires at least the label option.

       modify Replace mode. Existing MPLS tag is replaced.  label, tc, and
              ttl are all optional.

              Decrement the TTL field on the outer most MPLS header.

       label MPLS_LABEL
              Specify the MPLS LABEL for the outer MPLS header.  MPLS_LABEL
              is an unsigned 20bit integer, the format is detected
              automatically (e.g. prefix with '0x' for hexadecimal
              interpretation, etc.).

       protocol MPLS_PROTO
              Choose the protocol to use. For push actions this must be
              mpls_uc or mpls_mc (mpls_uc is the default). For pop actions
              it should be the protocol of the next header.  This option
              cannot be used with modify.

       tc MPLS_TC
              Choose the TC value for the outer MPLS header. Decimal number
              in range of 0-7.  Defaults to 0.

       ttl MPLS_TTL
              Choose the TTL value for the outer MPLS header. Number in
              range of 0-255. A non-zero default value will be selected if
              this is not explicitly set.

       bos MPLS_BOS
              Manually configure the bottom of stack bit for an MPLS header
              push. The default is for TC to automatically set (or unset)
              the bit based on the next header of the packet.

              How to continue after executing this action.

                     Restarts classification by jumping back to the first
                     filter attached to this action's parent.

              pipe   Continue with the next action, this is the default.

              drop   Packet will be dropped without running further actions.

                     Continue classification with next filter in line.

              pass   Return to calling qdisc for packet processing. This
                     ends the classification process.

EXAMPLES         top

       The following example encapsulates incoming IP packets on eth0 into
       MPLS with a label 123 and sends them out eth1:

              #tc qdisc add dev eth0 handle ffff: ingress
              #tc filter add dev eth0 protocol ip parent ffff: flower \
                   action mpls push protocol mpls_uc label 123  \
                   action mirred egress redirect dev eth1

       In this example, incoming MPLS unicast packets on eth0 are decapsu‐
       lated and to ip packets and output to eth1:

              #tc qdisc add dev eth0 handle ffff: ingress
              #tc filter add dev eth0 protocol mpls_uc parent ffff: flower \
                   action mpls pop protocol ipv4  \
                   action mirred egress redirect dev eth0

SEE ALSO         top


COLOPHON         top

       This page is part of the iproute2 (utilities for controlling TCP/IP
       networking and traffic) project.  Information about the project can
       be found at 
       If you have a bug report for this manual page, send it to,  This page was obtained
       from the project's upstream Git repository
       ⟨⟩ on
       2020-08-13.  (At that time, the date of the most recent commit that
       was found in the repository was 2020-06-24.)  If you discover any
       rendering problems in this HTML version of the page, or you believe
       there is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to

iproute2                         22 May 2019MPLS manipulation action in tc(8)