Multi-Instance EVPN VPWS with MPLS to SRv6 Interworking

This chapter provides information about multi-instance EVPN VPWS with MPLS to SRv6 interworking.

Topics in this chapter include:

Applicability

The information and the configuration in this chapter are based on SR OS Release 24.10.R1. Multi-instance EVPN VPWS with MPLS to SRv6 interworking is supported in SR OS Release 23.10.R2 and later.

Overview

EVPN is used in most networks. During migration to SRv6, interworking between EVPN MPLS and EVPN SRv6 is required. Also, some MPLS networks do not support SRv6 and yet, end-to-end services are required. This chapter describes the configuration of EVPN VPWS services with MPLS to SRv6 stitching. Multi-instance EVPN VPWS is described in draft-sr-bess-evpn-vpws-gateway. EVPN-MPLS to EVPN-SRv6 stitching shows the need for EVPN-MPLS to EVPN-SRv6 stitching between a legacy MPLS network and an SRv6 network: some terminating PEs are legacy PEs attached to an MPLS domain while other terminating PEs are attached to an SRv6 network.

Figure 1. EVPN-MPLS to EVPN-SRv6 stitching

Gateway redundancy is based on an anycast gateway redundant model; Interconnect Ethernet Segments (I-ESs) are not supported in SR OS Release 24.10.R1.

An Epipe service can contain two BGP instances. BGP instance 1 and BGP instance 2 can be matched to MPLS, SRv6, or VXLAN. MPLS and SRv6 can be configured in Epipes with one or two instances and they can use either instance 1 or instance 2 interchangeably. The MPLS and SRv6 instances are configured with a multihoming mode. The default multihoming mode is network, but only one instance can be configured with multihoming mode network, so the other instance must have multihoming mode access. A BGP-EVPN instance in multihoming mode access does not participate in multihoming procedures, such as Designated Forwarder (DF) election processing or local bias forwarding.

The use of D-PATH in multi-instance EVPN VPWS services is supported to avoid control plane loops when redistributing EVPN AD per-EVI routes between adjacent domains. For more information about D-PATH, see the Domain Path Attribute for VPRN BGP Routes chapter.

Multi-instance EVPN VPWS is supported for MPLS and SRv6, but not for VXLAN. In SR OS Release 24.10.R1, VXLAN is only supported on Epipes with a single BGP instance, which can be instance 1 or instance 2. Multihoming mode and domain ID cannot be configured in VXLAN instances.

In a multi-instance EVPN VPWS, the local and the remote attachment circuits (ACs) are defined in different BGP instances.

SAPs or SDP bindings are not supported in a multi-instance EVPN VPWS.

Configuration

Example topology shows terminating PE-1 in an MPLS network and terminating PE-4 in an SRv6 network. The Epipes on the gateways PE-2 and PE-3 have two BGP instances.
Figure 2. Example topology
The initial configuration on the PEs includes:
  • cards, MDAs, ports
  • router interfaces
  • IS-IS on all router interfaces; on the gateways PE-2 and PE-3 with different instances: IS-IS 0 in domain 1 and IS-IS 1 in domain 2
  • SR-ISIS on PE-1, PE-2, and PE-3
  • SRv6 on PE-2, PE-3, and PE-4

BGP is configured for the EVPN address family with BGP group "mpls" in domain 1 and with BGP group "srv6" in domain 2. The BGP configuration on gateway PE-2 is as follows:

#  on PE-2:
configure
    router Base
        autonomous-system 64500
        bgp
            vpn-apply-import
            vpn-apply-export
            enable-peer-tracking
            rapid-withdrawal
            split-horizon
            rapid-update evpn
            group "mpls"            # similar configuration on PE-1, PE-3
                family evpn
                peer-as 64500
                neighbor 192.0.2.1
                exit
                neighbor 192.0.2.3
                exit
            exit
            group "srv6"            # similar configuration on PE-3, PE-4
                family evpn
                peer-as 64500
                advertise-ipv6-next-hops evpn
                neighbor 2001:db8::2:3
                exit
                neighbor 2001:db8::2:4
                exit
            exit

Service configuration

In this section, the following EVPN VPWS services are configured between PE-1 and PE-4:
  • Epipe-1 with identical route distinguishers (RDs) and with two explicit endpoints on the gateways PE-2 and PE-3
  • Epipe-2 with different RDs and with one implicit and one explicit endpoint on the gateways PE-2 and PE-3

For both Epipe-1 and Epipe-2, MPLS uses BGP instance 1 and SRv6 uses BGP instance 2.

On PE-1, the EVPN VPWS services are configured with BGP instance 1, as follows:

# on PE-1:
configure
    service
        epipe 1 name "Epipe-1" customer 1 create
            bgp 1
            exit
            bgp-evpn
                local-attachment-circuit AC-PE-1-1 bgp 1 create
                    eth-tag 11
                exit
                remote-attachment-circuit GW-MPLS-1 bgp 1 create
                    eth-tag 123
                exit
                evi 1
                mpls bgp 1
                    auto-bind-tunnel
                        resolution any
                    exit
                    no shutdown
                exit
            exit
            sap 1/1/c10/1:1 create
                description "SAP to CE-11"
                no shutdown
            exit
            no shutdown
        exit
        epipe 2 name "Epipe-2" customer 1 create
            bgp 1
            exit
            bgp-evpn
                local-attachment-circuit AC-PE-1-2 bgp 1 create
                    eth-tag 21
                exit
                remote-attachment-circuit GW-MPLS-2 bgp 1 create
                    eth-tag 223
                exit
                evi 2
                mpls bgp 1
                    auto-bind-tunnel
                        resolution any
                    exit
                    no shutdown
                exit
            exit
            sap 1/1/c10/1:2 create
                description "SAP to CE-21"
                no shutdown
            exit
            no shutdown
        exit

The local and remote ACs are configured with BGP 1.

On gateway PE-2, the following EVPN VPWS configuration includes two BGP instances: BGP 1 in the MPLS domain and BGP 2 in the SRv6 domain.

# on PE-2:
configure
    service
        system
            bgp-auto-rd-range 192.0.2.2 comm-val 60000 to 65000  # PE-3: 192.0.2.3
        exit
        epipe 1 name "Epipe-1" customer 1 create
            endpoint MPLS create
            exit
            endpoint SRv6 create
            exit
            segment-routing-v6 1 create
                locator "PE2-loc"               # on PE-3: PE3-loc
                    function
                        end-dx2
                    exit
                exit
            exit
            bgp 1
                route-distinguisher 64500:1    # on PE-3: 64500:1 (identical)
            exit
            bgp 2
                route-distinguisher 64500:2    # on PE-3: 64500:2 (identical)
            exit
            bgp-evpn
                local-attachment-circuit GW-MPLS-1 bgp 1 endpoint MPLS create
                    eth-tag 123
                exit
                local-attachment-circuit GW-SRv6-1 bgp 2 endpoint SRv6 create
                    eth-tag 1623
                exit
                remote-attachment-circuit AC-PE-1-1 bgp 1 endpoint MPLS create
                    eth-tag 11
                exit
                remote-attachment-circuit AC-PE-4-1 bgp 2 endpoint SRv6 create
                    eth-tag 14
                exit
                evi 1
                mpls bgp 1
                    domain-id 64500:100      # D-PATH supported on AD per EVI
                    mh-mode access         # one instance in MH mode access
                    auto-bind-tunnel
                        resolution any
                    exit
                    no shutdown
                exit
                segment-routing-v6 bgp 2 srv6-instance 1 
                                 default-locator "PE2-loc" create  # PE-3: PE3-loc
                    domain-id 64500:101      # D-PATH supported on AD per EVI
                    mh-mode network        # one instance in MH mode network
                    source-address 2001:db8::2:2   # on PE-3: 2001:db8::2:3
                    route-next-hop system-ipv6
                    no shutdown
                exit
            exit
            no shutdown
        exit
        epipe 2 name "Epipe-2" customer 1 create
            endpoint SRv6 create
            exit
            segment-routing-v6 1 create
                locator "PE2-loc"               # on PE-3: PE3-loc
                    function
                        end-dx2
                    exit
                exit
            exit
            bgp 1
            exit
            bgp 2
                route-distinguisher auto-rd
            exit
            bgp-evpn
                local-attachment-circuit GW-MPLS-2 bgp 1 create
                    eth-tag 223
                exit
                local-attachment-circuit GW-SRv6-2 bgp 2 endpoint SRv6 create
                    eth-tag 2623
                exit
                remote-attachment-circuit AC-PE-1-2 bgp 1 create
                    eth-tag 21
                exit
                remote-attachment-circuit AC-PE-4-2 bgp 2 endpoint SRv6 create
                    eth-tag 24
                exit
                evi 2
                mpls bgp 1
                    domain-id 64500:100      # D-PATH supported on AD per EVI
                    mh-mode access         # one instance in MH mode access
                    auto-bind-tunnel
                        resolution any
                    exit
                    no shutdown
                exit
                segment-routing-v6 bgp 2 srv6-instance 1 
                                default-locator "PE2-loc" create   # PE-3: PE3-loc
                    domain-id 64500:101      # D-PATH supported on AD per EVI
                    mh-mode network        # one instance in MH mode network
                    source-address 2001:db8::2:2   # on PE-3: 2001:db8::2:3
                    route-next-hop system-ipv6
                    no shutdown
                exit
            exit
            no shutdown
        exit

On PE-2 and PE-3, Epipe-1 is configured with two explicit endpoints (endpoint MPLS and endpoint SRv6) while Epipe-2 is configured with one explicit endpoint (endpoint SRv6) in BGP 2 and one implicit endpoint in BGP 1. BGP 1 is used in the MPLS domain while BGP 2 is used in the SRv6 domain. The configuration of the endpoints and the ACs is identical on PE-2 and PE-3.

The Route Distinguisher (RD) for BGP instance 1 can be:
  • auto-derived from the default value "system-IP:EVI" , for example, RD 192.0.2.2:2 for BGP 1 in Epipe-2 on PE-2
  • manually configured, for example, RD 64500:1 for BGP 1 in Epipe-1 on PE-2 and PE-3
  • auto-derived from the configured BGP auto-RD range.
The RD for BGP instance 2 can be:
  • manually configured, for example, RD 64500:2 for BGP 2 in Epipe-1 on PE-2 and PE-3
  • auto-derived from the configured BGP auto-RD range, for example, RD 192.0.2.2:60000 for BGP 2 in Epipe-2 on PE-2.

For Epipe-1, the RDs 64500:1 for BGP 1 and 64500:2 for BGP 2 are identical on PE-2 and PE-3; for Epipe-2, the RDs are different, for example for BGP-1, the auto-derived RD on PE-2 is 192.0.2.2:2 and the auto-derived RD on PE-3 is 192.0.2.3:2.

On the gateways, multiple AD per-EVI routes with the same expected remote Ethernet tag ID may be received, requiring the selection of one route. If the AD per-EVI route keys of the received routes differ (in EVPN AD per-EVI routes, different route keys mean different RD, Ethernet tag, or ESI), the EVPN application selects the route based on the lowest PE IP address. However, if the route keys are identical, the selection follows the BGP decision process.

The multihoming mode must be different in both instances: one of the two instances—MPLS BGP 1—is configured with mh-mode access; the other instance—SRv6 BGP 2—is configured with mh-mode network, which is the default multihoming mode.

For Epipe-1 and Epipe-2, the domain ID 64500:100 is configured in the MPLS domain while the domain ID 64500:101 is configured in the SRv6 domain. The D-PATH is supported in AD per-EVI routes to avoid loops on the gateways.

The service configuration on PE-4 is as follows:

# on PE-4:
configure
    router Base
        policy-options
            begin
            community "low-latency"
                members "color:01:1"
            exit
            community "comm-epipe-1"
                members "target:64500:1"
            exit
            policy-statement "vsi-export-1"
                entry 10
                    action accept
                        community add "low-latency" "comm-epipe-1"
                    exit
                exit
            exit
            commit
        exit
    exit
    service
        epipe 1 name "Epipe-1" customer 1 create
            segment-routing-v6 1 create
                locator "PE4-loc"
                    function
                        end-dx2
                    exit
                exit
            exit
            bgp 1
                vsi-export "vsi-export-1"
            exit
            bgp-evpn
                local-attachment-circuit AC-PE-4-1 bgp 1 create
                    eth-tag 14
                exit
                remote-attachment-circuit GW-SRv6-1 bgp 1 create
                    eth-tag 1623
                exit
                evi 1
                segment-routing-v6 bgp 1 srv6-instance 1 default-locator "PE4-loc" create
                    source-address 2001:db8::2:4
                    route-next-hop system-ipv6
                    no shutdown
                exit
            exit
            sap 1/1/c10/1:1 create
                no shutdown
            exit
            no shutdown
        exit
        epipe 2 name "Epipe-2" customer 1 create
            segment-routing-v6 1 create
                locator "PE4-loc"
                    function
                        end-dx2
                    exit
                exit
            exit
            bgp 1
            exit
            bgp-evpn
                local-attachment-circuit AC-PE-4-2 bgp 1 create
                    eth-tag 24
                exit
                remote-attachment-circuit GW-SRv6-2 bgp 1 create
                    eth-tag 2623
                exit
                evi 2
                segment-routing-v6 bgp 1 srv6-instance 1 default-locator "PE4-loc" create
                    source-address 2001:db8::2:4
                    route-next-hop system-ipv6
                    no shutdown
                exit
            exit
            sap 1/1/c10/1:2 create
                no shutdown
            exit
            no shutdown
        exit

The VSI export policy adds a color attribute and a route target.

By default, AD per-EVI routes do not propagate attributes, path selection based on PE IP address is used instead of BGP path selection (unless the route keys are identical), and the D-PATH is taken into account to prevent loops, as follows:

*A:PE-2>config>service>system>bgp-evpn>ad-per-evi-routes# info detail
----------------------------------------------
                no attribute-propagation
                no bgp-path-selection
                no d-path-ignore
----------------------------------------------

In a simple example topology with only two different domains, the D-PATH attribute contains maximum one domain ID, therefore, the default settings are used and attributes such as the D-PATH need not be propagated. However, the color attribute will not be propagated either when attribute propagation is disabled, see further.

Verification

Single-instance EVPN VPWS services only generate AD per-EVI routes when they have a local SAP or spoke SDP configured that is operationally up. In this example, Epipe-1 and Epipe-2 generate AD per-EVI routes from PE-1 and from PE-4. In contrast, multi-instance EVPN VPWS services do not allow local SAPs or spoke SDPs, therefore they do not generate AD per-EVI routes for the configured local AC Ethernet tags. The EVPN VPWS services on PE-2 and PE-3 redistribute AD per-EVI routes received in one instance into the other instance. The following redistribution rules apply at the gateways PE-2 and PE-3 as per draft-sr-bess-evpn-vpws-gateway:

  • An AD per-EVI route received in BGP 1 which does not contain a local domain ID and which is selected to be installed triggers an AD per-EVI route to be redistributed in BGP 2 using the Ethernet tag, RD, route target, and properties of BGP 2.
  • Route targets are re-originated in the redistributed AD per-EVI.
  • The redistributed AD per-EVI route carries the communities, extended communities, and large communities of the source route only when attribute configuration is enabled. The exceptions are EVPN extended communities and BGP encapsulation extended communities which are never propagated across domains.
  • The redistributed AD per-EVI route must update the D-PATH attribute of the received AD per-EVI route (when attribute propagation is enabled) or add the D-PATH attribute if the received route does not contain a D-PATH.

This section contains the following subsections:

AD per-EVI routes

AD per-EVI routes are redistributed from the SRv6 domain to the MPLS domain and vice versa. AD per-EVI route from SRv6 domain redistributed into MPLS domain shows an AD per-EVI route sent by PE-4 in domain 64500:101 which is redistributed by PE-2 and PE-3 into domain 64500:100. The gateways add the D-PATH attribute containing domain ID 64500:101 in the redistributed AD per-EVI route.

Figure 3. AD per-EVI route from SRv6 domain redistributed into MPLS domain

When CE-11 sends traffic to CE-14, a VPWS lookup takes place in PE-1. The packets get an MPLS encapsulation and are forwarded to PE-2 based on the selection criteria. For Epipe-1, the route keys and RDs on the gateways are identical, so the BGP decision process is used instead of the EVPN selection. On gateway PE-2, MPLS is decapsulated, a VPWS lookup takes place, and SRv6 encapsulation is added. The traffic is forwarded to PE-4 where SRv6 is decapsulated, a VPWS lookup takes place, and the packets are forwarded to CE-14.

In this simple example topology with only two domains, attribute propagation is not required for the D-PATH attribute. The D-PATH is added by the gateways PE-2 and PE-3, not propagated. By default, attribute propagation is disabled and the gateways PE-2 and PE-3 drop attributes such as the color attribute in the redistributed AD per-EVI routes.

Similarly, gateways PE-2 and PE-3 add D-PATH attribute with domain ID 64500:100 when redistributing AD per-EVI routes from the MPLS domain in the SRv6 domain, as shown in AD per-EVI route from MPLS domain redistributed into SRv6 domain:

Figure 4. AD per-EVI route from MPLS domain redistributed into SRv6 domain

PE-2 receives the following AD per-EVI route from PE-1 with ESI-0, Ethernet tag 11, and RD 192.0.2.1:1.

*A:PE-2# show router bgp routes evpn auto-disc tag 11 detail
===============================================================================
 BGP Router ID:192.0.2.2        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 EVPN Auto-Disc Routes
===============================================================================
Original Attributes

Network        : n/a
Nexthop        : 192.0.2.1
Path Id        : None
From           : 192.0.2.1
Res. Nexthop   : 192.168.12.1
Local Pref.    : 100                    Interface Name : int-PE-2-PE-1
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : target:64500:1
                 l2-attribute:MTU: 1514 F: 0 C: 0 P: 0 B: 0
                 bgp-tunnel-encap:MPLS
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.1
Origin         : IGP
Flags          : Used Valid Best
Route Source   : Internal
AS-Path        : No As-Path
EVPN type      : AUTO-DISC
ESI            : ESI-0
Tag            : 11
Route Dist.    : 192.0.2.1:1
MPLS Label     : LABEL 524285
Route Tag      : 0
Neighbor-AS    : n/a
DB Orig Val    : N/A                    Final Orig Val : N/A
Source Class   : 0                      Dest Class     : 0
Add Paths Send : Default
Last Modified  : 00h20m09s
---snip---

Similarly, PE-3 receives a similar AD per-EVI route with ESI-0, Ethernet tag 11, and RD 192.0.2.1:1 from PE-1, as follows:

*A:PE-3# show router bgp routes evpn auto-disc tag 11 detail
===============================================================================
 BGP Router ID:192.0.2.3        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 EVPN Auto-Disc Routes
===============================================================================
Original Attributes

Network        : n/a
Nexthop        : 192.0.2.1
Path Id        : None
From           : 192.0.2.1
Res. Nexthop   : 192.168.13.1
Local Pref.    : 100                    Interface Name : int-PE-3-PE-1
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : target:64500:1
                 l2-attribute:MTU: 1514 F: 0 C: 0 P: 0 B: 0
                 bgp-tunnel-encap:MPLS
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.1
Origin         : IGP
Flags          : Used Valid Best
Route Source   : Internal
AS-Path        : No As-Path
EVPN type      : AUTO-DISC
ESI            : ESI-0
Tag            : 11
Route Dist.    : 192.0.2.1:1
MPLS Label     : LABEL 524285
Route Tag      : 0
Neighbor-AS    : n/a
DB Orig Val    : N/A                    Final Orig Val : N/A
Source Class   : 0                      Dest Class     : 0
Add Paths Send : Default
Last Modified  : 00h20m11s
---snip---

PE-2 and PE-3 add the D-PATH's domain ID 64500:100 to the redistributed AD per-EVI routes. The Ethernet tag is 1623 and the RD is 64500:2. PE-4 receives AD per-EVI routes from both gateways and the following route with next-hop 2001:db8::2:2 is used:

*A:PE-4# show router bgp routes evpn auto-disc rd 64500:2 detail
===============================================================================
 BGP Router ID:192.0.2.4        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 EVPN Auto-Disc Routes
===============================================================================
Original Attributes

Network        : n/a
Nexthop        : 2001:db8::2:2
Path Id        : None
From           : 2001:db8::2:2
Res. Nexthop   : fe80::e:1ff:fe01:1
Local Pref.    : 100                    Interface Name : int-PE-4-PE-2
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : target:64500:1
                 l2-attribute:MTU: 1514 F: 0 C: 0 P: 0 B: 0
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.2
Origin         : IGP
Flags          : Used Valid Best
Route Source   : Internal
AS-Path        : No As-Path
D-Path         : [64500:100:(local)]
EVPN type      : AUTO-DISC
ESI            : ESI-0
Tag            : 1623
Route Dist.    : 64500:2
MPLS Label     : 524286
Route Tag      : 0
Neighbor-AS    : n/a
DB Orig Val    : N/A                    Final Orig Val : N/A
Source Class   : 0                      Dest Class     : 0
Add Paths Send : Default
Last Modified  : 00h20m41s
SRv6 TLV Type  : SRv6 L2 Service TLV (6)
SRv6 SubTLV    : SRv6 SID Information (1)
Sid            : 2001:db8:aaaa:102::
Full Sid       : 2001:db8:aaaa:102:7fff:e000::
Behavior       : End.DX2 (21)
SRv6 SubSubTLV : SRv6 SID Structure (1)
Loc-Block-Len  : 48                     Loc-Node-Len   : 16
Func-Len       : 20                     Arg-Len        : 0
Tpose-Len      : 20                     Tpose-offset   : 64
---snip---

For Epipe-1, the anycast redundancy solution is used for the gateways PE-2 and PE-3 that stitch MPLS to SRv6. The service configuration for Epipe-1 has identical RDs on both gateways: RD 64500:1 for BGP 1 and RD 64500:2 for BGP 2. Gateways PE-2 and PE-3 redistribute AD per-EVI routes with the same route key so that PE-1 and PE-4 select one of the two gateways based on BGP best path selection, not on the EVPN selection criteria.

The anycast gateways attached to the two domains redistribute the EVPN AD per-EVI routes between these domains and reset the ESI to zero. The anycast gateways prepend the received D-PATH attribute with source domain ID 64500:101 when redistributing the AD per-EVI route to the MPLS domain. In this simple topology, the D-PATH attribute was not present in the route received from PE-4, so the gateway PE-2 adds the D-PATH attribute to the route. The D-PATH attribute avoids control plane loops: when PE-2 receives an AD per-EVI route redistributed by PE-3 in the MPLS domain and the D-PATH contains domain ID 64500:101 which is local to PE-2, PE-2 does not install this AD per-EVI route. D-PATH is considered in the BGP best path selection unless d-path-ignore is configured and bgp-path-selection is configured for the AD per-EVI routes. The router compares the D-PATH attribute received in VPWS AD per-EVI routes with the same route key, as follows:

  • The routes with the shortest D-PATH are preferred; the other routes are not installed. Routes without D-PATH attributes are considered zero-length D-PATH.
  • The routes with the numerically lowest left-most domain ID are preferred; the other routes are not installed.
Note: In this example topology with two domains, the D-PATH (if present) only contains one domain ID. When multiple domains are traversed, the D-PATH attribute needs to be propagated to avoid loops.

RDs and route targets in BGP instances

The following command shows the BGP RDs and route target in Epipe-1 on PE-2. The RD 64500:1 for BGP 1 and the RD 64500:2 for BGP 2 are configured, but the route target 64500:1 is derived from the Autonomous System Number (ASN) 65400 and the EVI 1.

*A:PE-2# show service id "Epipe-1" bgp

===============================================================================
BGP Information
===============================================================================
Bgp Instance         : 1
Vsi-Import           : None
Vsi-Export           : None
Route Dist           : 64500:1
Oper Route Dist      : 64500:1
Oper RD Type         : configured
Rte-Target Import    : None                 Rte-Target Export: None
Oper RT Imp Origin   : derivedEvi           Oper RT Import   : 64500:1
Oper RT Exp Origin   : derivedEvi           Oper RT Export   : 64500:1
ADV Service MTU      : None
PW-Template Id       : None
-------------------------------------------------------------------------------
Bgp Instance         : 2
Vsi-Import           : None
Vsi-Export           : None
Route Dist           : 64500:2
Oper Route Dist      : 64500:2
Oper RD Type         : configured
Rte-Target Import    : None                 Rte-Target Export: None
Oper RT Imp Origin   : derivedEvi           Oper RT Import   : 64500:1
Oper RT Exp Origin   : derivedEvi           Oper RT Export   : 64500:1
ADV Service MTU      : None
===============================================================================

On PE-3, the RDs and route target are identical for Epipe-1.

The following command shows the BGP RDs and route target in Epipe-2 on PE-2. The RD 192.0.2.2:2 for BGP 1 is derived from the system IP address and the EVI 2; the RD 192.0.2.2:60000 for BGP 2 is derived via auto-rd. The route target is derived from the ASN 65400 and the EVI 2: 64500:2.

*A:PE-2# show service id "Epipe-2" bgp

===============================================================================
BGP Information
===============================================================================
Bgp Instance         : 1
Vsi-Import           : None
Vsi-Export           : None
Route Dist           : None
Oper Route Dist      : 192.0.2.2:2
Oper RD Type         : derivedEvi
Rte-Target Import    : None                 Rte-Target Export: None
Oper RT Imp Origin   : derivedEvi           Oper RT Import   : 64500:2
Oper RT Exp Origin   : derivedEvi           Oper RT Export   : 64500:2
ADV Service MTU      : None
PW-Template Id       : None
-------------------------------------------------------------------------------
Bgp Instance         : 2
Vsi-Import           : None
Vsi-Export           : None
Route Dist           : auto-rd
Oper Route Dist      : 192.0.2.2:60000
Oper RD Type         : auto
Rte-Target Import    : None                 Rte-Target Export: None
Oper RT Imp Origin   : derivedEvi           Oper RT Import   : 64500:2
Oper RT Exp Origin   : derivedEvi           Oper RT Export   : 64500:2
ADV Service MTU      : None
===============================================================================

On PE-3, the RDs are different for Epipe-2 because the system IP address 192.0.2.3 is used; the route target is the same as on PE-2.

SRv6 to MPLS interworking

The following command on PE-2 shows the BGP-EVPN information for Epipe-1, with EVI 1 and the ACs which all have explicitly configured endpoints:

*A:PE-2# show service id 1 bgp-evpn

===============================================================================
BGP EVPN
===============================================================================
EVI                : 1

-------------------------------------------------------------------------------
Local AC Name                    Eth Tag  Endpoint                     BGP-Inst
-------------------------------------------------------------------------------
GW-MPLS-1                        123      MPLS                         1
GW-SRv6-1                        1623     SRv6                         2
-------------------------------------------------------------------------------
Number of local ACs : 2

-------------------------------------------------------------------------------
Remote AC Name                   Eth Tag  Endpoint                     BGP-Inst
-------------------------------------------------------------------------------
AC-PE-1-1                        11       MPLS                         1
AC-PE-4-1                        14       SRv6                         2
-------------------------------------------------------------------------------
Number of Remote ACs : 2
===============================================================================

===============================================================================
BGP EVPN MPLS Information
===============================================================================
Admin Status       : Enabled            Bgp Instance       : 1
Force Vlan Fwding  : Disabled
Force Qinq Fwding  : none
Route NextHop Type : system-ipv4
Control Word       : Disabled
Max Ecmp Routes    : 1
Entropy Label      : Disabled
Default Route Tag  : none
Oper Group         : (none)
MH Mode            : access
Domain-Id          : 64500:100
Evi 3-byte Auto-RT : Disabled
Dyn Egr Lbl Limit  : Disabled
Hash Label         : Disabled
Local AC Ingr Lbl  : 524284 (GW-MPLS-1)

BGP EVPN MPLS Auto Bind Tunnel Information
-------------------------------------------------------------------------------
Allow-Flex-Algo-FB : Disabled
Resolution         : any                Strict Tnl Tag     : Disabled
Max Ecmp Routes    : 1
Filter Tunnel Types: (Not Specified)
Weighted Ecmp      : Disabled
===============================================================================

===============================================================================
BGP EVPN Segment Routing v6 Information
===============================================================================
Admin State             : Enabled                 Bgp Instance  : 2
Srv6 Instance           : 1
Default Locator         : PE2-loc

Oper Group              : (none)
Default Route Tag       : 0x0
Source Address          : 2001:db8::2:2
ECMP                    : 1
Force Vlan VC Fwd       : Disabled
Next Hop Type           : system-ipv6
Evi 3-byte Auto-RT      : disabled
Route Resolution        : route-table
Force QinQ VC Fwd       : none
MH Mode                 : network
Domain-Id               : 64500:101
===============================================================================

The preceding command did not specify the BGP instance, so both BGP 1 and BGP 2 are displayed. The following command on PE-2 shows the BGP-EVPN information for Epipe-2 for BGP 1, with EVI 2 and ACs with implicit endpoints:

*A:PE-2# show service id 2 bgp-evpn instance 1

===============================================================================
BGP EVPN
===============================================================================
EVI                : 2

-------------------------------------------------------------------------------
Local AC Name                    Eth Tag  Endpoint                     BGP-Inst
-------------------------------------------------------------------------------
GW-MPLS-2                        223                                   1
-------------------------------------------------------------------------------
Number of local ACs : 1

-------------------------------------------------------------------------------
Remote AC Name                   Eth Tag  Endpoint                     BGP-Inst
-------------------------------------------------------------------------------
AC-PE-1-2                        21                                    1
-------------------------------------------------------------------------------
Number of Remote ACs : 1
===============================================================================

===============================================================================
BGP EVPN MPLS Information
===============================================================================
Admin Status       : Enabled            Bgp Instance       : 1
Force Vlan Fwding  : Disabled
Force Qinq Fwding  : none
Route NextHop Type : system-ipv4
Control Word       : Disabled
Max Ecmp Routes    : 1
Entropy Label      : Disabled
Default Route Tag  : none
Oper Group         : (none)
MH Mode            : access
Domain-Id          : 64500:100
Evi 3-byte Auto-RT : Disabled
Dyn Egr Lbl Limit  : Disabled
Hash Label         : Disabled
Local AC Ingr Lbl  : 524282 (GW-MPLS-2)

BGP EVPN MPLS Auto Bind Tunnel Information
-------------------------------------------------------------------------------
Allow-Flex-Algo-FB : Disabled
Resolution         : any                Strict Tnl Tag     : Disabled
Max Ecmp Routes    : 1
Filter Tunnel Types: (Not Specified)
Weighted Ecmp      : Disabled
===============================================================================

The following command on PE-2 shows the BGP-EVPN information for Epipe-2 for BGP 2, with EVI 2 and ACs with explicitly configured endpoints:

*A:PE-2# show service id 2 bgp-evpn instance 2

===============================================================================
BGP EVPN
===============================================================================
EVI                : 2

-------------------------------------------------------------------------------
Local AC Name                    Eth Tag  Endpoint                     BGP-Inst
-------------------------------------------------------------------------------
GW-SRv6-2                        2623     SRv6                         2
-------------------------------------------------------------------------------
Number of local ACs : 1

-------------------------------------------------------------------------------
Remote AC Name                   Eth Tag  Endpoint                     BGP-Inst
-------------------------------------------------------------------------------
AC-PE-4-2                        24       SRv6                         2
-------------------------------------------------------------------------------
Number of Remote ACs : 1
===============================================================================

===============================================================================
BGP EVPN Segment Routing v6 Information
===============================================================================
Admin State             : Enabled                 Bgp Instance  : 2
Srv6 Instance           : 1
Default Locator         : PE2-loc

Oper Group              : (none)
Default Route Tag       : 0x0
Source Address          : 2001:db8::2:2
ECMP                    : 1
Force Vlan VC Fwd       : Disabled
Next Hop Type           : system-ipv6
Evi 3-byte Auto-RT      : disabled
Route Resolution        : route-table
Force QinQ VC Fwd       : none
MH Mode                 : network
Domain-Id               : 64500:101
===============================================================================
Verification for the MPLS domain

PE-1 receives the following two AD per-EVI routes for Epipe-1 with the same route key (Ethernet tag 123, ESI-0, RD 64500:1), so the routes are equal and the BGP selection criteria are used. The tiebreaker is the originator with the lowest router ID, so the route received from PE-2 is preferred:

*A:PE-1# show router bgp routes evpn auto-disc rd 64500:1
===============================================================================
 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 EVPN Auto-Disc Routes
===============================================================================
Flag  Route Dist.         ESI                           NextHop
      Tag                                               Label
-------------------------------------------------------------------------------
u*>i  64500:1             ESI-0                         192.0.2.2
      123                                               LABEL 524284

*>i   64500:1             ESI-0                         192.0.2.3
      123                                               LABEL 524284

-------------------------------------------------------------------------------
Routes : 2
===============================================================================

PE-1 establishes the following EVPN-MPLS destination to PE-2:

*A:PE-1# show service id "Epipe-1" evpn-mpls instance 1

===============================================================================
BGP EVPN-MPLS Dest (Instance 1)
===============================================================================
TEP Address                         Egr Label               Last Change
                                     Transport:Tnl-id
-------------------------------------------------------------------------------
192.0.2.2                           524284                  10/16/2024 12:22:53
                                    isis:524292
-------------------------------------------------------------------------------
Number of entries : 1
-------------------------------------------------------------------------------
===============================================================================

===============================================================================
BGP EVPN-MPLS Ethernet Segment Dest (Instance 1)
===============================================================================
Eth SegId                               Last Change
-------------------------------------------------------------------------------
No Matching Entries
===============================================================================

Gateway PE-2 receives the following AD per-EVI from PE-1:

*A:PE-2# show router bgp routes evpn auto-disc rd 192.0.2.1:1
===============================================================================
 BGP Router ID:192.0.2.2        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 EVPN Auto-Disc Routes
===============================================================================
Flag  Route Dist.         ESI                           NextHop
      Tag                                               Label
-------------------------------------------------------------------------------
u*>i  192.0.2.1:1         ESI-0                         192.0.2.1
      11                                                LABEL 524285

-------------------------------------------------------------------------------
Routes : 1
===============================================================================

PE-3 receives the same AD per-EVI from PE-1.

PE-2 establishes the following EVPN-MPLS destination toward PE-1:

*A:PE-2# show service id "Epipe-1" evpn-mpls instance 1

===============================================================================
BGP EVPN-MPLS Dest (Instance 1)
===============================================================================
TEP Address                         Egr Label               Last Change
                                     Transport:Tnl-id
-------------------------------------------------------------------------------
192.0.2.1                           524285                  10/16/2024 12:22:51
                                    isis:524292
-------------------------------------------------------------------------------
Number of entries : 1
-------------------------------------------------------------------------------
===============================================================================

===============================================================================
BGP EVPN-MPLS Ethernet Segment Dest (Instance 1)
===============================================================================
Eth SegId                               Last Change
-------------------------------------------------------------------------------
No Matching Entries
===============================================================================

Similarly, on PE-3, the following EVPN-MPLS destination is established toward PE-1:

*A:PE-3# show service id "Epipe-1" evpn-mpls instance 1

===============================================================================
BGP EVPN-MPLS Dest (Instance 1)
===============================================================================
TEP Address                         Egr Label               Last Change
                                     Transport:Tnl-id
-------------------------------------------------------------------------------
192.0.2.1                           524285                  10/16/2024 12:22:51
                                    isis:524292
-------------------------------------------------------------------------------
Number of entries : 1
-------------------------------------------------------------------------------
===============================================================================

===============================================================================
BGP EVPN-MPLS Ethernet Segment Dest (Instance 1)
===============================================================================
Eth SegId                               Last Change
-------------------------------------------------------------------------------
No Matching Entries
===============================================================================
Verification for the SRv6 domain

Gateway PE-2 receives the following AD per-EVI route from PE-4:

*A:PE-2# show router bgp routes evpn auto-disc rd 192.0.2.4:1
===============================================================================
 BGP Router ID:192.0.2.2        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 EVPN Auto-Disc Routes
===============================================================================
Flag  Route Dist.         ESI                           NextHop
      Tag                                               Label
-------------------------------------------------------------------------------
u*>i  192.0.2.4:1         ESI-0                         2001:db8::2:4
      14                                                524288

-------------------------------------------------------------------------------
Routes : 1
===============================================================================

PE-3 receives the same AD per-EVI route from PE-4.

PE-2 establishes the following EVPN-SRv6 destination to PE-4:

*A:PE-2# show service id "Epipe-1" segment-routing-v6 destinations

===============================================================================
TEP, SID (Instance 1)
===============================================================================
TEP Address                             Segment Id
-------------------------------------------------------------------------------
2001:db8::2:4                           2001:db8:aaaa:104:8000::
-------------------------------------------------------------------------------
Number of TEP, SID: 1
-------------------------------------------------------------------------------
===============================================================================

===============================================================================
Segment Routing v6 Ethernet Segment Dest (Instance 1)
===============================================================================
Eth SegId                                 Num. Macs     Last Update
-------------------------------------------------------------------------------
No Matching Entries
===============================================================================

Similarly, PE-3 establishes the following EVPN-SRv6 destination to PE-4:

*A:PE-3# show service id "Epipe-1" segment-routing-v6 destinations

===============================================================================
TEP, SID (Instance 1)
===============================================================================
TEP Address                             Segment Id
-------------------------------------------------------------------------------
2001:db8::2:4                           2001:db8:aaaa:104:8000::
-------------------------------------------------------------------------------
Number of TEP, SID: 1
-------------------------------------------------------------------------------
===============================================================================

===============================================================================
Segment Routing v6 Ethernet Segment Dest (Instance 1)
===============================================================================
Eth SegId                                 Num. Macs     Last Update
-------------------------------------------------------------------------------
No Matching Entries
===============================================================================

PE-4 receives the following two AD per-EVI routes for Epipe-1 with the same route key (Ethernet tag 1623, ESI-0, RD 64500:2) from the gateways, so the routes are equal and the BGP selection criteria are used. The tiebreaker is the originator with the lowest router ID, so the route received from PE-2 is preferred:

*A:PE-4# show router bgp routes evpn auto-disc rd 64500:2
===============================================================================
 BGP Router ID:192.0.2.4        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 EVPN Auto-Disc Routes
===============================================================================
Flag  Route Dist.         ESI                           NextHop
      Tag                                               Label
-------------------------------------------------------------------------------
u*>i  64500:2             ESI-0                         2001:db8::2:2
      1623                                              524286

*>i   64500:2             ESI-0                         2001:db8::2:3
      1623                                              524286

-------------------------------------------------------------------------------
Routes : 2
===============================================================================

PE-4 establishes the following EVPN-SRv6 destination to PE-2:

*A:PE-4# show service id "Epipe-1" segment-routing-v6 destinations

===============================================================================
TEP, SID (Instance 1)
===============================================================================
TEP Address                             Segment Id
-------------------------------------------------------------------------------
2001:db8::2:2                           2001:db8:aaaa:102:7fff:e000::
-------------------------------------------------------------------------------
Number of TEP, SID: 1
-------------------------------------------------------------------------------
===============================================================================

===============================================================================
Segment Routing v6 Ethernet Segment Dest (Instance 1)
===============================================================================
Eth SegId                                 Num. Macs     Last Update
-------------------------------------------------------------------------------
No Matching Entries
===============================================================================

Attribute propagation

By default, attribute propagation is disabled, so attributes such as the color or the D-PATH are not propagated in the redistributed AD per-EVI routes.

Redistributed AD per-EVI routes without attribute propagation

AD per-EVI route from SRv6 domain redistributed into MPLS domain shows the AD per-EVI route originated by PE-4 in the SRv6 domain and redistributed by the gateways PE-2 and PE-3 into the MPLS domain. The AD per-EVI route from PE-4 contains a color attribute that is added by an export policy. PE-2 receives the following AD per-EVI route from PE-4 with color:01:1, Ethernet tag 14, RD 192.0.2.4:1, and SID 2001:db8:aaaa:104:: for Epipe-1:

*A:PE-2# show router bgp routes evpn auto-disc tag 14 detail
===============================================================================
 BGP Router ID:192.0.2.2        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 EVPN Auto-Disc Routes
===============================================================================
Original Attributes

Network        : n/a
Nexthop        : 2001:db8::2:4
Path Id        : None
From           : 2001:db8::2:4
Res. Nexthop   : fe80::1a:1ff:fe01:b
Local Pref.    : 100                    Interface Name : int-PE-2-PE-4
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : color:01:1 target:64500:1
                 l2-attribute:MTU: 1514 F: 0 C: 0 P: 0 B: 0
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.4
Origin         : IGP
Flags          : Used Valid Best
Route Source   : Internal
AS-Path        : No As-Path
EVPN type      : AUTO-DISC
ESI            : ESI-0
Tag            : 14
Route Dist.    : 192.0.2.4:1
MPLS Label     : 524288
Route Tag      : 0
Neighbor-AS    : n/a
DB Orig Val    : N/A                    Final Orig Val : N/A
Source Class   : 0                      Dest Class     : 0
Add Paths Send : Default
Last Modified  : 00h21m22s
SRv6 TLV Type  : SRv6 L2 Service TLV (6)
SRv6 SubTLV    : SRv6 SID Information (1)
Sid            : 2001:db8:aaaa:104::
Full Sid       : 2001:db8:aaaa:104:8000::
Behavior       : End.DX2 (21)
SRv6 SubSubTLV : SRv6 SID Structure (1)
Loc-Block-Len  : 48                     Loc-Node-Len   : 16
Func-Len       : 20                     Arg-Len        : 0
Tpose-Len      : 20                     Tpose-offset   : 64
---snip---

Similarly, PE-3 receives an AD per-EVI route from PE-4 with color:01:1, Ethernet tag 14, RD 192.0.2.4:1, and SID 2001:db8:aaaa:104:: for Epipe-1 (not shown). Both PE-2 and PE-3 redistribute the AD per-EVI into the MPLS domain to PE-1, with Ethernet tag 123, RD 64500:1 for BGP 1, and domain ID 64500:101 for the originating SRv6 domain, but without the color attribute in the extended community. The following command on PE-1 shows the received AD per-EVI route from the gateway PE-2:

*A:PE-1# show router bgp routes evpn auto-disc tag 123 detail
===============================================================================
 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 EVPN Auto-Disc Routes
===============================================================================
Original Attributes

Network        : n/a
Nexthop        : 192.0.2.2
Path Id        : None
From           : 192.0.2.2
Res. Nexthop   : 192.168.12.2
Local Pref.    : 100                    Interface Name : int-PE-1-PE-2
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : target:64500:1
                 l2-attribute:MTU: 1514 F: 0 C: 0 P: 0 B: 0
                 bgp-tunnel-encap:MPLS
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.2
Origin         : IGP
Flags          : Used Valid Best
Route Source   : Internal
AS-Path        : No As-Path
D-Path         : [64500:101:(local)]
EVPN type      : AUTO-DISC
ESI            : ESI-0
Tag            : 123
Route Dist.    : 64500:1
MPLS Label     : LABEL 524284
Route Tag      : 0
Neighbor-AS    : n/a
DB Orig Val    : N/A                    Final Orig Val : N/A
Source Class   : 0                      Dest Class     : 0
Add Paths Send : Default
Last Modified  : 00h22m05s
---snip---
Redistributed AD per-EVI routes with attribute propagation

The following command enables attribute propagation and BGP path selection for AD per-EVI routes on the gateways:

# on PE-2, PE-3:
configure
    service
        system
            bgp-evpn
                ad-per-evi-routes
                    attribute-propagation

The attribute-propagation command can only be enabled after disabling all EVPN services. The following error is raised when attempting to enable attribute propagation when services have EVPN enabled:

*A:PE-2>config>service>system>bgp-evpn>ad-per-evi-routes# attribute-propagation
MINOR: SVCMGR #1003 Inconsistent value - attribute-propagation cannot be enabled/disabled when there are evpn enabled services

The following configuration shows that the EVPN-MPLS BGP 1 and EVPN-SRv6 BGP 2 instance is disabled in EVPN VPWS Epipe-1 and Epipe-2 before enabling the attribute propagation. For PE-2 and PE-3, both EVPN-MPLS and EVPN-SRv6 need to be disabled, as follows:

# on PE-2, PE-3:
configure
    service
        epipe "Epipe-1"
            bgp-evpn
                mpls bgp 1
                    shutdown
                exit
                segment-routing-v6 bgp 2
                    shutdown
                exit
            exit
        exit
        epipe "Epipe-2"
            bgp-evpn
                mpls bgp 1
                    shutdown
                exit
                segment-routing-v6 bgp 2
                    shutdown
                exit
            exit
        exit
        system
            bgp-evpn 
                ad-per-evi-routes
                    attribute-propagation
                exit
            exit
        exit
        epipe "Epipe-1"
            bgp-evpn
                mpls bgp 1
                    no shutdown
                exit
                segment-routing-v6 bgp 2
                    no shutdown
                exit
            exit
        exit
        epipe "Epipe-2"
            bgp-evpn
                mpls bgp 1
                    no shutdown
                exit
                segment-routing-v6 bgp 2
                    no shutdown
                exit
            exit
        exit

The gateways propagate all BGP attributes when redistributing the AD per-EVI routes for the VPWS service. Redistributing AD per-EVI routes from the SRv6 domain into the MPLS domain with attribute propagation shows that the color attribute is propagated by the gateways when redistributing the AD per-EVI route in the MPLS domain:

Figure 5. Redistributing AD per-EVI routes from the SRv6 domain into the MPLS domain with attribute propagation

PE-2 receives an AD per-EVI from PE-4 with the color attribute (color:01:1) in the extended community, as follows:

*A:PE-2# show router bgp routes evpn auto-disc rd 192.0.2.4:1 hunt | match Community context all
Community      : color:01:1 target:64500:1
                 l2-attribute:MTU: 1514 F: 0 C: 0 P: 0 B: 0

Similarly, PE-3 receives the color attribute in the extended community. When PE-2 and PE-3 propagate the attributes, PE-1 receives the color attribute in both AD per-EVI routes, as follows:

*A:PE-1# show router bgp routes evpn auto-disc rd 64500:1 hunt
===============================================================================
 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 EVPN Auto-Disc Routes
===============================================================================
-------------------------------------------------------------------------------
RIB In Entries
-------------------------------------------------------------------------------
---snip---
Network        : n/a
Nexthop        : 192.0.2.2
Path Id        : None
From           : 192.0.2.2
Res. Nexthop   : 192.168.12.2
Local Pref.    : 100                    Interface Name : int-PE-1-PE-2
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : target:64500:1 l2-attribute:MTU: 1514 V: 0 M: 0 F: 0 C: 0 P:
                 0 B: 0 bgp-tunnel-encap:MPLS color:01:1
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.2
Origin         : IGP
Flags          : Used Valid Best
---snip---

-------------------------------------------------------------------------------

Network        : n/a
Nexthop        : 192.0.2.3
Path Id        : None
From           : 192.0.2.3
Res. Nexthop   : 192.168.13.2
Local Pref.    : 100                    Interface Name : int-PE-1-PE-3
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : target:64500:1 l2-attribute:MTU: 1514 V: 0 M: 0 F: 0 C: 0 P:
                 0 B: 0 bgp-tunnel-encap:MPLS color:01:1
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.3
Origin         : IGP
Flags          : Valid Best
TieBreakReason : PeerRouterID
---snip---

BGP path selection for equal route key

PE-1 and PE-4 receive two AD per-EVI routes with identical route key (Ethernet tag, ESI-0, RD) for Epipe-1, so the BGP route selection criteria apply. However, for Epipe-2, the RDs are different, so BGP hands over the routes to EVPN and the EVPN application performs the selection (which can be based on a default set of rules or based on BGP best path selection). Both for the BGP selection and for the EVPN selection, the tiebreaker is the IP address of the originator, so the AD per-EVI routes from PE-2 are preferred. However, the BGP selection changes in a topology where the AS path is longer for one of the peers: the BGP decision takes into account the AS path length while the EVPN selection does not.

To illustrate this, a policy is configured on PE-2 to prepend ASN 64999 to the AS path and this export policy is applied for the BGP peers of PE-2.

# on PE-2:
configure
    router Base
        policy-options
            begin
            policy-statement "prepend ASN"
                entry 10
                    from
                        evpn-type 1
                    exit
                    action accept
                        as-path-prepend 64499 1     # prepend ASN 64499 repeat 1
                    exit
                exit
            exit
            commit
        exit
        bgp
            group "mpls" 
                neighbor 192.0.2.1
                    export "prepend ASN"
                exit
            exit
            group "srv6"
                neighbor 2001:db8::2:4
                    export "prepend ASN"
                exit
            exit

PE-4 receives two AD per-EVI routes for Epipe-1 with identical route key, so the BGP selection applies. The following command shows that the route received from PE-3 is preferred over the route received from PE-2:

A:PE-4# show router bgp routes evpn auto-disc rd 64500:2
===============================================================================
 BGP Router ID:192.0.2.4        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 EVPN Auto-Disc Routes
===============================================================================
Flag  Route Dist.         ESI                           NextHop
      Tag                                               Label
-------------------------------------------------------------------------------
u*>i  64500:2             ESI-0                         2001:db8::2:3
      1623                                              524286

*i    64500:2             ESI-0                         2001:db8::2:2
      1623                                              524286

-------------------------------------------------------------------------------
Routes : 2
===============================================================================

The tiebreaker for the unused AD per-EVI route received from PE-2 is the AS path length, as follows:

*A:PE-4# show router bgp routes evpn auto-disc rd 64500:2 detail
===============================================================================
 BGP Router ID:192.0.2.4        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 EVPN Auto-Disc Routes
===============================================================================
---snip---

-------------------------------------------------------------------------------
Original Attributes

Network        : n/a
Nexthop        : 2001:db8::2:2
Path Id        : None
From           : 2001:db8::2:2
Res. Nexthop   : fe80::e:1ff:fe01:1
Local Pref.    : 100                    Interface Name : int-PE-4-PE-2
Aggregator AS  : None                   Aggregator     : None
Atomic Aggr.   : Not Atomic             MED            : None
AIGP Metric    : None                   IGP Cost       : 10
Connector      : None
Community      : target:64500:1
                 l2-attribute:MTU: 1514 F: 0 C: 0 P: 0 B: 0
Cluster        : No Cluster Members
Originator Id  : None                   Peer Router Id : 192.0.2.2
Origin         : IGP
Flags          : Valid
TieBreakReason : ASPathLen              MP Exc. Reason : LongerASPath
Route Source   : Internal
AS-Path        : 64499
D-Path         : [64500:100:(local)]
EVPN type      : AUTO-DISC
ESI            : ESI-0
Tag            : 1623
Route Dist.    : 64500:2
MPLS Label     : 524286
Route Tag      : 0
Neighbor-AS    : 64499
DB Orig Val    : N/A                    Final Orig Val : N/A
Source Class   : 0                      Dest Class     : 0
Add Paths Send : Default
Last Modified  : 00h00m20s
SRv6 TLV Type  : SRv6 L2 Service TLV (6)
SRv6 SubTLV    : SRv6 SID Information (1)
Sid            : 2001:db8:aaaa:102::
Full Sid       : 2001:db8:aaaa:102:7fff:e000::
Behavior       : End.DX2 (21)
SRv6 SubSubTLV : SRv6 SID Structure (1)
Loc-Block-Len  : 48                     Loc-Node-Len   : 16
Func-Len       : 20                     Arg-Len        : 0
Tpose-Len      : 20                     Tpose-offset   : 64
---snip---

For Epipe-2, the RDs are different, so the EVPN application performs the default selection and the IP address of the originator is the selection criterion. At the BGP level, both AD per-EVI routes from PE-2 and PE-3 are shown as "used" for Epipe-2 on PE-4, as follows:

*A:PE-4# show router bgp routes evpn auto-disc tag 2623
===============================================================================
 BGP Router ID:192.0.2.4        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 EVPN Auto-Disc Routes
===============================================================================
Flag  Route Dist.         ESI                           NextHop
      Tag                                               Label
-------------------------------------------------------------------------------
u*>i  192.0.2.2:60000     ESI-0                         2001:db8::2:2
      2623                                              524284

u*>i  192.0.2.3:60000     ESI-0                         2001:db8::2:3
      2623                                              524284

-------------------------------------------------------------------------------
Routes : 2
===============================================================================

In this example, PE-4 establishes an EVPN destination toward PE-3 for Epipe-1 because the BGP path selection prefers the shortest AS path:

*A:PE-4# show service id "Epipe-1" segment-routing-v6 destinations

===============================================================================
TEP, SID (Instance 1)
===============================================================================
TEP Address                             Segment Id
-------------------------------------------------------------------------------
2001:db8::2:3                           2001:db8:aaaa:103:7fff:e000::
-------------------------------------------------------------------------------
Number of TEP, SID: 1
-------------------------------------------------------------------------------
===============================================================================

===============================================================================
Segment Routing v6 Ethernet Segment Dest (Instance 1)
===============================================================================
Eth SegId                                 Num. Macs     Last Update
-------------------------------------------------------------------------------
No Matching Entries
===============================================================================

PE-4 establishes an EVPN destination toward PE-2 for Epipe-2 because the EVPN path selection prefers the lowest next-hop IP address of the AD per-EVI route:

*A:PE-4# show service id "Epipe-2" segment-routing-v6 destinations

===============================================================================
TEP, SID (Instance 1)
===============================================================================
TEP Address                             Segment Id
-------------------------------------------------------------------------------
2001:db8::2:2                           2001:db8:aaaa:102:7fff:c000::
-------------------------------------------------------------------------------
Number of TEP, SID: 1
-------------------------------------------------------------------------------
===============================================================================

===============================================================================
Segment Routing v6 Ethernet Segment Dest (Instance 1)
===============================================================================
Eth SegId                                 Num. Macs     Last Update
-------------------------------------------------------------------------------
No Matching Entries
===============================================================================

BGP path selection enabled for AD per-EVI routes

It is possible to configure BGP path selection for all AD per-EVI routes, so that EVPN can also apply BGP best path selection to routes with the same Ethernet Tag ID but different RDs, as follows on PE-4:

# on PE-4:
configure
    service
        epipe "Epipe-1"
            bgp-evpn
                segment-routing-v6 bgp 1
                    shutdown
                exit
            exit
        exit
        epipe "Epipe-2"
            bgp-evpn
                segment-routing-v6 bgp 1
                    shutdown
                exit
            exit
        exit
        system
            bgp-evpn 
                ad-per-evi-routes
                    attribute-propagation     # required for bgp-path-selection
                    bgp-path-selection
                exit
            exit
        exit
        epipe "Epipe-1"
            bgp-evpn
                segment-routing-v6 bgp 1
                    no shutdown
                exit
            exit
        exit
        epipe "Epipe-2"
            bgp-evpn
                segment-routing-v6 bgp 1
                    no shutdown
                exit
            exit
        exit

The following error is raised when attempting to enable BGP path selection when attribute propagation is disabled:

*A:PE-2>config>service>system>bgp-evpn>ad-per-evi-routes# bgp-path-selection
MINOR: SVCMGR #1003 Inconsistent value - bgp-path-selection cannot be enabled when attribute-propagation is disabled

With BGP path selection enabled for the AD per-EVI routes at the EVPN level, the status of the AD per-EVI routes with different RDs remains the same at BGP level, so both routes from PE-2 and PE-3 are used, as follows.

*A:PE-4# show router bgp routes evpn auto-disc community target:64500:2
===============================================================================
 BGP Router ID:192.0.2.4        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 EVPN Auto-Disc Routes
===============================================================================
Flag  Route Dist.         ESI                           NextHop
      Tag                                               Label
-------------------------------------------------------------------------------
u*>i  192.0.2.2:60000     ESI-0                         2001:db8::2:2
      2623                                              524284

u*>i  192.0.2.3:60000     ESI-0                         2001:db8::2:3
      2623                                              524284

-------------------------------------------------------------------------------
Routes : 2
===============================================================================

With BGP path selection enabled, the best path in Epipe-2 is based on the AS path length instead of the next-hop IP address. The AD per-EVI route received from PE-2 has ASN 64499 in the AS path; the AD per-EVI received from PE-3 has an empty AS path, as follows:

*A:PE-4# show router bgp routes evpn auto-disc rd 192.0.2.2:60000 detail | match AS-Path
AS-Path        : 64499
AS-Path        : 64499
*A:PE-4# show router bgp routes evpn auto-disc rd 192.0.2.3:60000 detail | match AS-Path
AS-Path        : No As-Path
AS-Path        : No As-Path

PE-4 establishes an EVPN destination to PE-3 for Epipe-2, as follows:

*A:PE-4# show service id "Epipe-2" segment-routing-v6 destinations

===============================================================================
TEP, SID (Instance 1)
===============================================================================
TEP Address                             Segment Id
-------------------------------------------------------------------------------
2001:db8::2:3                           2001:db8:aaaa:103:7fff:c000::
-------------------------------------------------------------------------------
Number of TEP, SID: 1
-------------------------------------------------------------------------------
===============================================================================

===============================================================================
Segment Routing v6 Ethernet Segment Dest (Instance 1)
===============================================================================
Eth SegId                                 Num. Macs     Last Update
-------------------------------------------------------------------------------
No Matching Entries
===============================================================================

Conclusion

SRv6 to MPLS interworking is required during the migration to SRv6 and also to interwork with non-SRv6 legacy networks. EVPN VPWS services support the stitching of MPLS and SRv6.

Appendix: best path selection rules

This appendix lists the default route selection rules and the BGP selection rules for AD per-EVI routes.

Default EVPN route selection for AD per-EVI routes

When two or more EVPN routes are received at a PE, BGP route selection typically takes place when the route key or the routes are equal. When the route key is different, but the PE has to make a selection, BGP hands over the routes to EVPN and the EVPN application performs the default selection based on the following tie-breaking order:
  1. Lowest IP (next-hop IP of the EVPN NLRI).
  2. Lowest Ethernet tag.
  3. Lowest RD.
  4. Lowest BGP instance (this tie-breaking rule is only considered if the service has two BGP instances of the same encapsulation).

BGP best-path selection for AD per-EVI routes

When a BGP router has multiple paths in its RIB for the same NLRI, its BGP decision process is responsible for deciding which path is the best. The best path can be used by the local router and advertised to other BGP peers.

On SR OS routers, the BGP decision process orders received paths based on the following sequence of comparisons. If there is a tie between paths at any step, BGP proceeds to the next step.

  1. Highest local preference
  2. Shortest D-PATH (if d-path-ignore is disabled)
  3. Lowest left-most D-PATH domain-id (if d-path-ignore is disabled)
  4. Shortest AS-PATH
  5. Lowest Origin
  6. Lowest MED
  7. EBGP wins over IBGP
  8. Lowest tunnel-table cost to the next-hop
  9. Lowest next-hop type wins (resolution in TTM wins over RTM)
  10. Lowest router ID (applicable to IBGP peers only)
  11. Shortest cluster list length (applicable to IBGP peers only)
  12. Lowest IP address of the peer that advertised the route
  13. Next-hop check (IPv4 next-hop wins, then lowest next-hop wins)
  14. Lowest RD
  15. Lowest path ID (add-path)