Configuring BGP shortcuts using next-hop MPLS

Before configuring next-hop MPLS, configure the LSPs.

To configure BGP shortcuts using next-hop MPLS, perform the following steps.

  1. In privileged EXEC mode, enter global configuration mode.
    device# configure terminal
  2. Enable BGP routing.
    device(config)# router bgp
  3. Configure the autonomous system number (ASN) in which your device resides.
    device(config-bgp-router)# local-as 10
  4. Configure the ASN for a remote neighbor.
    device(config-bgp-router)# neighbor remote-as 20
  5. Configure the ASN for a second remote neighbor.
    device(config-bgp-router)# neighbor remote-as 20
    Repeat this step for additional remote neighbors, as required.
  6. Enter BGP address-family IPv4 unicast configuration mode.
    device(config-bgp-router)# address-family ipv4 unicast
  7. Enable next-hop MPLS with the option to compare the LSP metrics.
    device(config-bgp-ipv4u)# next-hop-mpls compare-lsp-metric
    The compare-lsp-metric option enables BGP to compare the configured LSP metrics to determine which LSP has the lowest cost and is the preferred path. Without the option, BGP internally sets the cost of the LSPs with the lowest metric value to one instead of the actual value.
  8. Exit address family configuration mode.
    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
device(config-router-mpls-lsp-to2)# from
device(config-router-mpls-lsp-to2)# metric 10
device(config-router-mpls-lsp-to2)# enable
device(config-mpls)# lsp to2_sec
device(config-router-mpls-lsp-to2_sec)# no enable
device(config-router-mpls-lsp-to2_sec)# to
device(config-router-mpls-lsp-to2_sec)# from
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 remote-as 20
device(config-bgp-router)# neighbor 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

Verifying the next-hop MPLS LSPs

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          UP    UP    tnl0     1     0     2
to2_sec       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
IP Routing Table for VRF "default-vrf"

Total number of IP routes: 170

'*' denotes best ucast next-hop

'[x/y]' denotes [preference/metric] 

    *via DIRECT, Lsp 10, [200/0], 3m4s, iBgp, tag 0
    *via DIRECT, Lsp 12, [200/0], 3m4s, iBgp, tag 0