The mpls static command creates MPLS rules. MPLS
static rules identify a set of MPLS packets by a common top label and defines the
method of handling these packets.
Use the following commands to 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. Configure the next hop destination of the IPv4 payload
as the IPv4 address 10.14.4.4 using the
interface ethernet 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
interface ethernet 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
!
end
switch(config)#
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
!
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)#
Configure a static tunnel for the tunnel endpoint 64.0.0.1
and add a label 11111 to it.
switch(config)# mpls static STATIC 64.0.0.1/32 54.0.0.1 Port-Channel7 label-stack 11111
The following example shows an MPLS swap route configuration. The following command
swaps a packet with MPLS top label 3400 to
5600 for forwarding to
10.14.4.4.
switch(config)# mpls static top-label 3400 10.14.4.4 swap 5600
switch(config)#
The following example shows MPLS next-hop groups configuration for MPLS. The
following commands configures the specification of a next hop group called
TestGrp1 with two entries.
switch(config)# nexthop-group TestGrp1 type MPLS
switch(config-nexthop-group-TestGrp1)# size 2
switch(config-nexthop-group-TestGrp1)# entry 0 push label-stack 70 nexthop 10.20.30.5
switch(config-nexthop-group-TestGrp1)# entry 1 push label-stack 71 nexthop 10.20.30.6
switch(config-nexthop-group-TestGrp1)# exit
switch(config)#
The label-stack parameter accepts only one label.
Tunnel-source and ttl
commands do not apply to MPLS NexthopGroups. The nexthop entry resolves when the
entry specifies a remote next hop. The show command
indicates the resolved, directly-attached nexthop.
Display the switch’s MPLS static rule configuration for specified routes and rules
using the show mpls route.
switch# show mpls config route
In-Label Out-Label Metric Payload NextHop
3400 pop 100 ipv4 10.14.4.4,Et3/3/3
3400 pop 150 ipv4 10.14.4.4,Et4/3
switch#
Display statistics about the configuration and implementation of MPLS rules using the
show mpls route summary command.
switch# show mpls route summary
Number of Labels: 1 (1 unprogrammed)
Number of adjacencies in hardware: 0
Number of backup adjacencies: 2
switch#
The show mpls lfib route command displays the Label Forward
Information Base of the switch.
switch(config)# show mpls lfib route
MPLS forwarding table (Label [metric] Vias) - 1 routes
MPLS next-hop resolution allow default route: False
Via Type Codes:
M - MPLS via, P - Pseudowire via,
I - IP lookup via, V - VLAN via,
VA - EVPN VLAN aware via, ES - EVPN ethernet segment via,
VF - EVPN VLAN flood via, AF - EVPN VLAN aware flood via,
NG - Nexthop group via
Source Codes:
G - gRIBI, S - Static MPLS route,
B2 - BGP L2 EVPN, B3 - BGP L3 VPN,
R - RSVP, LP - LDP pseudowire,
L - LDP, M - MLDP,
IP - IS-IS SR prefix segment, IA - IS-IS SR adjacency segment,
IL - IS-IS SR segment to LDP, LI - LDP to IS-IS SR segment,
BL - BGP LU, ST - SR TE policy,
DE - Debug LFIB
S 300 [100]
via M, 192.0.2.2, swap 500
payload mpls, bypass egress-acl
interface Ethernet3/1
switch(config)#
The show ip route command displays all IP routes along with
static MPLS push routes and Next hop Group routes.
switch(config)# show ip route
VRF name: default
Codes: C - connected, S - static, K - kernel,
O - OSPF, IA - OSPF inter area, E1 - OSPF external type 1,
E2 - OSPF external type 2, N1 - OSPF NSSA external type 1,
N2 - OSPF NSSA external type2, B I - iBGP, B E - eBGP,
R - RIP, I L1 - ISIS level 1, I L2 - ISIS level 2,
O3 - OSPFv3, A B - BGP Aggregate, A O - OSPF Summary,
NG - Nexthop Group Static Route, V - VXLAN Control Service
Gateway of last resort is not set
C 192.0.2.0/24 is directly connected, Ethernet1/1
S 3.3.3.0/24 [1/0] via 192.0.2.2, Ethernet1/1 label 200
S 10.80.0.0/13 [1/0] via 172.24.0.1, Management1
S 10.95.0.0/20 [1/0] via 172.24.0.1, Management1
C 172.24.0.0/18 is directly connected, Management1
S 172.16.0.0/12 [1/0] via 172.24.0.1, Management1
switch(config)#
The MPLS push routes are static routes so the show ip route
static command also displays the output for an MPLS
Nexthop Group assuming there is a route pointing to the NexthopGroup and the entries
in the NexthopGroup are resolved. The output displays the information for
show nexthop-group TestGrp1, the test group
configured earlier.
switch(config)# show nexthop-group TestGrp1
TestGrp1
Id 2
Type MPLS
Size 2
Entries
0 push label-stack 70 nexthop 10.20.30.5
Tunnel destination directly connected, Ethernet2
52:14:a3:a6:50:e8, Ethernet2
1 push label-stack 71 nexthop 10.20.30.6
Tunnel destination directly connected, Ethernet2
52:14:a3:a6:50:e8, Ethernet2
switch(config)#