Blame man/man8/tc-mpls.8

Packit Service 3880ab
.TH "MPLS manipulation action in tc" 8 "22 May 2019" "iproute2" "Linux"
Packit Service 3880ab
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
mpls - mpls manipulation module
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
.in +8
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR tc " ... " "action mpls" " { "
Packit Service 3880ab
.IR POP " | " PUSH " | " MODIFY " | "
Packit Service 3880ab
.BR dec_ttl " } [ "
Packit Service 3880ab
.IR CONTROL " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR POP " := "
Packit Service 3880ab
.BR pop " " protocol
Packit Service 3880ab
.IR MPLS_PROTO
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR PUSH " := "
Packit Service 0d9893
.BR push " [ " protocol
Packit Service 3880ab
.IR MPLS_PROTO " ]"
Packit Service 3880ab
.RB " [ " tc
Packit Service 3880ab
.IR MPLS_TC " ] "
Packit Service 3880ab
.RB " [ " ttl
Packit Service 3880ab
.IR MPLS_TTL " ] "
Packit Service 3880ab
.RB " [ " bos
Packit Service 3880ab
.IR MPLS_BOS " ] "
Packit Service 3880ab
.BI label " MPLS_LABEL"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR MODIFY " := "
Packit Service 3880ab
.BR modify " [ " label
Packit Service 3880ab
.IR MPLS_LABEL " ]"
Packit Service 3880ab
.RB " [ " tc
Packit Service 3880ab
.IR MPLS_TC " ] "
Packit Service 3880ab
.RB " [ " ttl
Packit Service 3880ab
.IR MPLS_TTL " ] "
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR CONTROL " := { "
Packit Service 3880ab
.BR reclassify " | " pipe " | " drop " | " continue " | " pass " | " goto " " chain " " CHAIN_INDEX " }"
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
The
Packit Service 3880ab
.B mpls
Packit Service 3880ab
action performs mpls encapsulation or decapsulation on a packet, reflected by the
Packit Service 3880ab
operation modes
Packit Service 3880ab
.IR POP ", " PUSH ", " MODIFY " and " DEC_TTL .
Packit Service 3880ab
The
Packit Service 3880ab
.I POP
Packit Service 3880ab
mode requires the ethertype of the header that follows the MPLS header (e.g.
Packit Service 3880ab
IPv4 or another MPLS). It will remove the outer MPLS header and replace the
Packit Service 3880ab
ethertype in the MAC header with that passed. The
Packit Service 3880ab
.IR PUSH " and " MODIFY
Packit Service 3880ab
modes update the current MPLS header information or add a new header.
Packit Service 3880ab
.IR PUSH
Packit Service 3880ab
requires at least an
Packit Service 3880ab
.IR MPLS_LABEL ". "
Packit Service 3880ab
.I DEC_TTL
Packit Service 3880ab
requires no arguments and simply subtracts 1 from the MPLS header TTL field.
Packit Service 3880ab
Packit Service 3880ab
.SH OPTIONS
Packit Service 3880ab
.TP
Packit Service 3880ab
.B pop
Packit Service 3880ab
Decapsulation mode. Requires the protocol of the next header.
Packit Service 3880ab
.TP
Packit Service 3880ab
.B push
Packit Service 0d9893
Encapsulation mode. Requires at least the
Packit Service 3880ab
.B label
Packit Service 3880ab
option.
Packit Service 3880ab
.TP
Packit Service 3880ab
.B modify
Packit Service 3880ab
Replace mode. Existing MPLS tag is replaced.
Packit Service 3880ab
.BR label ", "
Packit Service 3880ab
.BR tc ", "
Packit Service 3880ab
and
Packit Service 3880ab
.B ttl
Packit Service 3880ab
are all optional.
Packit Service 3880ab
.TP
Packit Service 3880ab
.B dec_ttl
Packit Service 3880ab
Decrement the TTL field on the outer most MPLS header.
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI label " MPLS_LABEL"
Packit Service 3880ab
Specify the MPLS LABEL for the outer MPLS header.
Packit Service 3880ab
.I MPLS_LABEL
Packit Service 3880ab
is an unsigned 20bit integer, the format is detected automatically (e.g. prefix
Packit Service 3880ab
with
Packit Service 3880ab
.RB ' 0x '
Packit Service 3880ab
for hexadecimal interpretation, etc.).
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI protocol " MPLS_PROTO"
Packit Service 3880ab
Choose the protocol to use. For push actions this must be
Packit Service 3880ab
.BR mpls_uc " or " mpls_mc " (" mpls_uc
Packit Service 3880ab
is the default). For pop actions it should be the protocol of the next header.
Packit Service 3880ab
This option cannot be used with modify.
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI tc " MPLS_TC"
Packit Service 3880ab
Choose the TC value for the outer MPLS header. Decimal number in range of 0-7.
Packit Service 3880ab
Defaults to 0.
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI ttl " MPLS_TTL"
Packit Service 3880ab
Choose the TTL value for the outer MPLS header. Number in range of 0-255. A
Packit Service 3880ab
non-zero default value will be selected if this is not explicitly set.
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI bos " MPLS_BOS"
Packit Service 3880ab
Manually configure the bottom of stack bit for an MPLS header push. The default
Packit Service 3880ab
is for TC to automatically set (or unset) the bit based on the next header of
Packit Service 3880ab
the packet.
Packit Service 3880ab
.TP
Packit Service 3880ab
.I CONTROL
Packit Service 3880ab
How to continue after executing this action.
Packit Service 3880ab
.RS
Packit Service 3880ab
.TP
Packit Service 3880ab
.B reclassify
Packit Service 3880ab
Restarts classification by jumping back to the first filter attached to this
Packit Service 3880ab
action's parent.
Packit Service 3880ab
.TP
Packit Service 3880ab
.B pipe
Packit Service 3880ab
Continue with the next action, this is the default.
Packit Service 3880ab
.TP
Packit Service 3880ab
.B drop
Packit Service 3880ab
Packet will be dropped without running further actions.
Packit Service 3880ab
.TP
Packit Service 3880ab
.B continue
Packit Service 3880ab
Continue classification with next filter in line.
Packit Service 3880ab
.TP
Packit Service 3880ab
.B pass
Packit Service 3880ab
Return to calling qdisc for packet processing. This ends the classification
Packit Service 3880ab
process.
Packit Service 3880ab
.RE
Packit Service 3880ab
.SH EXAMPLES
Packit Service 3880ab
The following example encapsulates incoming IP packets on eth0 into MPLS with
Packit Service 3880ab
a label 123 and sends them out eth1:
Packit Service 3880ab
Packit Service 3880ab
.RS
Packit Service 3880ab
.EX
Packit Service 3880ab
#tc qdisc add dev eth0 handle ffff: ingress
Packit Service 3880ab
#tc filter add dev eth0 protocol ip parent ffff: flower \\
Packit Service 3880ab
	action mpls push protocol mpls_uc label 123  \\
Packit Service 3880ab
	action mirred egress redirect dev eth1
Packit Service 3880ab
.EE
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 0d9893
In this example, incoming MPLS unicast packets on eth0 are decapsulated and to
Packit Service 0d9893
ip packets and output to eth1:
Packit Service 3880ab
Packit Service 3880ab
.RS
Packit Service 3880ab
.EX
Packit Service 3880ab
#tc qdisc add dev eth0 handle ffff: ingress
Packit Service 3880ab
#tc filter add dev eth0 protocol mpls_uc parent ffff: flower \\
Packit Service 3880ab
	action mpls pop protocol ipv4  \\
Packit Service 0d9893
	action mirred egress redirect dev eth0
Packit Service 415e21
.EE
Packit Service 415e21
.RE
Packit Service 415e21
Packit Service 3880ab
.SH SEE ALSO
Packit Service 0d9893
.BR tc (8)