Automated Steering with Segment Routing TE Policy Deployed

« 2024 May 18 »

What is Segment Routing Traffic Engineering Automated Steering?

Segment Routing Automated Steering provides a mechanism to match the BGP color extended community value and the BGP next-hop IP address with a configured Traffic Engineering policy. An MPLS Layer-3 VPN egress PE router can attract traffic via a Traffic Engineering path by applying a BGP color community value to the advertised VPNv4 prefixes. When an ingress PE receives a VPNv4 prefix that matches the color value and end-point address of a locally configured policy, then it automatically routes traffic through the defined policy.

Automated Steering Segment Routing Introduction Explained with BGP color community value and SR TE policy
SR TE Automated Steering configuration summary IOS XE
Ingress PE has SR TE policy color 100 configured Egress PE advertises BGP community color 100
PE1#show run | sec ^segment
segment-routing mpls
 !
 connected-prefix-sid-map
  address-family ipv4
   1.1.1.1/32 index 1 range 1 
  exit-address-family
 !
segment-routing traffic-eng
 segment-list name EXAMPLE-PATH
  index 1 mpls label 16005
  index 2 mpls label 16004
  index 3 mpls label 16003
  index 4 mpls label 16002
 !
 policy EXAMPLE-POLICY
  color 100 end-point 2.2.2.2
  candidate-paths
   preference 1
    explicit segment-list EXAMPLE-PATH
    !
   !
  !
 !
PE2#show run | sec ^router bgp
router bgp 65100
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 65100
 neighbor 1.1.1.1 update-source Loopback10
 !
 address-family vpnv4
  neighbor 1.1.1.1 activate
  neighbor 1.1.1.1 send-community extended
  neighbor 1.1.1.1 route-map RMAP-COLOR out
 exit-address-family
 !
 address-family ipv4 vrf Gold
  neighbor 10.0.2.2 remote-as 65002
  neighbor 10.0.2.2 activate
 exit-address-family

PE2#show run | sec ^route-map 
route-map RMAP-COLOR permit 10 
 set extcommunity color 100

How to configure SR TE Automated Steering with MPLS L3VPN? (IOS XE)

In the following example topology two sites are connected through an MPLS L3VPN Service Provider network using VRF Gold. The MPLS transport network is enabled with Segment Routing (SR), and Traffic Engineering (TE) is configured with Automated Steering using the BGP extended community color value.

This means, PE R7 assigns the color community value 100 to all advertised VPNv4 routes using a route-map. The BGP Route Reflector R9 receives the VPN routes from R7, and advertises them to PE R2. On PE R2 there is an SR TE policy configured with a matching color value 100 and a matching BGP next-hop IP address 7.7.7.7 (end-point of SR TE policy). As a result, any VPNv4 routes received on PE R2 with the community color value 100 will be routed according to the matching SR TE policy.

Segment Routing Traffic Engineering Automated Steering configuration with MPLS L3VPN network using BGP VPNv4 prefix and color extended community

Configuration:

R2 (PE)
    R2#show run | sec ^mpls
    mpls label range 200 299
    
    R2#show run | sec ^segment
    segment-routing mpls
     !
     connected-prefix-sid-map
      address-family ipv4
       2.2.2.2/32 index 2 range 1 
      exit-address-family
     !
    segment-routing traffic-eng
     segment-list name EXAMPLE-PATH
      index 1 mpls label 16003
      index 2 mpls label 16005
      index 3 mpls label 16006
      index 4 mpls label 16007
     !
     policy EXAMPLE-POLICY
      color 100 end-point 7.7.7.7
      candidate-paths
       preference 1
        explicit segment-list EXAMPLE-PATH
        !
       !
      !
     !
    
    R2#show run | sec ^vrf    
    vrf definition Gold
     rd 65100:1
     !
     address-family ipv4
      route-target export 65100:1
      route-target import 65100:2
     exit-address-family
    
    R2#show run int Lo10 | sec ^int
    interface Loopback10
     ip address 2.2.2.2 255.255.255.255
    
    R2#show run int Gi1 | sec int
    interface GigabitEthernet1
     description ** to CE R1 **
     no ip address
     negotiation auto
     no mop enabled
     no mop sysid
     
    R2#show run int Gi1.10 | sec ^int
    interface GigabitEthernet1.10
     description ** to CE R1 in VRF Gold **
     encapsulation dot1Q 10
     vrf forwarding Gold
     ip address 10.0.1.1 255.255.255.252
    
    R2#show run int Gi2 | sec ^int   
    interface GigabitEthernet2
     description ** to R3 **
     ip address 10.1.0.1 255.255.255.252
     ip ospf network point-to-point
     negotiation auto
     no mop enabled
     no mop sysid
    
    R2#show run | sec ^router
    router ospf 10
     router-id 2.2.2.2
     segment-routing area 0 mpls
     segment-routing mpls
     distribute link-state
     network 2.2.2.2 0.0.0.0 area 0
     network 10.1.0.0 0.0.0.3 area 0
     mpls traffic-eng router-id Loopback10
     mpls traffic-eng area 0
    router bgp 65100
     bgp router-id 2.2.2.2
     bgp log-neighbor-changes
     neighbor 9.9.9.9 remote-as 65100
     neighbor 9.9.9.9 update-source Loopback10
     !
     address-family vpnv4
      neighbor 9.9.9.9 activate
      neighbor 9.9.9.9 send-community extended
     exit-address-family
     !
     address-family ipv4 vrf Gold
      neighbor 10.0.1.2 remote-as 65001
      neighbor 10.0.1.2 activate
     exit-address-family
    
R7 (PE)
    R7#show run | sec ^mpls
    mpls label range 700 799
    
    R7#show run | sec ^segment
    segment-routing mpls
     !
     connected-prefix-sid-map
      address-family ipv4
       7.7.7.7/32 index 7 range 1 
      exit-address-family
     !
    
    R7#show run | sec ^vrf    
    vrf definition Gold
     rd 65100:2
     !
     address-family ipv4
      route-target export 65100:2
      route-target import 65100:1
     exit-address-family
    
    R7#show run int Lo10 | sec int
    interface Loopback10
     ip address 7.7.7.7 255.255.255.255
    
    R7#show run int Gi1 | sec int 
    interface GigabitEthernet1
     description ** to CE R8 **
     no ip address
     negotiation auto
     no mop enabled
     no mop sysid
    
    R7#show run int Gi1.10 | sec int
    interface GigabitEthernet1.10
     description ** to CE R8 in VRF Gold **
     encapsulation dot1Q 10
     vrf forwarding Gold
     ip address 10.0.2.1 255.255.255.252
    
    R7#show run int Gi2 | sec int   
    interface GigabitEthernet2
     description ** to R6 **
     ip address 10.7.0.1 255.255.255.252
     ip ospf network point-to-point
     negotiation auto
     no mop enabled
     no mop sysid
    
    R7#show run | sec ^router
    router ospf 10
     router-id 7.7.7.7
     segment-routing area 0 mpls
     segment-routing mpls
     distribute link-state
     network 7.7.7.7 0.0.0.0 area 0
     network 10.7.0.0 0.0.0.3 area 0
     mpls traffic-eng router-id Loopback10
     mpls traffic-eng area 0
    router bgp 65100
     bgp router-id 7.7.7.7
     bgp log-neighbor-changes
     neighbor 9.9.9.9 remote-as 65100
     neighbor 9.9.9.9 update-source Loopback10
     !
     address-family vpnv4
      neighbor 9.9.9.9 activate
      neighbor 9.9.9.9 send-community extended
      neighbor 9.9.9.9 route-map RMAP-COLOR out
     exit-address-family
     !
     address-family ipv4 vrf Gold
      neighbor 10.0.2.2 remote-as 65002
      neighbor 10.0.2.2 activate
     exit-address-family
    
    R7#show run | sec ^route-map
    route-map RMAP-COLOR permit 10 
     set extcommunity color 100
    
R9 (BGP RR)
    R9#show run int Lo10 | sec int
    interface Loopback10
     ip address 9.9.9.9 255.255.255.255
    
    R9#show run int Gi0/0 | sec int
    interface GigabitEthernet1
     description ** to R3 **
     ip address 10.4.0.2 255.255.255.252
     ip ospf network point-to-point
     negotiation auto
     no mop enabled
     no mop sysid
    
    R9#show run | sec ^router      
    router ospf 10
     router-id 9.9.9.9
     network 9.9.9.9 0.0.0.0 area 0
     network 10.4.0.0 0.0.0.3 area 0
    router bgp 65100
     bgp router-id 9.9.9.9
     bgp log-neighbor-changes
     neighbor 2.2.2.2 remote-as 65100
     neighbor 2.2.2.2 update-source Loopback10
     neighbor 7.7.7.7 remote-as 65100
     neighbor 7.7.7.7 update-source Loopback10
     !
     address-family vpnv4
      neighbor 2.2.2.2 activate
      neighbor 2.2.2.2 send-community both
      neighbor 2.2.2.2 route-reflector-client
      neighbor 7.7.7.7 activate
      neighbor 7.7.7.7 send-community both
      neighbor 7.7.7.7 route-reflector-client
     exit-address-family
    
R3
    R3#show run int Lo10 | sec ^int 
    interface Loopback10
     ip address 3.3.3.3 255.255.255.255
    
    R3#show run | sec ^segment
    segment-routing mpls
     !
     connected-prefix-sid-map
      address-family ipv4
       3.3.3.3/32 index 3 range 1 
      exit-address-family
     !
     
    R3#show run int Gi1 | sec ^int 
    interface GigabitEthernet1
     description ** to PE R2 **
     ip address 10.1.0.2 255.255.255.252
     ip ospf network point-to-point
     negotiation auto
     no mop enabled
     no mop sysid
    
    R3#show run int Gi2 | sec ^int
    interface GigabitEthernet2
     description ** to R4 **
     ip address 10.3.0.1 255.255.255.252
     ip ospf network point-to-point
     negotiation auto
     no mop enabled
     no mop sysid
    
    R3#show run int Gi3 | sec ^int
    interface GigabitEthernet3
     description ** to R5 **
     ip address 10.2.0.1 255.255.255.252
     ip ospf network point-to-point
     negotiation auto
     no mop enabled
     no mop sysid
    
    R3#show run int Gi4 | sec ^int
    interface GigabitEthernet4
     description ** to BGP RR R9 **
     ip address 10.4.0.1 255.255.255.252
     ip ospf network point-to-point
     negotiation auto
     no mop enabled
     no mop sysid
    
    R3#show run | sec ^router
    router ospf 10
     router-id 3.3.3.3
     segment-routing area 0 mpls
     segment-routing mpls
     network 3.3.3.3 0.0.0.0 area 0
     network 10.1.0.0 0.0.0.3 area 0
     network 10.2.0.0 0.0.0.3 area 0
     network 10.3.0.0 0.0.0.3 area 0
     network 10.4.0.0 0.0.0.3 area 0
    
R4
    R4#show run int Lo10 | sec int
    interface Loopback10
     ip address 4.4.4.4 255.255.255.255
    
    R4#show run | sec ^segment
    segment-routing mpls
     !
     connected-prefix-sid-map
      address-family ipv4
       4.4.4.4/32 index 4 range 1 
      exit-address-family
     !
    
    R4#show run int Gi1 | sec int 
    interface GigabitEthernet1
     description ** to R3 **
     ip address 10.3.0.2 255.255.255.252
     ip ospf network point-to-point
     negotiation auto
     no mop enabled
     no mop sysid
    
    R4#show run int Gi2 | sec int
    interface GigabitEthernet2
     description ** to R6 **
     ip address 10.5.0.1 255.255.255.252
     ip ospf network point-to-point
     negotiation auto
     no mop enabled
     no mop sysid
    
    R4#show run | sec ^router
    router ospf 10
     router-id 4.4.4.4
     segment-routing area 0 mpls
     segment-routing mpls
     network 4.4.4.4 0.0.0.0 area 0
     network 10.3.0.0 0.0.0.3 area 0
     network 10.5.0.0 0.0.0.3 area 0
    
R1 (CE)
    R1#show run | sec ^vrf
    vrf definition Gold
     rd 1:1
     !
     address-family ipv4
     exit-address-family
    
    R1#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Host1 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
    
    R1#show run int Gi0/0.1 | sec int
    interface GigabitEthernet0/0.1
     description ** to Host1 in VRF Gold (VLAN 1) **
     encapsulation dot1Q 1 native
     vrf forwarding Gold
     ip address 192.168.1.2 255.255.255.0
    
    R1#show run int Gi0/1 | sec int   
    interface GigabitEthernet0/1
     description ** to PE R2 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
    
    R1#show run int Gi0/1.10 | sec int
    interface GigabitEthernet0/1.10
     description ** to PE R2 in VRF Gold **
     encapsulation dot1Q 10
     vrf forwarding Gold
     ip address 10.0.1.2 255.255.255.252
    
    R1#show run | sec ^router
    router bgp 65001
     bgp router-id 1.1.1.1
     bgp log-neighbor-changes
     !
     address-family ipv4 vrf Gold
      network 192.168.1.0
      neighbor 10.0.1.1 remote-as 65100
      neighbor 10.0.1.1 activate
     exit-address-family
    
R8 (CE)
    R8#show run | sec ^vrf
    vrf definition Gold
     rd 1:1
     !
     address-family ipv4
     exit-address-family
    
    R8#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Host2 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
    
    R8#show run int Gi0/0.1 | sec int
    interface GigabitEthernet0/0.1
     description ** to Host2 in VRF Gold (VLAN 1) **
     encapsulation dot1Q 1 native
     vrf forwarding Gold
     ip address 192.168.2.2 255.255.255.0
    
    R8#show run int Gi0/1 | sec int   
    interface GigabitEthernet0/1
     description ** to PE R7 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
    
    R8#show run int Gi0/1.10 | sec int
    interface GigabitEthernet0/1.10
     description ** to PE R7 in VRF Gold **
     encapsulation dot1Q 10
     vrf forwarding Gold
     ip address 10.0.2.2 255.255.255.252
    
    R8#show run | sec ^router
    router bgp 65002
     bgp router-id 8.8.8.8
     bgp log-neighbor-changes
     !
     address-family ipv4 vrf Gold
      network 192.168.2.0
      neighbor 10.0.2.1 remote-as 65100
      neighbor 10.0.2.1 activate
     exit-address-family
    
Host1
    Host1#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to CE R1 **
     ip address 192.168.1.1 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
    
    Host1#show run | sec ^ip route
    ip route 0.0.0.0 0.0.0.0 192.168.1.2
    
R2#show ip bgp vpnv4 rd 65100:2 192.168.2.0
BGP routing table entry for 65100:2:192.168.2.0/24, version 19         « PE R2 receives Site 2 prefix from BGP RR R9
Paths: (1 available, best #1, no table)
  Not advertised to any peer
  Refresh Epoch 1
  65002
    7.7.7.7 (metric 5) (via default) from 9.9.9.9 (9.9.9.9)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Extended Community: RT:65100:2 Color:100                         « Extended Community color value 100 assigned by PE R7
      Originator: 7.7.7.7, Cluster list: 9.9.9.9                       « PE R7 originates this VPNv4 prefix
      mpls labels in/out nolabel/702
      binding SID: 200 (color - 100) (state - UP)                      « SR TE policy Binding SID 200 assigned on PE R2
      rx pathid: 0, tx pathid: 0x0
      Updated on May 17 2024 17:55:31 UTC






R2#show segment-routing traffic-eng policy all     

Name: EXAMPLE-POLICY (Color: 100 End-point: 7.7.7.7)                   « SR TE policy color 100
  Owners : CLI
  Status:
    Admin: up, Operational: up for 03:14:18 (since 05-17 15:20:33.736)
  Candidate-paths:
    Preference 1 (CLI):
      Explicit: segment-list EXAMPLE-PATH (active)                     « Explicit path configured with SID-list
        Weight: 1, Metric Type: TE
          16003 [Prefix-SID, 3.3.3.3]
          16005 [Prefix-SID, 5.5.5.5]
          16006 [Prefix-SID, 6.6.6.6]
          16007 [Prefix-SID, 7.7.7.7]
  Attributes:
    Binding SID: 200                                                   « SR TE policy uses the BSID value 200
      Allocation mode: dynamic
      State: Programmed
  IPv6 caps enabled






R2#show mpls forwarding-table 
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
200   [T]  Pop Label  65536/1[TE-Bind] 0             Tu65536    point2point        « BSID value 200 visible in MPLS forwarding-table
201        Pop Label  10.1.0.2-A       0             Gi2        10.1.0.2    
202        No Label   192.168.1.0/24[V]   \
                                       9448          Gi1.10     10.0.1.2    
16003      Pop Label  3.3.3.3/32       0             Gi2        10.1.0.2    
16004      16004      4.4.4.4/32       0             Gi2        10.1.0.2    
16005      16005      5.5.5.5/32       0             Gi2        10.1.0.2    
16006      16006      6.6.6.6/32       0             Gi2        10.1.0.2    
16007      16007      7.7.7.7/32       0             Gi2        10.1.0.2    

[T]     Forwarding through a LSP tunnel.
        View additional labelling info with the 'detail' option

A  - Adjacency SID






R2#show ip cef vrf Gold 192.168.2.0
192.168.2.0/24
  nexthop 200 Tunnel65536 label 702                                    « CEF table confirms BSID value next-hop for traffic to Site 2
  
  
  



Host1#trace 192.168.2.1 probe 1
Type escape sequence to abort.
Tracing the route to 192.168.2.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.1.2 1 msec
  2 10.0.1.1 22 msec
  3 10.1.0.2 [MPLS: Labels 16005/16006/16007/702 Exp 0] 47 msec        « MPLS label stack (SID-list) attached based on SR TE policy color 100
  4 10.2.0.2 [MPLS: Labels 16006/16007/702 Exp 0] 48 msec
  5 10.6.0.2 [MPLS: Labels 16007/702 Exp 0] 47 msec
  6 10.0.2.1 [MPLS: Label 702 Exp 0] 26 msec                           « VPN Service Label is attached by PE R7
  7 10.0.2.2 47 msec
  8 192.168.2.1 48 msec

As visible in the above outputs, traffic from Site 1 destined to Site 2 is routed per the SR TE policy SID-list configured on PE R2. The Binding SID (BSID) is used to identify the SR TE policy assigned to the specific VPNv4 prefix. The BSID value is locally significant on PE R2.

Note that traffic destined to Site 2 chooses the SR TE path. However, return traffic does not use an explicit path, and in fact chooses a different path based on the IGP calculation. Thus, it is important to provision MPLS paths accordingly in both directions. Currently in this topology, there is asymmetric routing as confirmed in the following output taken from Host2.

Host2#trace 192.168.1.1 probe 1
Type escape sequence to abort.
Tracing the route to 192.168.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.2.2 2 msec
  2 10.0.2.1 23 msec
  3 10.7.0.2 [MPLS: Labels 16002/202 Exp 0] 48 msec
  4 10.5.0.1 [MPLS: Labels 16002/202 Exp 0] 62 msec
  5 10.3.0.1 [MPLS: Labels 16002/202 Exp 0] 47 msec
  6 10.0.1.1 [MPLS: Label 202 Exp 0] 26 msec
  7 10.0.1.2 49 msec
  8 192.168.1.1 51 msec

SR TE Automated Steering configuration with IOS XR

In the following topology, the PE routers are configured using IOS XR. PE R7 sends Site 2 prefixes with the color community value 100. PE R2 has an SR TE policy configured with the color value 100 and next-hop IP address 7.7.7.7 of PE R7. Thus, VPNv4 prefixes received on PE R2 that match the SR TE policy color value 100 and that match the PE R7 next-hop IP are routed along the explicit path R3-R4-R6-R7.

Automated Steering configuration with Segment Routing Traffic Engineering Policy

Configuration:

R2 (PE)
    RP/0/RP0/CPU0:R2#show run interface
    interface Loopback10
     ipv4 address 2.2.2.2 255.255.255.255
    !
    interface MgmtEth0/RP0/CPU0/0
     shutdown
    !
    interface GigabitEthernet0/0/0/0
     description ** to CE R1 **
    !
    interface GigabitEthernet0/0/0/0.1
     description ** to CE R1 in VRF Gold **
     vrf Gold
     ipv4 address 10.0.1.1 255.255.255.252
     encapsulation dot1q 10
    !
    interface GigabitEthernet0/0/0/1
     description ** to R3 **
     ipv4 address 10.1.0.1 255.255.255.252
    !
    interface GigabitEthernet0/0/0/2
     shutdown
    !
    interface GigabitEthernet0/0/0/3
     shutdown 
    !
    interface GigabitEthernet0/0/0/4
     shutdown
    !
    
    RP/0/RP0/CPU0:R2#show run vrf
    vrf Gold
     address-family ipv4 unicast
      import route-target
       65100:2
      !
      export route-target
       65100:1
      !
     !
    !
    
    RP/0/RP0/CPU0:R2#show run router ospf
    router ospf 10
     router-id 2.2.2.2
     address-family ipv4
     area 0
      segment-routing forwarding mpls
      segment-routing mpls
      interface Loopback10
       prefix-sid index 2
       loopback stub-network enable
      !
      interface GigabitEthernet0/0/0/1
       network point-to-point
      !
     !
    !
    
    RP/0/RP0/CPU0:R2#show run router bgp 
    router bgp 65100
     bgp router-id 2.2.2.2
     address-family ipv4 unicast
     !
     address-family vpnv4 unicast
     !
     neighbor 9.9.9.9
      remote-as 65100
      update-source Loopback10
      address-family vpnv4 unicast
      !
     !
     vrf Gold
      rd 65100:1
      address-family ipv4 unicast
      !
      neighbor 10.0.1.2
       remote-as 65001
       address-family ipv4 unicast
        route-policy eBGP-VRF in
        route-policy eBGP-VRF out
       !
      !
     !        
    !
    
    RP/0/RP0/CPU0:R2#show run route-policy eBGP-VRF
    route-policy eBGP-VRF
      pass
    end-policy
    !
    
    RP/0/RP0/CPU0:R2#show run segment-routing
    segment-routing
     traffic-eng
      segment-list EXAMPLE-LIST
       index 1 mpls label 16003
       index 2 mpls label 16004
       index 3 mpls label 16006
       index 4 mpls label 16007
      !
      policy EXAMPLE-POLICY
       color 100 end-point ipv4 7.7.7.7
       candidate-paths
        preference 10
         explicit segment-list EXAMPLE-LIST
         !
        !
       !
      !
     !
    !
    
    RP/0/RP0/CPU0:R2#show run mpls  
    mpls label range table 0 24200 24299
    
R7 (PE)
    RP/0/RP0/CPU0:R7#show run interface 
    interface Loopback10
     ipv4 address 7.7.7.7 255.255.255.255
    !
    interface MgmtEth0/RP0/CPU0/0
     shutdown
    !
    interface GigabitEthernet0/0/0/0
     description ** to CE R8 **
    !
    interface GigabitEthernet0/0/0/0.1
     description ** to CE R8 in VRF Gold **
     vrf Gold
     ipv4 address 10.0.2.1 255.255.255.252
     encapsulation dot1q 10
    !
    interface GigabitEthernet0/0/0/1
     description ** to R6 **
     ipv4 address 10.7.0.1 255.255.255.252
    !
    interface GigabitEthernet0/0/0/2
     shutdown
    !
    interface GigabitEthernet0/0/0/3
     shutdown 
    !
    interface GigabitEthernet0/0/0/4
     shutdown
    !
    
    RP/0/RP0/CPU0:R7#show run vrf
    vrf Gold
     address-family ipv4 unicast
      import route-target
       65100:1
      !
      export route-target
       65100:2
      !
     !
    !
    
    RP/0/RP0/CPU0:R7#show run router ospf
    router ospf 10
     router-id 7.7.7.7
     address-family ipv4
     area 0
      segment-routing forwarding mpls
      segment-routing mpls
      interface Loopback10
       prefix-sid index 7
       loopback stub-network enable
      !
      interface GigabitEthernet0/0/0/1
       network point-to-point
      !
     !
    !
    
    RP/0/RP0/CPU0:R7#show run router bgp 
    router bgp 65100
     bgp router-id 7.7.7.7
     address-family ipv4 unicast
     !
     address-family vpnv4 unicast
     !
     neighbor 9.9.9.9
      remote-as 65100
      update-source Loopback10
      address-family vpnv4 unicast
       route-policy RP-COLOR out
      !
     !
     vrf Gold
      rd 65100:2
      address-family ipv4 unicast
      !
      neighbor 10.0.2.2
       remote-as 65002
       address-family ipv4 unicast
        route-policy eBGP-VRF in
        route-policy eBGP-VRF out
       !
      !       
     !
    !
    
    RP/0/RP0/CPU0:R7#show run route-policy eBGP-VRF
    route-policy eBGP-VRF
      pass
    end-policy
    !
    
    RP/0/RP0/CPU0:R7#show run route-policy RP-COLOR
    route-policy RP-COLOR
      set extcommunity color COLOR100
    end-policy
    !
    
    RP/0/RP0/CPU0:R7#show run extcommunity-set opaque COLOR100 
    extcommunity-set opaque COLOR100
      100
    end-set
    !
    
    RP/0/RP0/CPU0:R7#show run mpls
    mpls label range table 0 24700 24799
    
RP/0/RP0/CPU0:R2#show segment-routing traffic-eng policy    

SR-TE policy database
---------------------

Color: 100, End-point: 7.7.7.7
  Name: srte_c_100_ep_7.7.7.7
  Status:
    Admin: up  Operational: up for 02:43:31 (since May 18 10:28:59.157)          « SR TE policy operational
  Candidate-paths:
    Preference: 10 (configuration) (active)
      Name: EXAMPLE-POLICY
      Requested BSID: dynamic
      Explicit: segment-list EXAMPLE-LIST (valid)
        Weight: 1, Metric Type: TE
          16003
          16004
          16006
          16007
  Attributes:
    Binding SID: 24202                      « Binding SID 24202 used on PE R2 SR TE policy
    Forward Class: Not Configured
    Steering labeled-services disabled: no
    Steering BGP disabled: no
    IPv6 caps enable: yes






RP/0/RP0/CPU0:R2#show bgp vpnv4 unicast rd 65100:2 192.168.2.0
BGP routing table entry for 192.168.2.0/24, Route Distinguisher: 65100:2            « Site 2 VPNv4 prefix received on PE R2
Versions:
  Process           bRIB/RIB  SendTblVer
  Speaker                 10          10
Last Modified: May 18 10:39:45.442 for 02:33:10
Paths: (1 available, best #1)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  65002
    7.7.7.7 C:100 (bsid:24202) (metric 5) from 9.9.9.9 (7.7.7.7)                    « Binding SID assigned to prefix
      Received Label 24701 
      Origin IGP, metric 0, localpref 100, valid, internal, best, group-best, import-candidate, not-in-vrf
      Received Path ID 0, Local Path ID 1, version 10
      Extended community: Color:100 RT:65100:2                                      « BGP color community assigned to prefix
      Originator: 7.7.7.7, Cluster list: 9.9.9.9
      SR policy color 100, up, not-registered, bsid 24202
	  





RP/0/RP0/CPU0:R2#show mpls forwarding 
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
16003  Pop         SR Pfx (idx 3)     Gi0/0/0/1    10.1.0.2        0           
16004  16004       SR Pfx (idx 4)     Gi0/0/0/1    10.1.0.2        0           
16005  16005       SR Pfx (idx 5)     Gi0/0/0/1    10.1.0.2        0           
16006  16006       SR Pfx (idx 6)     Gi0/0/0/1    10.1.0.2        0           
16007  16007       SR Pfx (idx 7)     Gi0/0/0/1    10.1.0.2        224         
24200  Pop         SR Adj (idx 0)     Gi0/0/0/1    10.1.0.2        0           
24201  16004       SR TE: 1 [TE-INT]  Gi0/0/0/1    10.1.0.2        904         
24202  Pop         No ID              srte_c_100_e point2point     224              « BSID resolves to the SR TE policy 100
24203  Unlabelled  192.168.1.0/24[V]  Gi0/0/0/0.1  10.0.1.2        0






RP/0/RP0/CPU0:R2#show cef vrf Gold 192.168.2.0
192.168.2.0/24, version 11, internal 0x5000001 0x30 (ptr 0xd7b2af0) [1], 0x0 (0xe199eb8), 0xa08 (0xe908408)
 Updated May 18 10:39:45.166
 Prefix Len 24, traffic index 0, precedence n/a, priority 3
   via local-label 24202, 3 dependencies, recursive [flags 0x6000]                  « BSID also visible in CEF table next-hop
    path-idx 0 NHID 0x0 [0xd8faa18 0x0]
    recursion-via-label
    next hop VRF - 'default', table - 0xe0000000
    next hop via 24202/0/21
     next hop srte_c_100_e labels imposed {ImplNull 24701}






Host1#trace 192.168.2.1 probe 1
Type escape sequence to abort.
Tracing the route to 192.168.2.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.1.2 1 msec
  2 10.0.1.1 26 msec
  3 10.1.0.2 [MPLS: Labels 16004/16006/16007/24701 Exp 0] 59 msec                   « SR TE explicit path SID-list attached to packet
  4 10.3.0.2 [MPLS: Labels 16006/16007/24701 Exp 0] 61 msec
  5 10.5.0.2 [MPLS: Labels 16007/24701 Exp 0] 62 msec
  6 10.7.0.1 [MPLS: Label 24701 Exp 0] 63 msec                                      « PE R7 assigns the VPN service label
  7 10.0.2.2 66 msec
  8 192.168.2.1 59 msec

Packet capture BGP VPNv4 with color extended community

The following packet capture displays a BGP VPNv4 Update message carrying the Site 2 prefix 192.168.2.0/24 including the BGP extended community color value 100. The hexadecimal value 0x0064 visible in the packet capture equals 100 in the decimal notation.

This BGP Update message is received on PE router R2 and matches the locally configured SR TE policy color 100. As a result, traffic destined to the prefix 192.168.2.0/24 is routed based on the matching SR TE policy.

BGP color extended community value attached to VPNv4 prefix