Licensing Requirements
For a complete explanation of Cisco NX-OS licensing recommendations and how to obtain and apply licenses, see the Cisco NX-OS Licensing Guide and the Cisco NX-OS Licensing Options Guide.
The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter contains information on how to configure static multiprotocol label switching (MPLS).
For a complete explanation of Cisco NX-OS licensing recommendations and how to obtain and apply licenses, see the Cisco NX-OS Licensing Guide and the Cisco NX-OS Licensing Options Guide.
Generally, label switching routers (LSRs) use a label distribution protocol to dynamically learn the labels that they should use to label-switch packets. Examples of such protocols include:
Label Distribution Protocol (LDP), the Internet Engineering Task Force (IETF) standard that is used to bind labels to network addresses
Resource Reservation Protocol (RSVP), which is used to distribute labels for traffic engineering (TE)
Border Gateway Protocol (BGP), which is used to distribute labels for MPLS virtual private networks (VPNs)
To use a learned label to label-switch packets, an LSR installs the label into its Label Forwarding Information Base (LFIB).
The static MPLS feature enables you to statically configure the following:
The binding between a label and an IPv4 or IPv6 prefix
The action corresponding to the binding between a label and an IPv4 or IPv6 prefix (label swap or pop)
The contents of an LFIB cross-connect entry
As a labeled packet traverses the MPLS domain, the outermost label of the label stack is examined at each hop. Depending on the contents of the label, a swap or pop (dispose) operation is performed on the label stack. Forwarding decisions are made by performing an MPLS table lookup for the label carried in the packet header. The packet header does not need to be reevaluated during packet transit through the network. Because the label has a fixed length and is unstructured, the MPLS forwarding table lookup process is both straightforward and fast.
In a swap operation, the label is swapped with a new label, and the packet is forwarded to the next hop that is determined by the incoming label.
In a pop operation, the label is removed from the packet, which may reveal an inner label below. If the popped label was the last label on the label stack, the packet exits the MPLS domain. Typically, this process occurs at the egress LSR. A failure of the primary link in the aggregator reroutes the MPLS traffic to the backup link and results in a swap operation.
This diagram illustrates the static MPLS source routing topology. The access nodes perform the swap operation, and the aggregation nodes perform the pop operation for the primary path and the swap operation for the backup path.
Static bindings between labels and IPv4 or IPv6 prefixes can be configured to support MPLS hop-by-hop forwarding through neighbor routers that do not implement LDP label distribution.
Static cross-connects can be configured to support MPLS label switched path (LSP) midpoints when neighbor routers do not implement either LDP or RSVP label distribution but do implement an MPLS forwarding path.
Cisco Nexus 9500 Series switches support stateful switchovers (SSOs) for static MPLS. After an SSO, static MPLS returns to the state it was in previously.
Static MPLS supports zero traffic loss during SSO. MPLS static restarts are not supported.
Note |
The Cisco Nexus 9300 Series switches do not support SSO. |
Static MPLS has the following prerequisites:
For Cisco Nexus 9300 and 9500 Series switches and the Cisco Nexus 3164Q, 31128PQ, 3232C, and 3264Q switches, you must configure the ACL TCAM region size for MPLS, save the configuration, and reload the switch. (For more information, see the "Using Templates to Configure ACL TCAM Region Sizes" and "Configuring ACL TCAM Region Sizes" sections in the Cisco Nexus 9000 Series NX-OS Security Configuration Guide.) The Cisco Nexus 9200 Series switches do not require TCAM carving for static MPLS.
Note |
By default the mpls region size is zero. You need to configure this region to 256 in order to support static MPLS. |
Static MPLS has the following guidelines and limitations:
Static MPLS is supported on Cisco Nexus 3100, 3200, 9200, 9300, 9300-EX, FX, FX2 and 9500 switches with the 9400, 9500, 9600, and 9700-EX line cards.
Beginning with Cisco NX-OS Release 9.3(3), static MPLS is supported on Cisco Nexus 9364C-GX, Cisco Nexus 9316D-GX, and Cisco Nexus 93600CD-GX switches.
Static MPLS, MPLS segment routing, and MPLS stripping cannot be enabled at the same time.
Equal-cost multipath (ECMP) is not supported with Label pop.
Label pop and swap operations are supported, but label push operations are not.
MPLS packets are forwarded as long as the ingress label matches the configured label and the configured FEC (prefix) is in the routing table.
The device generally performs as a label switching router (LSR). If you install the explicit null label as the out-label in the label FIB (LFIB) by an LSR before the packet is passed to an adjacent LER, the device performs as a label edge router (LER) for penultimate hop popping. Meaning that a label switching router (LSR) functions with one or more labels.
Note |
If you intentionally use implicit-null CLI on LSR, the output packet going to the LER, it contains an explicit-null and the inner label. |
Static MPLS supports up to 128 labels.
The backup path is supported only for a single adjacency and not for ECMP.
Cisco Nexus 9300 Series switches support backup path Fast Reroute (FRR) subsecond convergence whereas Cisco Nexus 9500 Series switches support a limited backup path FRR convergence.
The output for most of the MPLS commands can be generated in XML or JSON. See Verifying the Static MPLS Configuration for an example.
VRFs, vPCs, FEX, and VXLAN are not supported with static MPLS.
When sub-interfaces are used to connect to the remote vpnv4 neighbors, the parent interface needs to enable "mpls ip forwarding" command.
Command "mpls ip forwarding" cannot be configured under a sub-interface.
Subinterfaces are not supported for static MPLS.
The Forwarding Equivalence Class (FEC) must match routes in the routing table.
Static MPLS is enabled and cannot be disabled on the X9536PQ, X9564PX, and X9564TX line cards and the M12PQ generic expansion module (GEM).
When you configure Fast Reroute (backup), you can specify only the connected next hop (and not the recursive next hop) as the next-hop prefix in the backup configuration.
When multiple FECs are sharing the backup (the same next-hop and interface), any change to the backup configuration requires a reconfiguration of all the other FECs that are sharing the backup configuration.
When the backup path is active, the show mpls switching labels command will not show the out label/out interface/next hop and related statistics. You can use the show forwarding mpls label label stats platform command to check the statistics.
If traffic ingresses or egresses on a non-default unit (where the default unit is unit0), the corresponding ULIB statistics will not be displayed in the output of the show mpls switching labels low-label-value [high-label-value] detail command. You can use the show forwarding mpls label label stats platform command to check the statistics.
If the backup and primary paths are pointing to the same interface, the backup action swap takes precedence.
Physical (Ethernet) and port channels are supported only for backup.
The following guidelines and limitations apply to Cisco Nexus 9200 Series switches:
ECMP hashing is supported only on inner fields.
MTU checks are not supported for packets with an MPLS header.
You must install and enable the MPLS feature set and then enable the MPLS static feature before you can configure MPLS static labels.
Command or Action | Purpose | |
---|---|---|
Step 1 |
configure terminal Example:
|
Enters global configuration mode. |
Step 2 |
[no] install feature-set mpls Example:
|
Installs the MPLS feature set. The no form of this command uninstalls the MPLS feature set. |
Step 3 |
[no] feature-set mpls Example:
|
Enables the MPLS feature set. The no form of this command disables the MPLS feature set. |
Step 4 |
[no] feature mpls static Example:
|
Enables the static MPLS feature. The no form of this command disables the static MPLS feature. |
Step 5 |
(Optional) show feature-set Example:
|
(Optional)
Displays the status of the MPLS feature set. |
Step 6 |
(Optional) show feature | inc mpls_static Example:
|
(Optional)
Displays the status of static MPLS. |
You can reserve the labels that are to be statically assigned so that they are not dynamically assigned.
Ensure that the static MPLS feature is enabled.
Command or Action | Purpose | |
---|---|---|
Step 1 |
configure terminal Example:
|
Enters global configuration mode. |
Step 2 |
[no] mpls label range min-value max-value [static min-static-value max-static-value ] Example:
|
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:
|
(Optional)
Displays the label range that is configured for static MPLS. |
Step 4 |
(Optional) copy running-config startup-config Example:
|
(Optional)
Copies the running configuration to the startup configuration. |
In a top-of-rack configuration, the outer label is swapped to the specified new label. The packet is forwarded to the next-hop address, which is auto-resolved by the new label.
In an aggregator configuration, the outer label is popped, and the packet with the remaining label is forwarded to the next-hop address. Pop operations are performed in the primary path, and swap operations are performed in the backup path.
Ensure that the static MPLS feature is enabled.
Command or Action | Purpose | |
---|---|---|
Step 1 |
configure terminal Example:
|
Enters global configuration mode. |
Step 2 |
interface type slot/port Example:
|
Enters the interface configuration mode for the specified interface. |
Step 3 |
[no] mpls ip forwarding Example:
|
Enables MPLS on the specified interface. The no form of this command disables MPLS on the specified interface. |
Step 4 |
mpls static configuration Example:
|
Enters MPLS static global configuration mode. |
Step 5 |
address-family {ipv4 | ipv6} unicast Example:
|
Enters global address family configuration mode for the specified IPv4 or IPv6 address family. |
Step 6 |
local-label local-label-value prefix destination-prefix destination-prefix-mask Example:
|
Specifies static binding of incoming labels to IPv4 or IPv6 prefixes. The local-label-value is the range of the static MPLS label defined in the mpls label range command. |
Step 7 |
next-hop {auto-resolve | destination-ip-next-hop out-label implicit-null | backup local-egress-interface destination-ip-next-hop out-label output-label-value} Example:
|
Specifies the next hop. These options are available:
|
Step 8 |
(Optional) copy running-config startup-config Example:
|
(Optional)
Copies the running configuration to the startup configuration. |
By default, the statistics collection mode accumulates the number of packets that egress out of a given adjacency. Beginning Cisco NX-OS Release 9.3(1), you can configure the statistics collection mode to accumulate the number of bytes for an adjacency.
This mode is available when you enable the MPLS segment routing feature, however you must configure the collection mode to accumulate bytes.
Command or Action | Purpose | |
---|---|---|
Step 1 |
configure terminal Example:
|
Enters global configuration mode. |
Step 2 |
[no] install feature-set mpls Example:
|
Installs the MPLS feature set. The no form of this command uninstalls the MPLS feature set. |
Step 3 |
[no] feature-set mpls Example:
|
Enables the MPLS feature set. The no form of this command disables the MPLS feature set. |
Step 4 |
[no] feature mpls segment-routing Example:
|
Enables the MPLS segment routing feature. The no form of this command disables the MPLS segment routing feature. |
Step 5 |
[no] hardware profile mpls adjacency-stats bytes Example:
|
Configures the statistics collection mode for the output statistics to accumulate the count of bytes for a given adjacency. The no form of this command resets the collection mode to accumulate the packet count. |
Step 6 |
(Optional) show running-config | grep adjacency stats Example:
|
(Optional)
Displays the knob configuration. |
Step 7 |
(Optional) show feature-set Example:
|
(Optional)
Displays the status of the MPLS feature set. |
Step 8 |
(Optional) show feature | grep segment-routing Example:
|
(Optional)
Displays the status of MPLS segment routing. |
Step 9 |
show forwarding mpls [label label] stats Example:
|
Displays the adjacency statistics. |
To display the static MPLS configuration, perform one of the following tasks:
Command | Purpose |
---|---|
show feature | inc mpls_static |
Displays the status of static MPLS. |
show feature-set |
Displays the status of the MPLS feature set. |
show ip route |
Displays routes from the unicast Routing Information Base (RIB). |
show mpls label range |
Displays the label range that is configured for static MPLS. |
show mpls static binding {all | ipv4 | ipv6} |
Displays the configured static prefix or label bindings. |
show mpls switching [detail] |
Displays MPLS switching information. |
show mpls switching label [detail] |
Displays the MPLS switching label information. |
show forwarding mpls [label label] stats |
Displays the adjacency statistics based on the label enabled. |
show forwarding adjacency mpls stats |
Displays the adjacency statistics |
This example shows sample output for the show mpls static binding all command:
1.255.200.0/32: (vrf: default) Incoming label: 2000
Outgoing labels:
1.21.1.1 implicit-null
backup 1.24.1.1 2001
2000:1:255:201::1/128: (vrf: default) Incoming label: 3000
Outgoing labels:
2000:1111:2121:1111:1111:1111:1111:1 implicit-null
backup 2000:1:24:1::1 3001
This example shows sample output for the show mpls switching detail command:
VRF default
IPv4 FEC
In-Label : 2000
Out-Label stack : Pop Label
FEC : 1.255.200.0/32
Out interface : Po21
Next hop : 1.21.1.1
Input traffic statistics : 0 packets, 0 bytes
Output statistics per label : 0 packets, 0 bytes
IPv6 FEC
In-Label : 3000
Out-Label stack : Pop Label
FEC : 2000:1:255:201::1/128
Out interface : port-channel21
Next hop : 2000:1111:2121:1111:1111:1111:1111:1
Input traffic statistics : 0 packets, 0 bytes
Output statistics per label : 0 packets, 0 bytes
This example shows normal, XML, and JSON sample output for the show mpls switching command when the switch is configured with a static IPv4 prefix:
switch# show run mpls static | sec 'ipv4 unicast'
address-family ipv4 unicast
local-label 100 prefix 192.168.0.1 255.255.255.255 next-hop auto-resolve out-label 200
switch# show mpls switching
Legend:
(P)=Protected, (F)=FRR active, (*)=more labels in stack.
IPV4:
In-Label Out-Label FEC name Out-Interface Next-Hop
VRF default
100 200 192.168.0.1/32 Eth1/23 1.12.23.2
switch# show mpls switching | xml
<?xml version="1.0" encoding="ISO-8859-1"?> <nf:rpc-reply xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="http://w
ww.cisco.com/nxos:1.0:ulib">
<nf:data>
<show>
<mpls>
<switching>
<__XML__OPT_Cmd_ulib_show_switching_cmd_labels>
<__XML__OPT_Cmd_ulib_show_switching_cmd_detail>
<__XML__OPT_Cmd_ulib_show_switching_cmd_vrf>
<__XML__OPT_Cmd_ulib_show_switching_cmd___readonly__>
<__readonly__>
<TABLE_vrf>
<ROW_vrf>
<vrf_name>default</vrf_name>
<TABLE_inlabel>
<ROW_inlabel>
<in_label>100</in_label>
<out_label_stack>200</out_label_stack>
<ipv4_prefix>192.168.0.1/32</ipv4_prefix>
<out_interface>Eth1/23</out_interface>
<ipv4_next_hop>1.12.23.2</ipv4_next_hop>
<nhlfe_p2p_flag> </nhlfe_p2p_flag>
</ROW_inlabel>
</TABLE_inlabel>
</ROW_vrf>
</TABLE_vrf>
</__readonly__>
</__XML__OPT_Cmd_ulib_show_switching_cmd___readonly__>
</__XML__OPT_Cmd_ulib_show_switching_cmd_vrf>
</__XML__OPT_Cmd_ulib_show_switching_cmd_detail>
</__XML__OPT_Cmd_ulib_show_switching_cmd_labels>
</switching>
</mpls>
</show>
</nf:data>
</nf:rpc-reply>
]]>]]>
switch# show mpls switching | json
{"TABLE_vrf": {"ROW_vrf": {"vrf_name": "default", "TABLE_inlabel":
{"ROW_inlabel
": {"in_label": "100", "out_label_stack": "200", "ipv4_prefix":
"192.168.0.1/32"
, "out_interface": "Eth1/23", "ipv4_next_hop": "1.12.23.2",
"nhlfe_p2p_flag": nu
ll}}}}}
To monitor static MPLS statistics, perform one of the following tasks:
Command | Purpose |
---|---|
show forwarding [ipv6] adjacency mpls stats |
Displays MPLS IPv4 or IPv6 adjacency statistics. |
show forwarding mpls drop-stats |
Displays the MPLS forwarding packet drop statistics. |
show forwarding mpls ecmp [module slot | platform] |
Displays the MPLS forwarding statistics for equal-cost multipath (ECMP). |
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 the 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:
FEC next-hop interface tx packets tx bytes Label info
--------------- ---------- ---------- ----------- --------- ----------
1.255.200.0/32 1.21.1.1 Po21 87388 10836236 POP 3
1.255.200.0/32 1.24.1.1 Po24 0 0 SWAP 2001
switch(config)#
switch(config)# show forwarding mpls drop-stats
Dropped packets : 73454
Dropped bytes : 9399304
This example shows sample output for the show forwarding ipv6 adjacency mpls stats command:
FEC next-hop interface tx packets tx bytes Label info
---------------------- -------------- ---------- ----------- --------- -----------
2000:1:255:201::1/128 2000:1.21.1.1 Po21 46604 5778896 POP 3
2000:1:255:201::1/128 2000:1:24:1::1 Po24 0 0 SWAP 3001
This example shows sample output for the show forwarding mpls label 2000 stats command:
--------+-----------+-------------------+----------------+-------------+-------
Local |Prefix |FEC |Next-Hop |Interface |Out
Label |Table Id |(Prefix/Tunnel id) | | |Label
--------+-----------+-------------------+----------------+-------------+-------
2000 |0x1 |1.255.200.0/32 |1.21.1.1 |Po21 |Pop Label
HH: 100008, Refcount: 1
Input Pkts : 77129 Input Bytes : 9872512
Output Pkts: 77223 Output Bytes: 9575652
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
To clear the static MPLS statistics, perform these tasks:
Command | Purpose |
---|---|
clear forwarding [ipv6] adjacency mpls stats |
Clears the MPLS IPv4 or IPv6 adjacency statistics. |
clear forwarding mpls drop-stats |
Clears the MPLS forwarding packet drop 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. |
This example shows how to reserve labels for static assignment:
switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# mpls label range 17 99 static 100 10000
switch(config)# show mpls label range
Downstream Generic label region: Min/Max label: 17/99
Range for static labels: Min/Max Number: 100/10000
This example shows how to configure MPLS static label and IPv4 prefix binding in a top-of-rack configuration (swap configuration):
switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface ethernet 1/1
switch(config-if)# mpls ip forwarding
switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv4 unicast
switch(config-mpls-static-af)# local-label 2000 prefix 1.255.200.0/32
switch(config-mpls-static-af-lbl)# next-hop auto-resolve out-label 2000
This example shows how to configure MPLS static label and IPv6 prefix binding in a top-of-rack configuration (swap configuration):
switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface ethernet 1/1
switch(config-if)# mpls ip forwarding
switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv6 unicast
switch(config-mpls-static-af)# local-label 3001 prefix 2000:1:255:201::1/128
switch(config-mpls-static-af-lbl)# next-hop auto-resolve out-label 3001
This example shows how to configure MPLS static label and IPv4 prefix binding in an aggregator configuration (pop configuration):
switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface ethernet 1/1
switch(config-if)# mpls ip forwarding
switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv4 unicast
switch(config-mpls-static-af)# local-label 2000 prefix 1.255.200.0/32
switch(config-mpls-static-af-lbl)# next-hop 1.31.1.1 out-label implicit-null
switch(config-mpls-static-af-lbl)# next-hop backup Po34 1.34.1.1 out-label 2000
This example shows how to configure MPLS static label and IPv6 prefix binding in an aggregator configuration (pop configuration):
switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface ethernet 1/1
switch(config-if)# mpls ip forwarding
switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv6 unicast
switch(config-mpls-static-af)# local-label 3001 prefix 2000:1:255:201::1/128
switch(config-mpls-static-af-lbl)# next-hop 2000:1:31:1::1 out-label implicit-null
switch(config-mpls-static-af-lbl)# next-hop backup Po34 2000:1:34:1::1 out-label 3001
Related Topic | Document Title |
---|---|
MPLS TCAM regions |
See the Using Templates to Configure ACL TCAM Region Sizes section in the Cisco Nexus 9000 Series NX-OS Security Configuration Guide. |