Next-Hop Resolution for Labeled BGP Routes

This chapter describes Next-Hop Resolution for Labeled BGP Routes.

Topics in this chapter include:

Applicability

This chapter was initially written for SR OS Release 15.0.R7, but the CLI in the current edition is based on SR OS Release 22.10.R3.

Overview

BGP routes with the VPN-IPv4, VPN-IPv6, labeled IPv4, and labeled IPv6 address families are BGP routes whose Network Layer Reachability Information (NLRI) contains an MPLS label that is mapped to the route. BGP advertises labels that subsequently are used in the data plane for MPLS forwarding. BGP labeled routes are fundamental to IP VPN services, 6PE services, inter-AS connectivity, and seamless MPLS network segmentation. When a BGP speaker receives a BGP labeled route, it has the following options for resolving the next hop (NH) of the route:

  • It can resolve the NH to an MPLS tunnel, such as an LDP or RSVP tunnel. In this case, the router pushes a transport label on top of the BGP label and allows the BGP labeled packet to be transported to the NH router over a set of intermediate routers that lack context for forwarding using the BGP label.

  • It can resolve the NH to a local interface if the NH is an address on a local subnet. No additional labels need to be pushed onto the top of the label stack.

  • It can resolve the NH using a static route and no additional label needs to be pushed. BGP NH resolution using a static route is useful in the following cases:

    • The static route has a blackhole NH in an intentional Remotely Triggered Blackhole (RTBH) scenario. Blackholed static routes are used for BGP NH resolution even when the configuration does not allow BGP NH resolution using static routes.

    • The static route has a NH address of a loopback interface of a directly connected peer. By default, this option is disabled.

  • It can resolve the NH using the Longest Prefix Match (LPM) in the route table with static routes, OSPF, IS-IS, and RIP routes. This is applicable for route reflectors (RRs) that are not in the data path, so they do not need to have tunnels. By default, this option is disabled.

NH resolution of BGP routes using tunnels is the same for eBGP and iBGP routes, and for VPN IP routes and label-unicast routes. The common NH resolution logic uses the following routes in order of preference:

  1. Local or direct routes

  2. Non-default static routes

    • Blackholed static routes

    • Non-blackholed non-default static routes, if allowed

  3. Route Table Manager (RTM) routes (including static, OSPF, IS-IS, and RIP), if allowed—only for RRs

    • When enabled, no routes are installed in the Forwarding Information Base (FIB) and no tunnels can be used.

  4. Tunnels

NH resolution using a local (interface) or direct route

If possible, the BGP NH is resolved to a local interface route.

If the BGP NH is an IPv4-mapped IPv6 address in ::ffff:a.b.c.d format, the system first tries to find a local route matching the IPv6 address. When no match is found, the system tries to find a local route matching the extracted IPv4 address a.b.c.d.

NH resolution using a non-default static route

If the BGP NH is an IPv4 address, the system looks for the non-default IPv4 static route that is the LPM of the address.

  • If the LPM static route is blackholed, this static route is used, regardless of the allow-static command configuration.

  • If the LPM static route is not blackholed, the static route is only used when the allow-static command is configured.

If the BGP NH is an IPv4-mapped IPv6 address in the ::ffff:a.b.c.d format, the system first tries to find the non-default static route that is the LPM of the full IPv6 address.

If no matching IPv6 static route is found, the system tries to find the non-default IPv4 route that is the LPM of the extracted IPv4 address a.b.c.d.

NH resolution using any type of route in the RTM—only on RR

This is only applicable for RRs that are not in the data path and configured with the rr-use-route-table and disable-route-table-install commands. The considered routes in the RTM can be static, OSPF, IS-IS, or RIP.

If the BGP NH is an IPv4 address, the system searches the IPv4 RTM route that is the LPM of the address.

If the BGP NH is an IPv4-mapped IPv6 address in ::ffff:a.b.c.d format, the system first searches for the IPv6 route that is the LPM of the full IPv6 address. If no match is found, the system searches for an RTM route matching the extracted IPv4 address a.b.c.d.

NH resolution using a tunnel in the Tunnel Table Manager (TTM)

If the BGP NH is an IPv4 address, the TTM selects the tunnel table entry that matches the address prefix with the lowest preference and allowed by the applicable resolution filter. If the preference is the same, the tunnel table entry with the best metric is chosen, and so on.

If the BGP NH is an IPv4-mapped IPv6 address in ::ffff:a.b.c.d format, the system searches the most preferred TTM tunnel matching the extracted IPv4 address a.b.c.d that is allowed by the applicable resolution filter.

Configuration

Example topology shows the example topology with three routers in AS 64496 and two routers in AS 64500.

Figure 1. Example topology

The initial configuration includes the following:

  • Cards, MDAs, ports

  • Router interfaces between the PEs

  • IS-IS as IGP between the PEs within an AS, not between ASBRs PE-2 and PE-4

  • LDP between the PE-1 and PE-2 in AS 64496 (not to the RR PE-3) and between PE-4 and PE-5 in AS 64500

The following scenarios are configured in the following sections:

NH resolution for labeled IPv4 routes

In the NH resolution for inter-AS VPRN model C section, inter-AS VPRNs are configured, as described in the VPRN Inter-AS VPRN Model C chapter. Within each AS, the PEs advertise their system addresses (192.0.2.x) as labeled IPv4 routes. The configuration of the export policy is as follows:

# on all PEs:
configure
    router
        policy-options
            begin
            prefix-list "PE-sys"
                prefix 192.0.2.0/28 prefix-length-range 32-32
            exit
            policy-statement "export-bgp"
                entry 10
                    from
                        protocol direct
                        prefix-list "PE-sys"
                    exit
                    to
                        protocol bgp-label
                    exit
                    action accept
                    exit
                exit
            exit
            commit
        exit all

Within each AS, BGP group "iBGP" is configured for the VPN-IPv4, VPN-IPv6, and label-IPv4 address families. In AS 64496, PE-3 is configured as RR. The initial BGP configuration on PE-3 is as follows:

# on PE-3:
configure
    router
        bgp
            split-horizon
            group "iBGP"
                peer-as 64496
                advertise-inactive
                cluster 192.0.2.3
                neighbor 192.0.2.1
                    family vpn-ipv4 vpn-ipv6 label-ipv4
                exit
                neighbor 192.0.2.2
                    family label-ipv4
                exit
            exit
        exit all

Between the Autonomous System Border Routers (ASBRs) PE-2 and PE-4, BGP is configured for the label-IPv4 address family only. The initial configuration for the eBGP peering uses the interface address of the remote ASBR (such as 192.168.24.2), which is the standard way for eBGP peering between ASBRs. However, for demonstration purposes, loopback addresses are configured later.

The BGP labeled routes for the system IP addresses are not used within an AS because IGP routes are preferred by the RTM, so they are inactive. However, BGP exports these inactive routes to the ASBR peer in the remote AS (advertise-inactive) where these routes are used. The initial BGP configuration on PE-2 is as follows:

# on PE-2:
configure
    router
        bgp
            split-horizon
            group "iBGP"
                peer-as 64496
                family label-ipv4
                advertise-inactive
                neighbor 192.0.2.3
                exit
            exit
            group "eBGP4_local"
                family label-ipv4
                advertise-inactive
                neighbor 192.168.24.2
                    peer-as 64500
                exit
            exit
        exit all

The default BGP NH resolution does not allow static routes and the only transport tunnel type that can be used for labeled IPv4 routes is LDP:

*A:PE-2# configure router bgp next-hop-resolution labeled-routes
*A:PE-2>config>router>bgp>next-hop-res>lbl-routes# info detail | match "allow-static"
no allow-static
*A:PE-2>config>router>bgp>next-hop-res>lbl-routes# info detail | match "family label-ipv4" post-lines 16
                family label-ipv4
                    resolution-filter
                        ldp
                        ---snip---
                        no bgp
                        ---snip---

Labeled IPv4 BGP NH resolved to local route

The route table on PE-2 shows that the route to 192.0.2.5 on PE-5 is a BGP labeled IPv4 route with NH 192.168.24.2:

*A:PE-2# show router route-table 192.0.2.5/32

===============================================================================
Route Table (Router: Base)
===============================================================================
Dest Prefix[Flags]                            Type    Proto     Age        Pref
      Next Hop[Interface Name]                                    Metric
-------------------------------------------------------------------------------
192.0.2.5/32                                  Remote  BGP_LABEL 00h03m04s  170
       192.168.24.2                                                 0
-------------------------------------------------------------------------------
No. of Routes: 1
---snip---
===============================================================================

To verify that BGP NH resolution prefers local routes over static routes (if allow-static is enabled), the following is configured on the ASBRs. For the following static routes between PE-2 and PE-4, additional loopback addresses and a static route to the loopback address on the eBGP peer are configured. The configuration on ASBR PE-2 is as follows:

# on PE-2:
configure
    router
        interface "loopback"
            address 10.0.0.2/32
            loopback
        exit
        static-route-entry 10.0.0.4/32
            next-hop 192.168.24.2
                no shutdown
            exit
        exit
    exit all

On PE-2, the following additional eBGP group for the label IPv4 address family is configured and the BGP NH resolution for labeled routes is configured to allow static routes. The eBGP peer is only one hop away, so a multihop command is not required.

# on PE-2:
configure
    router
        bgp
            next-hop-resolution
                labeled-routes
                    allow-static
                exit
            exit
            group "eBGP4_static"
                neighbor 10.0.0.4
                    peer-as 64500
                    family label-ipv4
                    advertise-inactive
                    local-address 10.0.0.2
                exit
            exit
        exit all

Another static route is configured to the system IP address of the eBGP peer with preference 25 to ensure that this static route is not preferred over the preceding static route with default preference 5. LDP is enabled on the interface between the ASBRs, such as "int-PE-2-PE-4" on PE-2. This makes it possible to resolve the BGP NH to an LDP tunnel. Also, an additional BGP group is configured for the labeled IPv4 address family to the system IP address of the eBGP peer, such as 192.0.2.4. The configuration on PE-2 is as follows:

# on PE-2:
configure
    router
        static-route-entry 192.0.2.4/32
            next-hop 192.168.24.2
                preference 25
                no shutdown
            exit
        exit
        ldp
            interface-parameters
                interface "int-PE-2-PE-4" dual-stack
                    ipv4
                        no shutdown
                    exit
                    no shutdown
                exit
            exit
        exit
        bgp
            group "eBGP4_tunnel"
                neighbor 192.0.2.4
                    peer-as 64500
                    family label-ipv4
                    advertise-inactive
                exit
            exit
        exit
    exit all

This additional configuration does not result in a BGP NH resolution to an LDP tunnel, because the destination can also be reached via a static route, which is preferred. In the Labeled IPv4 BGP NH resolved to tunneled route section, the configuration is modified to exclude static routes from the NH resolution.

The following FIB on PE-2 shows that a labeled BGP route with resolved NH 192.168.24.2 is used for prefix 192.0.2.5/32. The BGP NH is not resolved to a tunnel.

*A:PE-2# show router fib 1 192.0.2.5/32

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
192.0.2.5/32                                                BGP_LABEL
  192.168.24.2 (int-PE-2-PE-4)
-------------------------------------------------------------------------------
Total Entries : 1
-------------------------------------------------------------------------------
===============================================================================

PE-2 has three labeled IPv4 BGP routes for prefix 192.0.2.5/32: the first route with local NH 192.168.24.2 (which is best and used), the second route with NH 10.0.0.4/32 (which can be reached via a static route), and the third route with NH 192.0.2.4 (which can be reached via a less preferred static route):

*A:PE-2# show router bgp routes 192.0.2.5/32 label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  192.0.2.5/32                                       None        None
      192.168.24.2                                       None        0
      64500                                                          524284
*i    192.0.2.5/32                                       None        None
      10.0.0.4                                           None        1
      64500                                                          524284
*i    192.0.2.5/32                                       None        None
      192.0.2.4                                          None        1
      64500                                                          524284
-------------------------------------------------------------------------------
Routes : 3
===============================================================================

Default preferences in route table shows the default preferences in a route table. These preferences are configurable, except for the direct attached routes, which always have preference 0.

Table 1. Default preferences in route table

Route type

Preference

Direct Attached

0

Static

5

OSPF Internal

10

IS-IS Level 1 Internal

15

IS-IS Level 2 Internal

18

RIP

100

OSPF External

150

IS-IS Level 1 External

160

IS-IS Level 2 External

165

BGP

170

The following shows the BGP NHs with the resolving prefix and the resolved NH. On PE-2, all three NHs of the labeled IPv4 routes for prefix 192.0.2.5/32 have resolved NH 192.168.24.2. NH 192.168.24.2 has owner local and preference 0; NH 10.0.0.4 has owner static and default preference 5; NH 192.0.2.4 has owner static and preference 25 by configuration.

*A:PE-2# show router bgp next-hop
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================

===============================================================================
BGP Next Hop
===============================================================================
Next Hop                                                    Pref     Owner
   Resolving Prefix                                         FibProg  Metric
   Resolved Next Hop                                        Colored  Ref. Count
   Admin-tag-policy                                         FlexAlgo Last Mod.
-------------------------------------------------------------------------------
10.0.0.4                                                    5        STATIC
   10.0.0.4/32                                              N        1
   192.168.24.2                                             N        0
   --                                                       --       00h18m40s
192.0.2.3                                                   15       ISIS
   192.0.2.3/32                                             N        10
   192.168.23.2                                             N        0
   --                                                       --       00h25m47s
192.0.2.4                                                   25       STATIC
   192.0.2.4/32                                             N        1
   192.168.24.2                                             N        0
   --                                                       --       00h18m07s
192.168.24.2                                                0        LOCAL
   192.168.24.0/30                                          N        0
   192.168.24.2                                             N        0
   --                                                       --       00h25m47s
-------------------------------------------------------------------------------
Next Hops : 4
===============================================================================

Labeled IPv4 BGP NH resolved to non-default static route

When the BGP group "eBGP4_local" is disabled, the BGP NH can no longer be resolved to a local route. On the ASBRs PE-2 and PE-4, the following command disables the BGP group:

# on PE-2, PE-4:
configure
    router
        bgp
            group "eBGP4_local"
                shutdown
            exit all

The FIB on PE-2 shows that the route to prefix 192.0.2.5/32 is a labeled BGP route with resolved NH 192.168.24.2. This looks identical to the preceding output for the FIB when the BGP NH could be resolved to a local route, but in this case, the BGP NH is resolved to a non-default static route, as is shown later.

*A:PE-2# show router fib 1 192.0.2.5/32

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
192.0.2.5/32                                                BGP_LABEL
  192.168.24.2 (int-PE-2-PE-4)
-------------------------------------------------------------------------------
Total Entries : 1
-------------------------------------------------------------------------------
===============================================================================

PE-2 now has only two valid labeled IPv4 BGP routes instead of three: the best and used route has NH 10.0.0.4 and the less preferred route has NH 192.0.2.4:

*A:PE-2# show router bgp routes 192.0.2.5/32 label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  192.0.2.5/32                                       None        None
      10.0.0.4                                           None        1
      64500                                                          524284
*i    192.0.2.5/32                                       None        None
      192.0.2.4                                          None        1
      64500                                                          524284
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

On PE-2, NH 10.0.0.4 and NH 192.0.2.4 are both resolved to NH 192.168.24.2. NH 10.0.0.4 has preference 5, which is better than the configured preference 25 for NH 192.0.2.4.

*A:PE-2# show router bgp next-hop
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================

===============================================================================
BGP Next Hop
===============================================================================
Next Hop                                                    Pref     Owner
   Resolving Prefix                                         FibProg  Metric
   Resolved Next Hop                                        Colored  Ref. Count
   Admin-tag-policy                                         FlexAlgo Last Mod.
-------------------------------------------------------------------------------
10.0.0.4                                                    5        STATIC
   10.0.0.4/32                                              N        1
   192.168.24.2                                             N        0
   --                                                       --       00h30m21s
192.0.2.3                                                   15       ISIS
   192.0.2.3/32                                             N        10
   192.168.23.2                                             N        0
   --                                                       --       00h37m28s
192.0.2.4                                                   25       STATIC
   192.0.2.4/32                                             N        1
   192.168.24.2                                             N        0
   --                                                       --       00h29m48s
-------------------------------------------------------------------------------
Next Hops : 3
===============================================================================

When the preferred static route with NH 10.0.0.4 becomes unavailable, the other static route takes over. The following command disables the static route with NH 10.0.0.4 on PE-2.

# on PE-2:
configure
    router
        static-route-entry 10.0.0.4/32
            next-hop 192.168.24.2
                shutdown
            exit all

The FIB on PE-2 shows a labeled BGP route with resolved NH 192.168.24.2. Again, this FIB entry looks identical. The BGP NH is not resolved to a tunnel.

*A:PE-2# show router fib 1 192.0.2.5/32

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
192.0.2.5/32                                                BGP_LABEL
  192.168.24.2 (int-PE-2-PE-4)
-------------------------------------------------------------------------------
Total Entries : 1
-------------------------------------------------------------------------------
===============================================================================

On PE-2, the best and used labeled BGP route for prefix 192.0.2.5/32 has NH 192.0.2.4. The BGP route for prefix 192.0.2.5/32 with NH 10.0.0.4 is not valid, because the static route to 10.0.0.4/32 is disabled.

*A:PE-2# show router bgp routes 192.0.2.5/32 label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  192.0.2.5/32                                       None        None
      192.0.2.4                                          None        1
      64500                                                          524284
i     192.0.2.5/32                                       None        None
      10.0.0.4                                           None        0
      64500                                                          524284
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

On PE-2, NH 10.0.0.4 is not resolved, because the static route is disabled. NH 192.0.2.4 has resolved NH 192.168.24.2:

*A:PE-2# show router bgp next-hop
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================

===============================================================================
BGP Next Hop
===============================================================================
Next Hop                                                    Pref     Owner
   Resolving Prefix                                         FibProg  Metric
   Resolved Next Hop                                        Colored  Ref. Count
   Admin-tag-policy                                         FlexAlgo Last Mod.
-------------------------------------------------------------------------------
10.0.0.4                                                    -        -
   Unresolved                                                        -
   --                                                                -
   --                                                                00h22m54s
192.0.2.3                                                   15       ISIS
   192.0.2.3/32                                             N        10
   192.168.23.2                                             N        0
   --                                                       --       01h05m18s
192.0.2.4                                                   25       STATIC
   192.0.2.4/32                                             N        1
   192.168.24.2                                             N        0
   --                                                       --       00h57m38s
-------------------------------------------------------------------------------
Next Hops : 3
===============================================================================

The configuration on ASBR PE-2 is restored as follows and the BGP NH is resolved to the static route to 10.0.0.4 again:

# on PE-2:
configure
    router
        static-route-entry 10.0.0.4/32
            next-hop 192.168.24.2
                no shutdown
            exit all

Labeled IPv4 BGP NH resolved to tunneled route

When the system does not allow BGH NH resolution to static routes, the tunneled route is selected. The following command configures BGP NH resolution for labeled routes to its default setting:

# on PE-2:
configure
    router
        bgp
            next-hop-resolution
                labeled-routes
                    no allow-static
                exit all

On PE-2, the route table shows that the BGP labeled IPv4 route to 192.0.2.5/32 has NH 192.0.2.4, which is resolved to a tunnel:

*A:PE-2# show router route-table 192.0.2.5/32

===============================================================================
Route Table (Router: Base)
===============================================================================
Dest Prefix[Flags]                            Type    Proto     Age        Pref
      Next Hop[Interface Name]                                    Metric
-------------------------------------------------------------------------------
192.0.2.5/32                                  Remote  BGP_LABEL 00h01m22s  170
       192.0.2.4 (tunneled)                                         1
-------------------------------------------------------------------------------
No. of Routes: 1
---snip---
===============================================================================

On PE-2, the following FIB shows that the BGP labeled route uses an LDP tunnel to the NH 192.0.2.4:

*A:PE-2# show router fib 1 192.0.2.5/32

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
192.0.2.5/32                                                BGP_LABEL
  192.0.2.4 (Transport:LDP)
-------------------------------------------------------------------------------
Total Entries : 1
-------------------------------------------------------------------------------
===============================================================================

PE-2 has two labeled BGP routes to prefix 192.0.2.5/32: the route with NH 10.0.0.4 is not valid because it requires a static route, which is not allowed for BGP NH resolution; the best and used route has NH 192.0.2.4 (which is the NH that is reached by an LDP tunnel):

*A:PE-2# show router bgp routes 192.0.2.5/32 label-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  192.0.2.5/32                                       None        None
      192.0.2.4                                          None        1
      64500                                                          524284
i     192.0.2.5/32                                       None        None
      10.0.0.4                                           None        0
      64500                                                          524284
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

On PE-2, the following BGP NH list shows that NH 192.0.2.4 is resolved using a static route with NH 192.168.24.2:

*A:PE-2# show router bgp next-hop
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================

===============================================================================
BGP Next Hop
===============================================================================
Next Hop                                                    Pref     Owner
   Resolving Prefix                                         FibProg  Metric
   Resolved Next Hop                                        Colored  Ref. Count
   Admin-tag-policy                                         FlexAlgo Last Mod.
-------------------------------------------------------------------------------
10.0.0.4                                                    5        STATIC
   10.0.0.4/32                                              N        1
   192.168.24.2                                             N        0
   --                                                       --       00h05m07s
192.0.2.3                                                   15       ISIS
   192.0.2.3/32                                             N        10
   192.168.23.2                                             N        0
   --                                                       --       01h26m05s
192.0.2.4                                                   25       STATIC
   192.0.2.4/32                                             N        1
   192.168.24.2                                             N        0
   --                                                       --       01h18m25s
-------------------------------------------------------------------------------
Next Hops : 3
===============================================================================

The configuration on the ASBRs is modified as follows and the BGP NH is resolved to the local route, to 192.168.24.2 again. Local routes prevail over tunneled routes.

# on PE-2, PE-4:
configure 
    router 
        bgp 
            group "eBGP4_local" 
                no shutdown
            exit all

Labeled IPv4 BGP NH resolved to RTM route on RR

RR PE-3 is not in the data path and next-hop-self is disabled, which is the default setting. PE-3 does not have LDP tunnels to PE-1 and PE-2, so BGP NH resolution to RTM routes needs to be allowed, by enabling rr-use-route-table. The following error is raised when attempting to configure rr-use-route-table without disable-route-table-install:

*A:PE-3# configure router bgp next-hop-resolution labeled-routes rr-use-route-table
INFO: BGP #1001 Configuration failed because of inconsistent values - BGP [VR 1] route-table-for-label-routes cannot be set unless disable-route-table-install is set!

The command disable-route-table-install allows an RR to reflect routes without installing them in its FIB. This way, an RR can reflect more routes than it can install in its FIB.

The following configuration on RR PE-3 allows the use of the route table for labeled routes:

# on PE-3:
configure
    router
        bgp
            disable-route-table-install
            split-horizon
            next-hop-resolution
                labeled-routes
                    rr-use-route-table
                exit
            exit
            group "iBGP"
                peer-as 64496
                family vpn-ipv4 vpn-ipv6 label-ipv4
                advertise-inactive
                cluster 192.0.2.3
                neighbor 192.0.2.1
                exit
                neighbor 192.0.2.2
                exit
            exit
        exit all

The following command on RR PE-3 shows that the labeled BGP route for 192.0.2.5/32 is not used. This is because the route is not installed in the FIB of the RR, which is allowed, because the RR is not in the data path and NHS is disabled.

*A:PE-3# show router bgp routes 192.0.2.5/32 label-ipv4
===============================================================================
 BGP Router ID:192.0.2.3        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
*>i   192.0.2.5/32                                       100         None
      192.0.2.2                                          None        10
      64500                                                          524281
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

The following labeled BGP route has NH 192.0.2.2, which is resolved to an IS-IS route:

*A:PE-3# show router bgp next-hop 192.0.2.2
===============================================================================
 BGP Router ID:192.0.2.3        AS:64496       Local AS:64496
===============================================================================

===============================================================================
BGP Next Hop
===============================================================================
Next Hop                                                    Pref     Owner
   Resolving Prefix                                         FibProg  Metric
   Resolved Next Hop                                        Colored  Ref. Count
   Admin-tag-policy                                         FlexAlgo Last Mod.
-------------------------------------------------------------------------------
192.0.2.2                                                   15       ISIS
   192.0.2.2/32                                             N        10
   192.168.23.1                                             N        0
   --                                                       --       01h29m52s
-------------------------------------------------------------------------------
Next Hops : 1
===============================================================================

RR PE-3 advertises this labeled BGP route to PE-1, which installs the route in its FIB, so it is used:

*A:PE-1# show router bgp routes label-ipv4
===============================================================================
 BGP Router ID:192.0.2.1        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP LABEL-IPV4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  192.0.2.5/32                                       100         None
      192.0.2.2                                          None        10
      64500                                                          524281
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

The tunnel table on PE-1 has a BGP tunnel to 192.0.2.5 with NH 192.0.2.2 and an LDP tunnel to 192.0.2.2 with NH 192.168.12.2:

*A:PE-1# show router tunnel-table

===============================================================================
IPv4 Tunnel Table (Router: Base)
===============================================================================
Destination           Owner     Encap TunnelId  Pref   Nexthop        Metric
   Color
-------------------------------------------------------------------------------
192.0.2.2/32          ldp       MPLS  65537     9      192.168.12.2   10
192.0.2.5/32          bgp       MPLS  262146    12     192.0.2.2      1000
-------------------------------------------------------------------------------
---snip---
===============================================================================

On PE-1, the BGP NH for route 192.0.2.5/32 is resolved to an LDP tunnel to PE-2:

*A:PE-1# show router fp-tunnel-table 1

===============================================================================
IPv4 Tunnel Table Display

Legend:
label stack is ordered from bottom-most to top-most
B - FRR Backup
===============================================================================
Destination                                  Protocol         Tunnel-ID
  Lbl/SID
    NextHop                                                   Intf/Tunnel
  Lbl/SID (backup)
    NextHop   (backup)
-------------------------------------------------------------------------------
192.0.2.2/32                                 LDP               -
  524287
    192.168.12.2                                             1/1/c1/1:100
192.0.2.5/32                                 BGP               -
  524281
    192.0.2.2                                                LDP
-------------------------------------------------------------------------------
Total Entries : 2
-------------------------------------------------------------------------------
===============================================================================

NH resolution for iBGP VPN-IPv4/v6 routes

VPRN 1 in AS 64496 shows that VPRN 1 is configured on PE-1 and PE-2 in AS 64496.

Figure 2. VPRN 1 in AS 64496

On both PE-1 and PE-2, the VPN-IPv4 and VPN-IPv6 address families are configured in group "iBGP":

# on PE-1, PE-2:
configure
    router
        bgp
            split-horizon
            group "iBGP"
                peer-as 64496
                export "export-bgp"
                neighbor 192.0.2.3
                    family vpn-ipv4 vpn-ipv6
                exit
            exit
        exit all

On PE-1, VPRN 1 is configured as follows. The configuration on PE-2 is similar.

# on PE-1:
configure
    service
        vprn 1 name "VPRN 1" customer 1 create
            bgp-ipvpn
                mpls
                    route-distinguisher 64496:1
                    vrf-target target:64496:1
                    auto-bind-tunnel
                        resolution filter
                        resolution-filter
                            ldp
                        exit
                    exit
                    no shutdown
                exit
            exit
            interface "loopback1" create
                loopback
                address 1.1.1.1/32
                ipv6
                    address 2001:db8::1:1:1:1/128
                exit
            exit
            no shutdown
        exit
    exit all

Even though only LDP is explicitly configured in the auto-bind tunnel resolution filter, the resolution filter allows LDP and BGP tunnels:

*A:PE-1# configure service vprn 1 
*A:PE-1>config>service>vprn$             info detail | match "auto-bind-tunnel" post-lines 19 
                    auto-bind-tunnel
                        resolution-filter
                            ---snip---
                            ldp
                            ---snip---
                            bgp
                            ---snip---

VPRN 1 is only configured on nodes in AS 64496, so only LDP transport tunnels are used. The following tunnel table on PE-2 shows that an LDP tunnel toward PE-1 is available:

*A:PE-2# show router tunnel-table 192.0.2.1

===============================================================================
IPv4 Tunnel Table (Router: Base)
===============================================================================
Destination           Owner     Encap TunnelId  Pref   Nexthop        Metric
   Color
-------------------------------------------------------------------------------
192.0.2.1/32          ldp       MPLS  65537     9      192.168.12.1   10
-------------------------------------------------------------------------------
---snip---
===============================================================================

PE-2 receives the following BGP VPN-IPv4 route with route distinguisher (RD) 64496:1 used in VPRN 1:

*A:PE-2# show router bgp routes vpn-ipv4 rd 64496:1
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP VPN-IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  64496:1:1.1.1.1/32                                 100         None
      192.0.2.1                                          None        10
      No As-Path                                                     524283
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

For iBGP VPN routes on a node that is not an RR, the NH can only be resolved using a tunnel in the TTM. If the BGP NH is an IPv4 address, the system uses the most preferred tunnel matching the address and allowed by the resolution filter. The resolution filter allows LDP and BGP, but within an AS, only LDP tunnels are used. The following FIB for VPRN 1 on PE-2 shows that the transport tunnel to NH 192.0.2.1 is an LDP tunnel:

*A:PE-2# show router 1 fib 1

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
1.1.1.1/32                                                  BGP_VPN
  192.0.2.1 (VPRN Label:524283 Transport:LDP)
2.2.2.1/32                                                  LOCAL
  2.2.2.1 (loopback1)
-------------------------------------------------------------------------------
Total Entries : 2
-------------------------------------------------------------------------------
===============================================================================

The same is shown for BGP IPv6 routes:

*A:PE-2# show router bgp routes vpn-ipv6 rd 64496:1
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP VPN-IPv6 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  64496:1:2001:db8::1:1:1:1/128                      100         None
      ::ffff:192.0.2.1                                   None        10
      No As-Path                                                     524283
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

The following IPv6 FIB for VPRN 1 shows that a LDP tunnel is used to reach NH 192.0.2.1:

*A:PE-2# show router 1 fib 1 ipv6

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
2001:db8::1:1:1:1/128                                       BGP_VPN
  192.0.2.1 (VPRN Label:524283 Transport:LDP)
2001:db8::2:2:2:1/128                                       LOCAL
  2001:db8::2:2:2:1 (loopback1)
-------------------------------------------------------------------------------
Total Entries : 2
-------------------------------------------------------------------------------
===============================================================================

NH resolution for inter-AS VPRN model B

VPRN 2 in AS 64496 and in AS 64500 shows that VPRN 2 is configured in AS 64496 and in AS 64500.

Figure 3. VPRN 2 in AS 64496 and in AS 64500

On PE-2, VPRN 2 is configured as follows. The service configuration on PE-4 is similar.

# on PE-2:
configure
    service
        vprn 2 name "VPRN 2" customer 1 create
            bgp-ipvpn
                mpls
                    route-distinguisher 2:2
                    vrf-target target:2:2
                    auto-bind-tunnel
                        resolution filter
                        resolution-filter
                            ldp
                        exit
                    exit
                    no shutdown
                exit
            exit
            interface "loopback2" create
                loopback
                address 2.2.2.2/32
                ipv6
                    address 2001:db8::2:2:2:2/128
                exit
            exit
            no shutdown
        exit
    exit all

BGP is configured for the VPN IP address families and BGP NH can be resolved to static routes. Multiple eBGP neighbors are defined, with NHs that can be resolved to a local, static, or tunneled route. The BGP configuration on PE-2 is as follows. The BGP configuration on PE-4 is similar.

# on PE-2:
configure
    router
        bgp
            enable-inter-as-vpn
            split-horizon
            rapid-update vpn-ipv4 vpn-ipv6 label-ipv4
            next-hop-resolution
                labeled-routes
                    allow-static
                exit
            exit
            group "eBGP4_local"
                neighbor 192.168.24.2
                    peer-as 64500
                    family vpn-ipv4 vpn-ipv6
                exit
            exit
            group "eBGP4_static"
                neighbor 10.0.0.4
                    peer-as 64500
                    family vpn-ipv4 vpn-ipv6
                    local-address 10.0.0.2
                exit
            exit
            group "eBGP4_tunnel"
                neighbor 192.0.2.4
                    peer-as 64500
                    family vpn-ipv4 vpn-ipv6
                exit
            exit
            no shutdown
        exit all

VPN IP NH resolved to local route

PE-2 has three BGP VPN-IPv4 routes for prefix 4.4.4.2/32. The used route is NH 192.168.24.2, which is a local route.

*A:PE-2# show router bgp routes 4.4.4.2/32 vpn-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP VPN-IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  2:2:4.4.4.2/32                                     None        None
      192.168.24.2                                       None        0
      64500                                                          524285
*i    2:2:4.4.4.2/32                                     None        None
      10.0.0.4                                           None        1
      64500                                                          524285
*i    2:2:4.4.4.2/32                                     None        None
      192.0.2.4                                          None        1
      64500                                                          524285
-------------------------------------------------------------------------------
Routes : 3
===============================================================================

The IPv4 FIB on PE-2 shows prefix 4.4.4.2/32 with NH 192.168.24.2 on int-PE-2-PE-4. The NH is not resolved to a tunnel.

*A:PE-2# show router 2 fib 1

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
2.2.2.2/32                                                  LOCAL
  2.2.2.2 (loopback2)
4.4.4.2/32                                                  BGP_VPN
  192.168.24.2 (int-PE-2-PE-4)
-------------------------------------------------------------------------------
Total Entries : 2
-------------------------------------------------------------------------------
===============================================================================

In a similar way, the used VPN-IPv6 route on PE-2 has a NH resolved to a local route:

*A:PE-2# show router bgp routes 2001:db8::4:4:4:2/128 vpn-ipv6
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP VPN-IPv6 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  2:2:2001:db8::4:4:4:2/128                          None        None
      ::ffff:192.168.24.2                                None        0
      64500                                                          524285
*i    2:2:2001:db8::4:4:4:2/128                          None        None
      ::ffff:10.0.0.4                                    None        1
      64500                                                          524285
*i    2:2:2001:db8::4:4:4:2/128                          None        None
      ::ffff:192.0.2.4                                   None        1
      64500                                                          524285
-------------------------------------------------------------------------------
Routes : 3
===============================================================================

VPN IP NH resolved to static route

When the eBGP session using the interface addresses is disabled, the next preferred NH resolution is static, which is allowed by configuration:

# on PE-2:
configure
    router
        bgp
            group "eBGP4_local"
                shutdown
            exit all

On PE-2, the static route with the best preference is toward 10.0.0.4:

*A:PE-2# show router bgp routes 4.4.4.2/32 vpn-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP VPN-IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  2:2:4.4.4.2/32                                     None        None
      10.0.0.4                                           None        1
      64500                                                          524285
*>i   2:2:4.4.4.2/32                                     None        None
      192.0.2.4                                          None        1
      64500                                                          524285
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

On PE-2, NH 10.0.0.4 is resolved to 192.168.24.2:

*A:PE-2# show router bgp next-hop
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================

===============================================================================
BGP Next Hop
===============================================================================
Next Hop                                                    Pref     Owner
   Resolving Prefix                                         FibProg  Metric
   Resolved Next Hop                                        Colored  Ref. Count
   Admin-tag-policy                                         FlexAlgo Last Mod.
-------------------------------------------------------------------------------
10.0.0.4                                                    5        STATIC
   10.0.0.4/32                                              N        1
   192.168.24.2                                             N        0
   --                                                       --       00h27m46s
192.0.2.4                                                   25       STATIC
   192.0.2.4/32                                             N        1
   192.168.24.2                                             N        0
   --                                                       --       01h41m04s
-------------------------------------------------------------------------------
Next Hops : 2
===============================================================================

This resolved NH 192.168.24.2 is the NH for prefix 4.4.4.2/32 in the FIB:

*A:PE-2# show router 2 fib 1

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
2.2.2.2/32                                                  LOCAL
  2.2.2.2 (loopback2)
4.4.4.2/32                                                  BGP_VPN
  192.168.24.2 (int-PE-2-PE-4)
-------------------------------------------------------------------------------
Total Entries : 2
-------------------------------------------------------------------------------
===============================================================================

For IPv6 routes on PE-2, the used route toward 2001:db8::4:4:4:2/128 has NH ::ffff:10.0.0.4:

*A:PE-2# show router bgp routes 2001:db8::4:4:4:2/128 vpn-ipv6
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP VPN-IPv6 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  2:2:2001:db8::4:4:4:2/128                          None        None
      ::ffff:10.0.0.4                                    None        1
      64500                                                          524285
*>i   2:2:2001:db8::4:4:4:2/128                          None        None
      ::ffff:192.0.2.4                                   None        1
      64500                                                          524285
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

VPN IP NH resolved to tunneled route

Note:

This scenario is only for demonstration purposes. In an operational service provider network, no LDP sessions are established to an untrusted AS (inter-AS VPRN model B is used for untrusted connections).

When the BGP configuration is changed to the default setting that static routes are not allowed for the NH resolution, the used BGP route toward 4.4.4.2/32 uses a tunnel toward the system address of the eBGP peer. The BGP configuration is modified as follows:

# on PE-2:
configure 
    router 
        bgp 
            next-hop-resolution 
                labeled-routes 
                    no allow-static
                exit all

On PE-2, the used VPN-IPv4 route toward 4.4.4.2/32 has NH 192.0.2.4:

*A:PE-2# show router bgp routes 4.4.4.2/32 vpn-ipv4
===============================================================================
 BGP Router ID:192.0.2.2        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP VPN-IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  2:2:4.4.4.2/32                                     None        None
      192.0.2.4                                          None        1
      64500                                                          524285
*i    2:2:4.4.4.2/32                                     None        None
      10.0.0.4                                           None        1
      64500                                                          524285
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

The tunnel table on PE-2 shows that an LDP tunnel is available toward 192.0.2.4/32:

*A:PE-2# show router tunnel-table 192.0.2.4/32

===============================================================================
IPv4 Tunnel Table (Router: Base)
===============================================================================
Destination           Owner     Encap TunnelId  Pref   Nexthop        Metric
   Color
-------------------------------------------------------------------------------
192.0.2.4/32          ldp       MPLS  65538     9      192.168.24.2   1
-------------------------------------------------------------------------------
---snip---
===============================================================================

The following FIB on PE-2 shows that an LDP tunnel is used toward NH 192.0.2.4 to reach prefix 4.4.4.2/32:

*A:PE-2# show router 2 fib 1

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
2.2.2.2/32                                                  LOCAL
  2.2.2.2 (loopback2)
4.4.4.2/32                                                  BGP_VPN
  192.0.2.4 (VPRN Label:524285 Transport:LDP)
-------------------------------------------------------------------------------
Total Entries : 2
-------------------------------------------------------------------------------
===============================================================================

Similarly, the following IPv6 FIB on PE-2 shows that the same LDP tunnel is used toward NH 192.0.2.4 to reach prefix 2001:db8::4:4:4:2/128:

*A:PE-2# show router 2 fib 1 ipv6

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
2001:db8::2:2:2:2/128                                       LOCAL
  2001:db8::2:2:2:2 (loopback2)
2001:db8::4:4:4:2/128                                       BGP_VPN
  192.0.2.4 (VPRN Label:524285 Transport:LDP)
-------------------------------------------------------------------------------
Total Entries : 2
-------------------------------------------------------------------------------
===============================================================================

NH resolution for inter-AS VPRN model C

VPRN 3 - inter-AS VPRN model C shows the example topology with RR PE-3 in AS 64496. VPRN 3 is configured on PE-1 and PE-5.

Figure 4. VPRN 3 - inter-AS VPRN model C

A labeled IPv4 eBGP session is established between ASBRs PE-2 and PE-4, and a multi-hop eBGP session is established between PE-1 and PE-5 for the VPN-IPv4 and VPN-IPv6 address families. The following BGP configuration is configured on PE-1. The configuration on PE-5 is similar.

# on PE-1:
configure
    router
        bgp
            split-horizon
            rapid-update vpn-ipv4 vpn-ipv6 label-ipv4
            group "iBGP"
                peer-as 64496
                export "export-bgp"
                neighbor 192.0.2.3
                    family vpn-ipv4 vpn-ipv6 label-ipv4
                exit
            exit
            group "eBGP_multihop"
                peer-as 64500
                neighbor 192.0.2.5
                    family vpn-ipv4 vpn-ipv6
                    local-address 192.0.2.1
                    multihop 10
               exit
            exit
        exit
    exit all

The BGP configuration on RR PE-3 is as follows. The RR is configured with disable-route-table-install, so no routes are installed in the FIB; therefore, no eBGP multi-hop sessions can be established from the RR. The BGP NH is resolved using the RTM. Local routes would be preferred, but there are no candidates. BGP NH resolution to static routes is not allowed in this configuration.

# on PE-3:
configure
    router
        bgp
            disable-route-table-install
            split-horizon
            next-hop-resolution
                labeled-routes
                    rr-use-route-table
                exit
            exit
            group "iBGP"
                peer-as 64496
                advertise-inactive
                cluster 192.0.2.3
                neighbor 192.0.2.1
                    family vpn-ipv4 vpn-ipv6 label-ipv4
                exit
                neighbor 192.0.2.2
                    family label-ipv4
                exit
            exit
        exit all

On the ASBRs, BGP is only configured for the labeled IPv4 address family. The BGP configuration on PE-2 is as follows. The configuration on PE-4 is similar.

# on PE-2:
configure
    router
        bgp
            split-horizon
            rapid-update vpn-ipv4 vpn-ipv6 label-ipv4
            group "iBGP"
                peer-as 64496
                family label-ipv4
                advertise-inactive
                neighbor 192.0.2.3
                exit
            exit
            group "eBGP4_local"
                family label-ipv4
                advertise-inactive
                neighbor 192.168.24.2
                    peer-as 64500
                exit
            exit
        exit all

On PE-1, VPRN 3 is configured as follows. The configuration is similar on PE-5.

# on PE-1:
configure
    service
        vprn 3 name "VPRN 3" customer 1 create
            bgp-ipvpn
                mpls
                    route-distinguisher 3:3
                    vrf-target target:3:3
                    auto-bind-tunnel
                        resolution filter
                        resolution-filter
                            ldp
                        exit
                    exit
                    no shutdown
                exit
            exit
            interface "loopback3" create
                loopback
                address 1.1.1.3/32
                ipv6
                    address 2001:db8::1:1:1:3/128
                exit
            exit
            no shutdown
        exit
    exit all

With the preceding configuration, the resolution filter in VPRN 3 allows the use of LDP and BGP tunnels, which can be verified as follows. BGP tunnels are used for routes received from the peer AS.

*A:PE-1# configure service vprn 3 
*A:PE-1>config>service>vprn# info detail | match "auto-bind-tunnel" post-lines 19 
            auto-bind-tunnel
                resolution-filter
                    ---snip---
                    ldp
                    ---snip---
                    bgp
                    ---snip---

On PE-1, the VPN-IPv4 route for prefix 5.5.5.3/32 has NH 192.0.2.5 in the peer AS. Prefix 5.5.5.3/32 is the IP address of a loopback interface in VPRN 3 on PE-5.

*A:PE-1# show router bgp routes vpn-ipv4 rd 3:3
===============================================================================
 BGP Router ID:192.0.2.1        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP VPN-IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
u*>i  3:3:5.5.5.3/32                                     None        None
      192.0.2.5                                          None        0
      64500                                                          524285
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

On PE-1, the following tunnel table shows two tunnels: one LDP tunnel toward 192.0.2.2, and a BGP tunnel toward 192.0.2.5 in the remote AS.

*A:PE-1# show router tunnel-table

===============================================================================
IPv4 Tunnel Table (Router: Base)
===============================================================================
Destination           Owner     Encap TunnelId  Pref   Nexthop        Metric
   Color
-------------------------------------------------------------------------------
192.0.2.2/32          ldp       MPLS  65537     9      192.168.12.2   10
192.0.2.5/32          bgp       MPLS  262147    12     192.0.2.2      1000
-------------------------------------------------------------------------------
---snip---
===============================================================================

The following FIB for VPRN 3 on PE-1 shows that the BGP tunnel is used for prefix 5.5.5.3/32 with NH 192.0.2.5:

*A:PE-1# show router 3 fib 1

===============================================================================
FIB Display
===============================================================================
Prefix [Flags]                                              Protocol
  NextHop
-------------------------------------------------------------------------------
1.1.1.3/32                                                  LOCAL
  1.1.1.3 (loopback3)
5.5.5.3/32                                                  BGP_VPN
  192.0.2.5 (VPRN Label:524285 Transport:BGP)
-------------------------------------------------------------------------------
Total Entries : 2
-------------------------------------------------------------------------------
===============================================================================

On RR PE-3, the following VPN IP routes with NH 192.0.2.1 are reflected, but they are not installed in the FIB, so these are not used locally:

*A:PE-3# show router bgp routes vpn-ipv4 rd 3:3
===============================================================================
 BGP Router ID:192.0.2.3        AS:64496       Local AS:64496
===============================================================================
 Legend -
 Status codes  : u - used, s - suppressed, h - history, d - decayed, * - valid
                 l - leaked, x - stale, > - best, b - backup, p - purge
 Origin codes  : i - IGP, e - EGP, ? - incomplete

===============================================================================
BGP VPN-IPv4 Routes
===============================================================================
Flag  Network                                            LocalPref   MED
      Nexthop (Router)                                   Path-Id     IGP Cost
      As-Path                                                        Label
-------------------------------------------------------------------------------
*>i   3:3:1.1.1.3/32                                     100         None
      192.0.2.1                                          None        10
      No As-Path                                                     524285
*>i   3:3:5.5.5.3/32                                     100         None
      192.0.2.5                                          None        0
      64500                                                          524285
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

On RR PE-3, NH 192.0.2.1 is resolved using the RTM:

*A:PE-3# show router bgp next-hop
===============================================================================
 BGP Router ID:192.0.2.3        AS:64496       Local AS:64496
===============================================================================

===============================================================================
BGP Next Hop
===============================================================================
Next Hop                                                    Pref     Owner
   Resolving Prefix                                         FibProg  Metric
   Resolved Next Hop                                        Colored  Ref. Count
   Admin-tag-policy                                         FlexAlgo Last Mod.
-------------------------------------------------------------------------------
192.0.2.1                                                   15       ISIS
   192.0.2.1/32                                             N        10
   192.168.13.1                                             N        0
   --                                                       --       02h04m45s
192.0.2.2                                                   15       ISIS
   192.0.2.2/32                                             N        10
   192.168.23.1                                             N        0
   --                                                       --       02h04m45s
-------------------------------------------------------------------------------
Next Hops : 2
===============================================================================

Conclusion

The NH resolution of BGP routes using tunnels is consistent across different types of labeled route families (labeled IP and VPN-IP), both for eBGP and iBGP peering.