This section describes how to add a BGP extended community, that is, the color extended community, to routes through a route-policy, enabling the routes to perform SRv6 recursion based on the color value.
Context
The route coloring process is as follows:
Configure a route-policy and set a specific color value for the desired route.
Apply the route-policy to a BGP peer or a VPN instance as an import or export policy.
Procedure
- Configure a route-policy.
- Run system-view
The system view is displayed.
- Run route-policy route-policy-name { deny | permit } node node
A route-policy with a specified node is created and the route-policy view is displayed.
- (Optional) Configure an if-match clause as a route-policy filter criterion. You can add or modify the color extended community only for a route-policy that meets the filter criterion.
For details about the configuration, see (Optional) Configuring an if-match Clause.
- Run apply extcommunity color color
The BGP color extended community is configured.
The color value ranges from 0 to 4294967295. However, it can only be set to 0 at present.
- Run commit
The configuration is committed.
- Apply the route-policy.
- Apply the route-policy to a BGP IPv4 unicast peer.
- Run system-view
The system view is displayed.
- Run bgp as-number
The BGP view is displayed.
- Run peer { ipv4-address | group-name } as-number as-number
A BGP peer is specified.
- Run ipv4-family unicast
The IPv4 unicast address family view is displayed.
- Run peer { ipv4-address | group-name } route-policy route-policy-name { import | export }
The BGP import or export route-policy is applied.
- Run commit
The configuration is committed.
- Apply the route-policy to a BGP IPv6 unicast peer.
- Run system-view
The system view is displayed.
- Run bgp as-number
The BGP view is displayed.
- Run peer { ipv6-address | group-name } as-number as-number
A BGP peer is specified.
- Run ipv6-family unicast
The IPv6 unicast address family view is displayed.
- Run peer { ipv6-address | group-name } route-policy route-policy-name { import | export }
The BGP import or export route-policy is applied.
- Run commit
The configuration is committed.
- Apply the route-policy to a BGP VPNv4 peer.
- Run system-view
The system view is displayed.
- Run bgp as-number
The BGP view is displayed.
- Run peer { ipv6-address | group-name } as-number as-number
A BGP peer is created.
- Run ipv4-family vpnv4
The BGP VPNv4 address family view is displayed.
- Run peer { ipv6-address | group-name } enable
The BGP VPNv4 peer relationship is enabled.
- Run peer { ipv6-address | group-name } route-policy route-policy-name { import | export }
The BGP import or export route-policy is applied.
- Run commit
The configuration is committed.
- Apply the route-policy to a BGP EVPN peer.
- Run system-view
The system view is displayed.
- Run bgp as-number
The BGP view is displayed.
- Run peer { ipv6-address | group-name } as-number as-number
A BGP peer is created.
- Run l2vpn-family evpn
The BGP EVPN address family view is displayed.
- Run peer { ipv6-address | group-name } enable
The BGP EVPN peer relationship is enabled.
- Run peer { ipv6-address | group-name } route-policy route-policy-name { import | export }
The BGP EVPN import or export route-policy is applied.
- Run commit
The configuration is committed.
- Apply the route-policy to a VPN instance IPv4 address family.
- Run system-view
The system view is displayed.
- Run ip vpn-instance vpn-instance-name
The VPN instance view is displayed.
- Run ipv4-family
The VPN instance IPv4 address family view is displayed.
- Run import route-policy policy-name
An import route-policy is configured for the VPN instance IPv4 address family.
- Run export route-policy policy-name
An export route-policy is configured for the VPN instance IPv4 address family.
- Run commit
The configuration is committed.
- Apply the route-policy to a VPN instance IPv6 address family.
- Run system-view
The system view is displayed.
- Run ip vpn-instance vpn-instance-name
The VPN instance view is displayed.
- Run ipv6-family
The VPN instance IPv6 address family view is displayed.
- Run import route-policy policy-name
The import route-policy for the VPN instance IPv6 address family is applied.
- Run export route-policy policy-name
The export route-policy for the VPN instance IPv6 address family is applied.
- Run commit
The configuration is committed.