Configuring MPLS Label Imposition

This chapter contains information on how to configure multiprotocol label switching (MPLS) label imposition.

About MPLS Label Imposition

An outgoing label stack having one or more labels can be statically provisioned using the MPLS Label Stack Imposition feature. The outgoing label stack is used in the following two types of statically configured MPLS bindings:

  • Prefix and Label to Label Stack - Here an IP prefix or an incoming label is mapped to an outgoing stack, similar to static MPLS. An incoming prefix is mapped to out-label-stack for IP-only ingress traffic.

  • Label to Label Stack - Here only an incoming label is mapped to an outgoing stack without any prefix.

The new MPLS binding types are implemented in the static MPLS component and are available only when the feature mpls segment-routing command is enabled.

If configured next-hops of MPLS label imposition are SR recursive next-hops (RNH), then they are resolved to actual next-hops using RIB. The outer label of the out-label stack is imposed automatically from the SR allocated labels.

ECMP is also supported by adding a number of path configurations.


Note


The static MPLS process is started when either the feature mpls segment-routing command or the feature mpls static command is run. Certain standard static MPLS commands will not be available when static MPLS is run using the feature mpls segment-routing command, and the commands for MPLS bindings will not be available when the feature mpls static command is run.


Guidelines and Limitations for MPLS Label Imposition

MPLS label imposition has the following guidelines and limitations:

  • MPLS label imposition is supported for the following:

    • Cisco Nexus 9200, 9300, 9300-EX, 9300-FX and 9500 platform switches with the 9400, 9500, 9600, 9700-EX, and 9700-FX line cards.

    • Cisco Nexus 3164Q, 31128PQ, 3232C, and 3264Q switches.

    • Beginning with Cisco NX-OS Release 9.2(1) release, it is supported on Cisco Nexus 9364C Switch.

    • Beginning with Cisco NX-OS Release 9.3(3), it is supported on Cisco Nexus 9364C-GX, 9316D-GX, and 93600CD-GX switches.

  • MPLS label imposition supports only IPv4.

  • The maximum number of labels in an out-label stack is five for Cisco Nexus 9200, 9300-EX, and 9300-FX platform switches and three for Cisco Nexus 9300 and 9500 platform switches and Cisco Nexus 3164Q, 31128PQ, 3232C, and 3264Q switches. If you try to impose more labels, the trailing label is truncated automatically, and a syslog error message appears signaling to correct the configuration.

  • Multicast is not supported for MPLS label imposition.

  • In the multi-label stack configuration, changing an outgoing path is allowed only for Cisco Nexus 9200 and 9300-EX Series switches.

  • Subinterfaces and port channels are not supported for MPLS label imposition.

  • Prefixes and associated subnet masks learned from routing protocols (including from static routes) cannot be used as part of the label stack imposition policy.

  • For label stack imposition verified scalability limits, see the Verified Scalability Guide for your device.

Configuring MPLS Label Imposition

Enabling MPLS Label Imposition

You must install and enable the MPLS feature set and then enable the MPLS segment routing feature before you can configure MPLS label imposition.

Procedure

  Command or Action Purpose

Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

[no] install feature-set mpls

Example:

switch(config)# install feature-set mpls

Installs the MPLS feature set. The no form of this command uninstalls the MPLS feature set.

Step 3

[no] feature-set mpls

Example:

switch(config)# feature-set mpls

Enables the MPLS feature set. The no form of this command disables the MPLS feature set.

Step 4

[no] feature mpls segment-routing

Example:

switch(config)# feature mpls segment-routing

Enables the MPLS segment routing feature. The no form of this command disables the MPLS segment routing feature.

Step 5

(Optional) show feature-set

Example:

switch(config)# show feature-set 
Feature Set Name      ID        State   
--------------------  --------  --------
mpls                  4         enabled
(Optional)

Displays the status of the MPLS feature set.

Step 6

(Optional) show feature | grep segment-routing

Example:

switch(config)# show feature | grep segment-routing 
segment-routing         1         enabled
(Optional)

Displays the status of MPLS segment routing.

Reserving Labels for MPLS Label Imposition

You can reserve the labels that are to be statically assigned. Dynamic label allocation is not supported.

Before you begin

Ensure that the MPLS segment routing feature is enabled.

Procedure

  Command or Action Purpose

Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

[no] mpls label range min-value max-value [static min-static-value max-static-value ]

Example:

switch(config)# mpls label range 17 99 static 100 10000

Reserves a range of labels for static label assignment.

The range for the minimum and maximum values is from 16 to 471804.

Step 3

(Optional) show mpls label range

Example:

switch(config)# show mpls label range
(Optional)

Displays the label range that is configured for static MPLS.

Step 4

(Optional) copy running-config startup-config

Example:

switch(config)# copy running-config startup-config
(Optional)

Copies the running configuration to the startup configuration.

Configuring MPLS Label Imposition

You can configure MPLS label imposition on the device.


Note


The feature mpls segment-routing command cannot be enabled when the following commands are in use: feature nv overlay , nv overlay evpn , feature vpc , and feature vn-segment-vlan-based .


Before you begin

Ensure that the MPLS segment routing feature is enabled.

Set a static label range as follows: mpls label range 16 16 static 17 50000 .

Procedure

  Command or Action Purpose

Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

interface type slot/port

Example:

switch(config)# interface ethernet 2/2
switch(config-if)#

Enters the interface configuration mode for the specified interface.

Step 3

[no] mpls ip forwarding

Example:

switch(config-if)# mpls ip forwarding

Enables MPLS on the specified interface. The no form of this command disables MPLS on the specified interface.

Step 4

mpls static configuration

Example:

switch(config-if)# mpls static configuration
switch(config-mpls-static)# 

Enters MPLS static global configuration mode.

Step 5

address-family ipv4 unicast

Example:

switch(config-mpls-static)# address-family ipv4 unicast
switch(config-mpls-static-af)# 

Enters global address family configuration mode for the specified IPv4 address family.

Step 6

lsp name

Example:

switch(config-mpls-static-af)# lsp lsp1
switch(config-mpls-static-lsp)#

Specifies a name for LSP.

Step 7

in-label value allocate policy prefix

Example:

switch(config-mpls-static-lsp)# in-label 8100 allocate policy 15.15.1.0/24
switch(config-mpls-static-lsp-inlabel)#

Configures an in-label value and a prefix value (optional).

Step 8

forward

Example:

switch(config-mpls-static-lsp-inlabel)# forward
switch(config-mpls-static-lsp-inlabel-forw)#

Enters the forward mode.

Step 9

path number next-hop ip-address out-label-stack label-id label-id

Example:

switch(config-mpls-static-lsp-inlabel-forw)# path 1 next-hop 13.13.13.13 out-label-stack 16 3000 

Specifies the path. The maximum number of supported paths is 32.

Step 10

(Optional) copy running-config startup-config

Example:

switch(config-mpls-static-lsp-inlabel-forw)# copy running-config startup-config
(Optional)

Copies the running configuration to the startup configuration.

Verifying the MPLS Label Imposition Configuration

To display the MPLS label imposition configuration, perform one of the following tasks:

Command Purpose

show feature | grep segment-routing

Displays the status of MPLS label imposition.

show feature-set

Displays the status of the MPLS feature set.

show forwarding mpls label label

Displays MPLS label forwarding statistics for a particular label.

show mpls label range

Displays the label range that is configured for MPLS label imposition.

show mpls static binding {all | ipv4}

Displays the configured static prefix or label bindings.

show mpls switching [detail]

Displays MPLS label switching information.

show running-config mpls static

Displays the running static MPLS configuration.

This example shows sample output for the show forwarding mpls label 8100 command:

slot 1
=======
--------+-----------+-------------------+----------------+-------------+----------------------
Local|Prefix|FEC          |Next-Hop  |Interface | Out Label |Table Id |(Prefix/Tunnel id)|Label
--------+-----------+-------------------+----------------+------------+----------------------
8100 |0x1   |25.25.0.0/16 |12.12.1.2 |Po121     |3131 SWAP  |         |                  | 17
"    |0x1   |25.25.0.0/16 |12.12.2.2 |Eth1/51   |3131 SWAP  |         |                  | 17
"    |0x1   |25.25.0.0/16 |12.12.3.2 |Vlan122   |3131 SWAP  |         |                  | 17
"    |0x1   |25.25.0.0/16 |12.12.4.2 |Vlan123   |3131 SWAP  |         |                  | 17
                                                                                

This example shows sample output for the show mpls static binding all command:

LI_TEST1 25.25.0.0/16: (vrf: default) Incoming label: 8100
LSP Type: POLICY
  Outgoing labels:
     (path 1)  12.12.1.2 3131,17
     (path 2)  12.12.2.2 3131,17
     (path 3)  12.12.3.2 3131,17
     (path 4)  12.12.4.2 3131,17
 
LI_TEST2 (vrf: default) Incoming label: 8200
LSP Type: XC
  Outgoing labels:
     (path 1)  12.12.3.2 3132,16
     (path 2)  12.12.4.2 3132,16
     (path 3)  12.12.1.2 3132,16
     (path 4)  12.12.2.2 3132,16 

This example shows sample output for the show mpls switching command:


Legend:
(P)=Protected, (F)=FRR active, (*)=more labels in stack.
 
Local      Out-Label  FEC                                            Out-Interface      Next-Hop
8200       3132       Label 8200                                                        12.12.3.2                                        *
8200       3132       Label 8200                                                        12.12.4.2                                        *
8200       3132       Label 8200                                                        12.12.1.2                                        *
8200       3132       Label 8200                                                        12.12.2.2                                        *
 
Local      Out-Label  FEC                                            Out-Interface      Next-Hop
8100       3131       Pol 25.25.0.0/16                                                  12.12.1.2                                        *
8100       3131       Pol 25.25.0.0/16                                                  12.12.2.2                                        *
8100       3131       Pol 25.25.0.0/16                                                  12.12.3.2                                        *
8100       3131       Pol 25.25.0.0/16                                                  12.12.4.2                                        *

This example shows sample output for the show running-config mpls static command:


mpls static configuration
  address-family ipv4 unicast
    lsp LI_TEST2
      in-label 8100 allocate policy 25.25.0.0 255.255.0.0
        forward
          path 1 next-hop 12.12.1.2 out-label-stack 3131 17
          path 2 next-hop 12.12.2.2 out-label-stack 3131 17
          path 3 next-hop 12.12.3.2 out-label-stack 3131 17
          path 4 next-hop 12.12.4.2 out-label-stack 3131 17

This example shows sample output for the show running-config mpls static all command.

switch# show running-config mpls static all 

!Command: show running-config mpls static all
!Time: Mon Aug 21 14:59:46 2017

version 7.0(3)I7(1)
logging level mpls static 5
mpls static configuration
address-family ipv4 unicast
lsp 9_label_stack_LPM
in-label 72000 allocate policy 71.200.11.0 255.255.255.0 
forward
path 1 next-hop 27.1.32.4 out-label-stack 21901 29701 27401 24501 25801 
lsp 9_label_stack_LPM_01
in-label 72001 allocate policy 72.201.1.1 255.255.255.255 
lsp DRV-01
in-label 71011 allocate policy 71.111.21.0 255.255.255.0 
forward
path 1 next-hop 27.1.31.4 out-label-stack implicit-null 
lsp DRV-02
in-label 71012 allocate policy 71.111.22.0 255.255.255.0 
forward
path 1 next-hop 8.8.8.8 out-label-stack 28901 
lsp DRV-03
switch# show forwarding mpls label 72000

slot 1
=======

--------+-----------+-------------------+----------------+-------------+-------
Local |Prefix |FEC |Next-Hop |Interface |Out 
Label |Table Id |(Prefix/Tunnel id) | | |Label 
--------+-----------+-------------------+----------------+-------------+-------
72000 |0x1 |71.200.11.0/24 |27.1.32.4 |Eth1/21 |21901 SWAP 
| | | | | 29701 
| | | | | 27401 
| | | | | 24501 
| | | | | 25801 

Displaying MPLS Label Imposition Statistics

To monitor MPLS label imposition statistics, perform one of the following tasks:

Command Purpose

show forwarding [ipv4] adjacency mpls stats

Displays MPLS IPv4 adjacency statistics (both, packets and bytes).

Note

 

The Cisco Nexus 9200 and 9300-EX Series switches do not support this command.

show forwarding mpls label label stats [platform]

Displays MPLS label forwarding statistics.

show mpls forwarding statistics [interface type slot/port]

Displays MPLS forwarding statistics.

show mpls switching labels low-label-value [high-label-value] [detail]

Displays MPLS label switching statistics. The range for the label value is from 0 to 524286.

This example shows sample output for the show forwarding adjacency mpls stats command:

slot  1
=======
 
 FEC   next-hop    interface  tx packets   tx bytes  Label info
------ ----------- ---------- ------------ --------- --------------
       12.12.3.2   Vlan122      0           0         SWAP 3131 17
       12.12.3.2   Vlan122      0           0         SWAP 3132 16
       12.12.4.2   Vlan123      0           0         SWAP 3131 17
       12.12.4.2   Vlan123      0           0         SWAP 3132 16
       12.12.1.2   Po121        0           0         SWAP 3131 17
       12.12.1.2   Po121        0           0         SWAP 3132 16
       12.12.2.2   Eth1/51      0           0         SWAP 3131 17
       12.12.2.2   Eth1/51      0           0         SWAP 3132 16

This example shows sample output for the show forwarding mpls label 8100 stats command:

slot  1
=======
--------+-----------+-------------------+----------------+-------------+-------
Local   |Prefix     |FEC                |Next-Hop        |Interface    |Out
Label   |Table Id   |(Prefix/Tunnel id) |                |             |Label
--------+-----------+-------------------+----------------+-------------+-------
8100    |0x1        |25.25.0.0/16       |12.12.1.2       |Po121        |3131
  SWAP
        |           |                   |                |            | 17
    "   |0x1        |25.25.0.0/16       |12.12.2.2       |Eth1/51      |3131
  SWAP
        |           |                   |                |            | 17
    "   |0x1        |25.25.0.0/16       |12.12.3.2       |Vlan122      |3131
  SWAP
        |           |                   |                |            | 17
    "   |0x1        |25.25.0.0/16       |12.12.4.2       |Vlan123      |3131
  SWAP
        |           |                   |                |            | 17
 
Input Pkts : 126906012            Input Bytes : 64975876096
SWAP Output Pkts: 126959183       SWAP Output Bytes: 65764550340
TUNNEL Output Pkts: 126959053     TUNNEL Output Bytes: 66272319384
                                                                                

This example shows sample output for the show mpls forwarding statistics command:

MPLS software forwarding stats summary:
    Packets/Bytes sent           : 0/0
    Packets/Bytes received       : 0/0
    Packets/Bytes forwarded      : 0/0
    Packets/Bytes originated     : 0/0
    Packets/Bytes consumed       : 0/0
    Packets/Bytes input dropped  : 0/0
    Packets/Bytes output dropped : 0/0

Clearing MPLS Label Imposition Statistics

To clear the MPLS label imposition statistics, perform these tasks:

Command Purpose

clear forwarding [ipv4] adjacency mpls stats

Clears the MPLS IPv4 adjacency statistics.

clear forwarding mpls stats

Clears the ingress MPLS forwarding statistics.

clear mpls forwarding statistics

Clears the MPLS forwarding statistics.

clear mpls switching label statistics [interface type slot/port]

Clears the MPLS switching label statistics.

Configuration Examples for MPLS Label Imposition

This example shows how to configure MPLS label imposition by allocating a prefix and an incoming-label to out-label-stack binding:


switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv4 unicast
switch(config-mpls-static-af)# lsp LI_TEST1
switch(config-mpls-static-lsp)# in-label 8100 allocate policy 25.25.0.0/16
switch(config-mpls-static-lsp-inlabel)# forward
switch(config-mpls-static-lsp-inlabel-forw)# path 1 next-hop 12.12.1.2 out-label-stack 3131 17
switch(config-mpls-static-lsp-inlabel-forw)# path 2 next-hop 12.12.2.2 out-label-stack 3131 17
switch(config-mpls-static-lsp-inlabel-forw)# path 3 next-hop 12.12.3.2 out-label-stack 3131 17
switch(config-mpls-static-lsp-inlabel-forw)# path 4 next-hop 12.12.4.2 out-label-stack 3131 17

To remove a next-hop, you can use
no path 1
To remove the named lsp, you can use
no lsp LI_TEST1

This example shows how to configure MPLS label imposition by allocating an incoming-label to out-label-stack binding (no prefix):


switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv4 unicast
switch(config-mpls-static-af)# lsp LI_TEST1
switch(config-mpls-static-lsp)# in-label 8200 allocate
switch(config-mpls-static-lsp-inlabel)# forward
switch(config-mpls-static-lsp-inlabel-forw)# path 1 next-hop 12.12.3.2 out-label-stack 3132 16
switch(config-mpls-static-lsp-inlabel-forw)# path 2 next-hop 12.12.4.2 out-label-stack 3132 16
switch(config-mpls-static-lsp-inlabel-forw)# path 3 next-hop 12.12.1.2 out-label-stack 3132 16
switch(config-mpls-static-lsp-inlabel-forw)# path 4 next-hop 12.12.2.2 out-label-stack 3132 16