Before configuring next-hop MPLS, configure the LSPs.
To configure BGP shortcuts using next-hop MPLS, perform the following steps.
device# configure terminal
device(config)# router bgp
device(config-bgp-router)# local-as 10
device(config-bgp-router)# neighbor 10.1.1.2 remote-as 20
device(config-bgp-router)# neighbor 10.10.1.2 remote-as 20
device(config-bgp-router)# address-family ipv4 unicast
device(config-bgp-ipv4u)# next-hop-mpls compare-lsp-metric
device(config-bgp-ipv4u)# Ctrl-z
The following configuration is an example of the previous steps and includes the configuration of the LSPs and their metrics.
device(config)# router mpls device(config-router-mpls)# lsp to2 device(config-router-mpls-lsp-to2)# no enable device(config-router-mpls-lsp-to2)# to 10.1.1.2 device(config-router-mpls-lsp-to2)# from 10.1.1.1 device(config-router-mpls-lsp-to2)# metric 10 device(config-router-mpls-lsp-to2)# enable device(config-router-mpls-lsp-to2)#exit device(config-mpls)# lsp to2_sec device(config-router-mpls-lsp-to2_sec)# no enable device(config-router-mpls-lsp-to2_sec)# to 10.10.1.2 device(config-router-mpls-lsp-to2_sec)# from 10.10.1.1 device(config-router-mpls-lsp-to2_sec)# metric 10 device(config-router-mpls-lsp-to2_sec)# enable device(config-router-mpls-lsp-to2_sec)# exit device(config-router-mpls)# exit device(config)# router bgp device(config-bgp-router)# local-as 10 device(config-bgp-router)# neighbor 10.1.1.2 remote-as 20 device(config-bgp-router)# neighbor 10.10.1.2 remote-as 20 device(config-bgp-router)# address-family ipv4 unicast device(config-bgp-ipv4u)# next-hop-mpls compare-lsp-metric device(config-bgp-ipv4u)# Ctrl-z
The show mpls lsp command verifies the configuration of the LSPs.
device# show mpls lsp LSP To Admin Oper Tunnel Up/Dn Retry Active Name Address State State Intf Times Num Path to2 10.1.1.2 UP UP tnl0 1 0 2 to2_sec 10.10.1.2 UP UP tnl2 1 0 3
Enter the show ip route command to verify that the LSPs are in the routing table. For example:
device# show ip route 111.111.111.0 IP Routing Table for VRF "default-vrf" Total number of IP routes: 170 '*' denotes best ucast next-hop '[x/y]' denotes [preference/metric] 111.111.111.0/24 *via DIRECT, Lsp 10, [200/0], 3m4s, iBgp, tag 0 *via DIRECT, Lsp 12, [200/0], 3m4s, iBgp, tag 0