BGP Selective Label-IPv4 Route Installation

This chapter provides information about BGP selective label-IPv4 route installation.

Topics in this chapter include:

Applicability

The information and configuration in this chapter are based on SR OS Release 23.3.R1. BGP selective label-IPv4 route installation is supported in SR OS Release 19.10.R2, and later.

Overview

Many service providers use BGP label-unicast (BGP-LU) to build network designs that connect multiple domains into unified and scalable network fabrics. However, the number of BGP-LU IPv4 routes that are distributed in the control plane can exceed the capacity of the Forwarding Information Base (FIB) and Label Forwarding Information Base (LFIB) of small access routers.

One solution is to apply import policies on the access router to limit the number of BGP-LU IPv4 routes accepted in the RIB-IN, but this is labor-intensive and prone to errors. A better solution is selective BGP-LU IPv4 route installation in the base routing instance, which addresses these issues.

When the selective-label-ipv4-install command is configured in the bgp context of the base router, BGP-LU IPv4 routes in the RIB-IN are made invalid if they are received from a base router BGP peer and not needed by any eligible service. When a BGP-LU IPv4 route is invalid in the RIB-IN, the BGP decision process prefers any valid route over this route, and the invalid BGP-LU IPv4 route is not programmed as a next-hop (primary next-hop, ECMP next-hop, or backup next-hop) of any IP route or tunnel.

The selective-label-ipv4-install command can be configured in the bgp context of the base router: in the global bgp context, the group context, or the neighbor context, as follows:

A:PE-1# tree flat detail | match selective-label-ipv4-install
configure router bgp group neighbor selective-label-ipv4-install
configure router bgp group neighbor no selective-label-ipv4-install
configure router bgp group no selective-label-ipv4-install
configure router bgp group selective-label-ipv4-install
configure router bgp no selective-label-ipv4-install
configure router bgp selective-label-ipv4-install

When a BGP-LU IPv4 route is invalid in the RIB-IN, it is marked with the flag Label-Unicast-No-Svc and the invalid route is handled as follows:

  • No route for the IPv4 prefix is added to the route table from the BGP-LU RIB.

  • No BGP tunnel for the /32 IPv4 prefix is added to the tunnel table.

  • No RIB-OUT is generated for the invalid BGP-LU route, so this invalid route does not trigger a label-swap (incoming label map - ILM) entry to be programmed.

Note:

Configuring the selective-label-ipv4-install command on a BGP session unconditionally invalidates all non-/32 BGP-LU IPv4 routes received on that session, because those non-/32 routes are never used to resolve service endpoints.

Selective BGP-LU installation logic by service type shows how BGP-LU IPv4 routes are handled when the selective-label-ipv4-install command is configured.

Table 1. Selective BGP-LU installation logic by service type

Service type

Logic marks BGP label-IPv4 routes as invalid except

L2 services with user-provisioned SDPs

When the user-provisioned SDP has a BGP tunnel as transport and the far end matches a /32 BGP-LU IPv4 route, that route is not marked as invalid, regardless of the operational state of the SDP.

L2 services with auto-created SDPs (BGP-AD, BGP-VPLS, BGP-EVPN)

If an L2 service imports a BGP-AD, BGP-VPLS, or BGP-EVPN route, /32 BGP-LU IPv4 routes matching the BGP next-hop address of this BGP route are not marked as invalid.

EVPN next-hop-self route reflector or model-B ASBR

If the base router BGP instance is configured as a next-hop-self RR or a model-B ASBR, BGP-LU IPv4 routes matching any IPv4 address in the BGP next-hop field of a received EVPN route are not marked as invalid, regardless of whether the transport-tunnel resolution filter allows BGP tunnels.

VPRN with explicitly configured SDP

BGP-LU IPv4 routes matching the SDP far-end address are not marked as invalid, regardless of the operational state of the SDP.

VPRN with auto-bind-tunnel

If the auto-bind VPRN service imports VPN-IPv4 or VPN-IPv6 routes where the BGP next-hop matches a BGP-LU IPv4 route, that route is not marked as invalid, regardless of whether the auto-bind-tunnel resolution filter allows BGP tunnels.

VPN-IP next-hop-self RR or model-B ASBR

If the base router BGP instance is configured as a next-hop-self RR or a model-B ASBR, BGP-LU IPv4 routes matching any IPv4 address in the BGP next-hop field of a received VPN-IP route are not marked as invalid, regardless of whether the transport-tunnel resolution filter allows BGP tunnels.

Configuration

Example topology shows the example topology with two PEs with the services that are configured.

Figure 1. Example topology

Initial configuration

The initial configuration on the PEs includes:

  • Cards, MDAs, ports

  • Router interfaces

  • SR-ISIS

On PE-2, four loopback interfaces are configured in the base router context with /32 IPv4 addresses: 192.0.1.21/32, 192.0.1.22/32, 192.0.1.23/32, and 192.0.1.24/32. The list of router interfaces on PE-2 is as follows:

*A:PE-2# show router interface 

===============================================================================
Interface Table (Router: Base)
===============================================================================
Interface-Name                   Adm       Opr(v4/v6)  Mode    Port/SapId
   IP-Address                                                  PfxState
-------------------------------------------------------------------------------
int-PE-2-PE-1                    Up        Up/Down     Network 1/1/c1/2:100
   192.168.12.2/30                                             n/a
lo1                              Up        Up/Down     Network loopback
   192.0.1.21/32                                               n/a
lo2                              Up        Up/Down     Network loopback
   192.0.1.22/32                                               n/a
lo3                              Up        Up/Down     Network loopback
   192.0.1.23/32                                               n/a
lo4                              Up        Up/Down     Network loopback
   192.0.1.24/32                                               n/a
system                           Up        Up/Down     Network system
   192.0.2.2/32                                                n/a
-------------------------------------------------------------------------------
Interfaces : 6
===============================================================================

These prefixes are exported as BGP-LU routes and the next-hop resolution filter for label-IPv4 routes is configured with SR-ISIS. The configuration on PE-2 is as follows:

# on PE-2:
configure
    router Base
        policy-options
            begin
            prefix-list "192.0.1.0/24"
                prefix 192.0.1.0/24 prefix-length-range 32-32
            exit
            policy-statement "export-svc-lu-bgp"
                entry 10
                    from
                        prefix-list "192.0.1.0/24"
                    exit
                    action accept
                    exit
                exit
            exit
            commit
        exit
        bgp
            split-horizon
            next-hop-resolution
                labeled-routes
                    transport-tunnel
                        family label-ipv4
                            resolution-filter
                                no ldp
                                sr-isis
                            exit
                            resolution filter
                        exit
                    exit
                exit
            exit
            group "iBGPv4"
                family vpn-ipv4 label-ipv4
                peer-as 64500
                neighbor 192.0.2.1
                    export "export-svc-lu-bgp"
                exit
            exit
        exit

PE-1 receives four valid label-IPv4 routes, as follows:

*A:PE-1# show router bgp routes label-ipv4 
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500      
===============================================================================
 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.1.21/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
u*>i  192.0.1.22/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
u*>i  192.0.1.23/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
u*>i  192.0.1.24/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
-------------------------------------------------------------------------------
Routes : 4
===============================================================================

The tunnel table on PE-1 includes four BGP tunnels toward the loopback interfaces on PE-2:

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

===============================================================================
IPv4 Tunnel Table (Router: Base)
===============================================================================
Destination           Owner     Encap TunnelId  Pref   Nexthop        Metric
   Color                                                              
-------------------------------------------------------------------------------
192.0.1.21/32         bgp       MPLS  262148    12     192.0.2.2      1000
192.0.1.22/32         bgp       MPLS  262147    12     192.0.2.2      1000
192.0.1.23/32         bgp       MPLS  262146    12     192.0.2.2      1000
192.0.1.24/32         bgp       MPLS  262145    12     192.0.2.2      1000
-------------------------------------------------------------------------------
Flags: B = BGP or MPLS backup hop available
       L = Loop-Free Alternate (LFA) hop available
       E = Inactive best-external BGP route
       k = RIB-API or Forwarding Policy backup hop
===============================================================================

The route table on PE-1 shows four BGP-LU IPv4 routes toward the loopback interfaces on PE-2, with next-hop resolved via an SR-ISIS tunnel:

*A:PE-1# show router route-table protocol bgp-label 

===============================================================================
Route Table (Router: Base)
===============================================================================
Dest Prefix[Flags]                            Type    Proto     Age        Pref
      Next Hop[Interface Name]                                    Metric   
-------------------------------------------------------------------------------
192.0.1.21/32                                 Remote  BGP_LABEL 00h02m54s  170
       192.0.2.2 (tunneled:SR-ISIS:524290)                          10
192.0.1.22/32                                 Remote  BGP_LABEL 00h02m54s  170
       192.0.2.2 (tunneled:SR-ISIS:524290)                          10
192.0.1.23/32                                 Remote  BGP_LABEL 00h02m54s  170
       192.0.2.2 (tunneled:SR-ISIS:524290)                          10
192.0.1.24/32                                 Remote  BGP_LABEL 00h02m54s  170
       192.0.2.2 (tunneled:SR-ISIS:524290)                          10
-------------------------------------------------------------------------------
No. of Routes: 4
Flags: n = Number of times nexthop is repeated
       B = BGP backup route available
       L = LFA nexthop available
       S = Sticky ECMP requested
===============================================================================

The tunnel toward destination 192.0.2.2 is the following SR-ISIS tunnel:

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

===============================================================================
IPv4 Tunnel Table (Router: Base)
===============================================================================
Destination           Owner     Encap TunnelId  Pref   Nexthop        Metric
   Color                                                              
-------------------------------------------------------------------------------
192.0.2.2/32          isis (0)  MPLS  524290    11     192.168.12.2   10
-------------------------------------------------------------------------------
Flags: B = BGP or MPLS backup hop available
       L = Loop-Free Alternate (LFA) hop available
       E = Inactive best-external BGP route
       k = RIB-API or Forwarding Policy backup hop
===============================================================================

In the following examples, services that use these BGP tunnels are configured .

VPRN 1 with auto-bind-tunnel

VPRN 1 in VPRN 1 uses a BGP transport tunnel with endpoint 192.0.1.21 on PE-2 uses the BGP transport tunnel between loopback interfaces "lo1" with IP address 192.0.1.11/32 on PE-1 and 192.0.1.21/32 on PE-2.

Figure 2. VPRN 1 uses a BGP transport tunnel with endpoint 192.0.1.21 on PE-2

VPRN 1 is configured with an auto-bind-tunnel and the next-hop must be resolved using a BGP tunnel. On PE-2, the policy "export-VPRN1" sets the next-hop to 192.0.1.21 and adds the community "target:64500:1", which matches the vrf-target of VPRN 1.

# on PE-2:
configure
    router Base
        policy-options
            begin
            community "target:64500:1"
                members "target:64500:1"
            exit
            policy-statement "export-VPRN1"
                entry 10
                    action accept
                        next-hop 192.0.1.21
                        community add "target:64500:1"
                    exit
                exit
            exit
            commit
        exit
    exit
    service
        vprn 1 name "VPRN 1" customer 1 create
            interface "lo1" create
                address 172.31.1.2/32
                loopback
            exit
            bgp-ipvpn
                mpls
                    auto-bind-tunnel
                        resolution-filter
                        exit
                        resolution filter
                    exit
                    route-distinguisher 64500:1
                    vrf-export "export-VPRN1"
                    vrf-target target:64500:1
                    no shutdown
                exit
            exit
            no shutdown

The configuration is similar on PE-1, but the IP addresses are different.

VPRN 1 on PE-1 receives a BGP VPN-IPv4 route for prefix 172.31.1.2/32 from PE-2. The next-hop of this BGP-VPN route is 192.0.1.21:

*A:PE-1# show router bgp routes vpn-ipv4 
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500      
===============================================================================
 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  64500:1:172.31.1.2/32                              100         None
      192.0.1.21                                         None        0
      No As-Path                                                     524287
-------------------------------------------------------------------------------
Routes : 1
===============================================================================

VPRN 1 on PE-1 uses the BGP tunnel toward 192.0.1.21/32 while the other BGP tunnels are not required on PE-1. When BGP is configured with the selective-label-ipv4-install command, only the BGP-LU IPv4 route for 192.0.1.21/32 remains valid. The command can be configured in the global BGP context (as in the following configuration), per group, or per neighbor:

# on PE-1:
configure
    router Base
        bgp
            selective-label-ipv4-install
        exit

From the four BGP transport tunnels on PE-1, only the BGP tunnel with endpoint 192.0.1.21/32 is used by a service, so it remains valid, as follows:

*A:PE-1# show router bgp routes label-ipv4 
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500      
===============================================================================
 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.1.21/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
i     192.0.1.22/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
i     192.0.1.23/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
i     192.0.1.24/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
-------------------------------------------------------------------------------
Routes : 4
===============================================================================

The first label-IPv4 route is valid; the other three label-IPv4 routes are marked invalid with flag Label-Unicast-No-Svc:

*A:PE-1# show router bgp routes label-ipv4 hunt | match Flags 
Flags          : Used Valid Best IGP In-TTM In-RTM 
Flags          : Invalid IGP Label-Unicast-No-Svc 
Flags          : Invalid IGP Label-Unicast-No-Svc 
Flags          : Invalid IGP Label-Unicast-No-Svc 

In the route table on PE-1, only one BGP-LU IPv4 route remains:

*A:PE-1# show router route-table protocol bgp-label 

===============================================================================
Route Table (Router: Base)
===============================================================================
Dest Prefix[Flags]                            Type    Proto     Age        Pref
      Next Hop[Interface Name]                                    Metric   
-------------------------------------------------------------------------------
192.0.1.21/32                                 Remote  BGP_LABEL 00h04m01s  170
       192.0.2.2 (tunneled:SR-ISIS:524290)                          10
-------------------------------------------------------------------------------
No. of Routes: 1
Flags: n = Number of times nexthop is repeated
       B = BGP backup route available
       L = LFA nexthop available
       S = Sticky ECMP requested
===============================================================================

L2 and L3 services with user-provisioned SDP

When SDPs are configured to use a BGP transport tunnel, the corresponding BGP label-IPv4 route is not marked as invalid. The following TLDP-signaled SDP is configured with a BGP transport tunnel between the loopback interfaces "lo2" with IP address 192.0.1.12 on PE-1 and 192.0.1.22 on PE-2:

# on PE-2:
configure
    router Base
        ldp
            targeted-session
                peer 192.0.1.12
                    local-lsr-id "lo2"
                exit
            exit
            no shutdown
        exit
    exit
    service
        sdp 1 mpls create
            signaling tldp      # default
            far-end 192.0.1.12
            bgp-tunnel
            no shutdown
        exit
    exit

The configuration is similar on PE-1; only the far-end and peer address is now 192.0.1.22:

*A:PE-1# show service sdp 

============================================================================
Services: Service Destination Points
============================================================================
SdpId  AdmMTU  OprMTU  Far End          Adm  Opr         Del     LSP   Sig
----------------------------------------------------------------------------
1      0       8970    192.0.1.22       Up   Up          MPLS    B     TLDP
----------------------------------------------------------------------------
Number of SDPs : 1
----------------------------------------------------------------------------
Legend: R = RSVP, L = LDP, B = BGP, M = MPLS-TP, n/a = Not Applicable
        I = SR-ISIS, O = SR-OSPF, T = SR-TE, F = FPE
============================================================================

When an SDP uses a BGP transport tunnel, the corresponding BGP label-IPv4 route is not marked as invalid, regardless of the operational state of the SDP. The following command shows that the second BGP label-IPv4 route is now valid:

*A:PE-1# show router bgp routes label-ipv4 
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500      
===============================================================================
 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.1.21/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
u*>i  192.0.1.22/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
i     192.0.1.23/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
i     192.0.1.24/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
-------------------------------------------------------------------------------
Routes : 4
===============================================================================

This SDP can be used by L2 and L3 services. VPRN 2, VPLS 3, and Epipe 4 use user-provisioned SDP 1 with BGP tunnel shows three services that use SDP 1: VPRN 2, VPLS 3, and Epipe 4.

Figure 3. VPRN 2, VPLS 3, and Epipe 4 use user-provisioned SDP 1 with BGP tunnel

VPRN 2 is similar to VPRN 1, but a spoke-SDP is configured instead of the auto-bind-tunnel. The configuration is as follows:

# on PE-1:
configure
    router Base
        policy-options
            begin
            community "target:64500:2"
                members "target:64500:2"
            exit
            policy-statement "export-VPRN2"
                entry 10
                    action accept
                        next-hop 192.0.1.12
                        community add "target:64500:2"
                    exit
                exit
            exit
            commit
        exit
    exit
    service
        vprn 2 name "VPRN 2" customer 1 create
            interface "lo1" create
                address 172.31.2.1/32
                loopback
            exit
            bgp-ipvpn
                mpls
                    route-distinguisher 64500:2
                    vrf-export "export-VPRN2"
                    vrf-target target:64500:2
                    no shutdown
                exit
            exit
            spoke-sdp 1:2 create
            exit
            no shutdown
        exit
    exit

VPLS 3 and Epipe 4 only have a spoke-SDP and a SAP, as follows:

# on PE-1:
configure
    service
        vpls 3 name "VPLS 3" customer 1 create
            sap 1/1/c2/1:3 create
            exit
            spoke-sdp 1:3 create
            exit
            no shutdown
        exit
        epipe 4 name "Epipe 4" customer 1 create
            sap 1/1/c2/1:4 create
            exit
            spoke-sdp 1:4 create
            exit
            no shutdown
        exit

L2 services with auto-created SDPs

PE-1 receives BGP-VPLS and BGP-AD routes with next-hop 192.0.1.23 shows two VPLS services where the SDPs are auto-created between the loopback interfaces "lo3" on the PEs: BGP-VPLS 5 and BGP-AD VPLS 6.

Figure 4. PE-1 receives BGP-VPLS and BGP-AD routes with next-hop 192.0.1.23

For BGP-VPLS and BGP-AD, a BGP session is established for the L2-VPN address family between the loopback interfaces "lo3" on both PEs:

# on PE-2:
configure
    router Base
        bgp
            group "iBGP-L2"
                family l2-vpn
                type internal
                local-address 192.0.1.23
                neighbor 192.0.1.13
                exit
            exit
        exit

For BGP-AD, T-LDP signaling is used, so the following T-LDP session is established:

# on PE-2:
configure
    router Base
        ldp
            targeted-session
                peer 192.0.1.13
                    local-lsr-id "lo3"
                exit
            exit
            no shutdown
        exit

The service configuration is as follows:

# on PE-2:
configure
    service
        pw-template 1 name "PW1" create
        exit
        vpls 5 name "BGP-VPLS 5" customer 1 create
            bgp
                route-distinguisher 64500:5
                route-target export target:64500:5 import target:64500:5
                pw-template-binding 1 import-rt "target:64500:5"
                exit
            exit
            bgp-vpls
                max-ve-id 100
                ve-name "PE-2"
                    ve-id 2
                exit
                no shutdown
            exit
            sap 1/1/c2/1:5 create
            exit
            no shutdown
        exit
        vpls 6 name "BGP-AD VPLS 6" customer 1 create
            bgp
                route-distinguisher 64500:6
                route-target export target:64500:6 import target:64500:6
                pw-template-binding 1
                exit
            exit
            bgp-ad
                vpls-id 64500:6
                vsi-id
                    prefix 192.0.1.23
                exit
                no shutdown
            exit
            sap 1/1/c2/1:6 create
            exit
            no shutdown
        exit

On PE-1, the received L2-VPN BGP routes have next-hop 192.0.1.23:

*A:PE-1# show router bgp routes l2-vpn 
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500      
===============================================================================
 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 L2VPN Routes
===============================================================================
Flag  RouteType                   Prefix                             MED
      RD                          SiteId                             Label
      Nexthop                     VeId                   BlockSize   LocalPref
      As-Path                     BaseOffset             vplsLabelBa 
                                                         se          
-------------------------------------------------------------------------------
u*>i  VPLS                        -                      -           0
      64500:5                     -                                  -
      192.0.1.23                  2                      8           100
      No As-Path                  1                      524273       
u*>i  AutoDiscovery               192.0.1.23             -           0
      64500:6                     -                                  -
      192.0.1.23                  -                      -           100
      No As-Path                  -                      -            
-------------------------------------------------------------------------------
Routes : 2
===============================================================================

On PE-1, the following SDPs with far-end address 192.0.1.23 are auto-created in BGP-VPLS 5 and BGP-AD VPLS 6:

*A:PE-1# show service id 5 sdp 

===============================================================================
Services: Service Destination Points
===============================================================================
SdpId            Type     Far End addr    Adm     Opr       I.Lbl     E.Lbl
-------------------------------------------------------------------------------
32767:4294967295 BgpVpls  192.0.1.23      Up      Up        524274    524273
-------------------------------------------------------------------------------
Number of SDPs : 1
-------------------------------------------------------------------------------
===============================================================================
*A:PE-1# show service id 6 sdp 

===============================================================================
Services: Service Destination Points
===============================================================================
SdpId            Type     Far End addr    Adm     Opr       I.Lbl     E.Lbl
-------------------------------------------------------------------------------
32766:4294967294 BgpAd    192.0.1.23      Up      Up        524268    524268
-------------------------------------------------------------------------------
Number of SDPs : 1
-------------------------------------------------------------------------------
===============================================================================

BGP-VPLS 5 and BGP-AD VPLS 6 use a BGP transport tunnel between the "lo3" interfaces, so the corresponding BGP label-IPv4 route is valid, as follows:

*A:PE-1# show router bgp routes label-ipv4 
===============================================================================
 BGP Router ID:192.0.2.1        AS:64500       Local AS:64500      
===============================================================================
 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.1.21/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
u*>i  192.0.1.22/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
u*>i  192.0.1.23/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
i     192.0.1.24/32                                      100         None
      192.0.2.2                                          None        10
      No As-Path                                                     524285
-------------------------------------------------------------------------------
Routes : 4
===============================================================================

Only the BGP tunnel between the "lo4" interfaces is not used by any service, so the last BGP label-IPv4 route is marked invalid in the RIB-IN when selective-label-ipv4-install is configured on PE-1, as follows:

*A:PE-1# show router bgp routes label-ipv4 hunt | match "Invalid" pre-lines 16 
 
Network        : 192.0.1.24/32
Nexthop        : 192.0.2.2
Path Id        : None                   
From           : 192.0.2.2
Res. Nexthop   : 192.0.2.2 (ISIS Tunnel)
Local Pref.    : 100                    Interface Name : NotAvailable
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : No Community Members
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.2
Fwd Class      : None                   Priority       : None
IPv4 Label     : 524285                 
Flags          : Invalid IGP Label-Unicast-No-Svc 

Conclusion

The selective-label-ipv4-install command allows BGP-LU IPv4 routes to be marked as invalid in the RIB-IN when these routes are received from a base router BGP peer and not needed by any eligible service. This is a technique to reduce the number of routes in the FIB/LFIB, which is mainly useful for small access routers having small FIB/LFIB sizes.