印刷

MPLS Commands

mpls ip

The mpls ip command enables MPLS routing. Multiprotocol Label Switching (MPLS) is a networking process that avoids complex lookups in a routing table by replacing complete network addresses with short path labels for directing data packets to network nodes. MPLS data paths are serviced through a tunnel encapsulation data structure that adds four-byte label headers to packets.

The no mpls ip and default mpls ip commands disable MPLS routing by removing the mpls ip command from running-config. When MPLS routing is disabled, routed MPLS packets are dropped and all MPLS routes and adjacencies are removed. MPLS routing is disabled by default.

Command Mode

Global Configuration

Command Syntax

mpls ip

no mpls ip

default mpls ip

Examples:

  • This command enables MPLS routing. Previous commands enabled IP routing and configured MPLS static routes.
    switch(config)#mpls ip
    switch(config)#show running-config
    
    ! Command: show running-config
    
    !
    ip routing
    !
    mpls ip
    !
    mpls static top-label 3400 10.14.4.4 pop payload-type ipv4
    mpls static top-label 4400 10.15.46.45 pop payload-type ipv4
    !
    
    !
    end
    switch(config)#
    
  • This command disables MPLS routing.
    switch(config)#no mpls ip
    switch(config)#show running-config
    
    
    ! Command: show running-config
     <-------OUTPUT OMITTED FROM EXAMPLE-------->
    !
    ip routing
    !
    mpls static top-label 3400 10.14.4.4 pop payload-type ipv4
    mpls static top-label 4400 10.15.46.45 pop payload-type ipv4
    !
    
    !
    end
    switch(config)#
    

mpls static

The mpls static command creates an MPLS rule that specifies the method of handling of inbound MPLS traffic. Multiprotocol Label Switching (MPLS) is a networking process that replaces complete network addresses with short path labels for directing data packets to network nodes.

Static rules specify these parameters:

  • MPLS filter: The top-label parameter specifies the 20-bit value that the MPLS packet’s top header label must match to be handled by the rule.
  • Nexthop location: Specifies the destination nexthop address (IPv4 or IPv6) and the interface through which the switch forwards the packet.
  • MPLS action: Specifies the MPLS label stack management action performed on the packet:

    • pop-payload: removes the top label from stack; this terminates an LSP (label-switched path).
    • swap-label: replaces top label with a specified new label; this passes a packet along an LSP.
  • Rule priority: Specifies the rule to be used when an MPLS packet matches multiple rules.

The no mpls static and default mpls static commands delete the specified MPLS rule from running-config.

  • Commands that include only a top label tag remove all MPLS rules with the matching top label.
  • Commands with no PRIORITY parameter remove all matching routes of every metric value.

Command Mode

Global Configuration

Command Syntax

mpls static top-label top_tag [DEST_INTF] NEXTHOP_ADDR ACTION [PRIORITY]

no mpls static top-label top_tag

no mpls static top-label top_tag[DEST_INTF] NEXTHOP_ADDR ACTION [PRIORITY]

default mpls static top-label top_tag

default mpls static top-label top_tag[DEST_INTF] NEXTHOP_ADDR ACTION [PRIORITY]

Parameters

  • top_tag Top header’s label field contents. Value ranges from 0 to 1048575 (20 bits).
  • DEST_INTFSpecifies interface through which NEXTHOP_ADDR is accessed. Options include:

    • <no parameter> Any interface.
    • ethernet e_num Ethernet interface specified by e_num.
    • loopback l_num Loopback interface specified by l_num.
    • management m_num Management interface specified by m_num.
    • port-channel p_num Port-channel interface specified by p_num.
    • vlan v_num VLAN interface specified by v_num.
    • vxlan vx_num VXLAN interface specified by vx_num.
  • NEXTHOP_ADDR Nexthop address for MPLS for filtered MPLS packets. Options include:

    • ipv4_addr IPv4 address.
    • ipv6_addr IPv6 address.
  • ACTION MPLS header stack management action performed on packet. Options include:

    • pop payload-type ipv4 Removes top layer from stack. Payload is handled as IPv4 packet.
    • pop payload-type ipv6 Removes top layer from stack. Payload is handled as IPv6 packet.
    • swap-label <0 to 1048575> Replaces header label with specified label value (20 bits).
  • PRIORITY Specifies rule priority when multiple rules match a packet. Options include:

    • <no parameter> Assigns a metric value of 100 to the rule.
    • metric <1 to 255> Lower values denote higher priority. Value ranges from 1 to 255.

The mpls static command does not support push label actions.

Examples:

  • These commands create an MPLS rule that matches packets with a top label value of 3400 and causes the removal of the top label from the header stack. The nexthop destination of the IPv4 payload is IP address 10.14.4.4 through Ethernet interface 3/3/3. This rule has a metric value of 100.
    switch(config)#mpls static top-label 3400 ethernet 3/3/3 10.14.4.4 pop 
    payload-type ipv4
    switch(config)#show running-config
    
    !
    mpls static top-label 3400 Ethernet3/3/3 10.14.4.4 pop payload-type ipv4
    !
    
    end
    switch(config)#
    
  • These commands create a backup rule that forwards the packet through Ethernet interface 4/3. This rule’s metric value of 150 assigns it backup status prior to the first rule.
    switch(config)#mpls static top-label 3400 ethernet 4/3 10.14.4.4 pop payload-type 
    ipv4 metric 150
    switch(config)#show running-config
    
    !
    mpls static top-label 3400 Ethernet4/3 10.14.4.4 pop payload-type ipv4 metric 150
    mpls static top-label 3400 Ethernet3/3/3 10.14.4.4 pop payload-type ipv4
    !
    
    <-------OUTPUT OMITTED FROM EXAMPLE-------->
    end
    switch(config)#
    
  • These commands create an MPLS rule that forwards the packet to the nexthop address through any interface.
    switch(config)#mpls static top-label 4400 10.15.46.45 pop payload-type ipv4
    switch(config)#show running-config
    
     <-------OUTPUT OMITTED FROM EXAMPLE-------->
    
    !
    mpls static top-label 3400 Ethernet4/3 10.14.4.4 pop payload-type ipv4 metric 150
    mpls static top-label 3400 Ethernet3/3/3 10.14.4.4 pop payload-type ipv4
    mpls static top-label 4400 10.15.46.45 pop payload-type ipv4
    !
    
    end
    switch(config)#
    

show mpls route summary

The show mpls route summary command displays statistics about the configuration and implementation of MPLS rules.

Command Mode

EXEC

Command Syntax

show mpls route summary

Example:

This command displays a summary of MPLS rule implementation.
switch>show mpls route summary
Number of Labels: 1 (1 unprogrammed)
Number of adjacencies in hardware: 0
Number of backup adjacencies: 2
switch>

show mpls route

The show mpls config route command displays the switch’s MPLS static rule configuration for the specified routes and rules.

Command Mode

EXEC

Command Syntax

show mpls [INFO_LEVEL] route [header_label]

Parameters
  • INFO_LEVEL Specifies the filters that are used to select the routes to display. Options include:
    • <no parameter> Displays routes published by the forwarding agent.
    • config Displays all configured routes.
    • lfib Displays routes stored to the Label Forwarding Information Base (LFIB).
  • header_label Filters routes by MPLS top header label. Options include:
    • <no parameter> Displays routes for all header values.
    • <0 to 1048575> Specifies header for which command displays information.

Example:

This command displays the MPLS rule configuration.
switch>show mpls config route
In-LabelOut-LabelMetricPayloadNextHop
3400pop100 ipv4 10.14.4.4,Et3/3/3
3400pop150 ipv4 10.14.4.4,Et4/3
switch>
..