Configuring a BGP Extended Community

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:

  1. Configure a route-policy and set a specific color value for the desired route.

  2. Apply the route-policy to a BGP peer or a VPN instance as an import or export policy.

Procedure

  1. Configure a route-policy.
    1. Run system-view

      The system view is displayed.

    2. 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.

    3. (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.

    4. 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.

    5. Run commit

      The configuration is committed.

  2. Apply the route-policy.
    • Apply the route-policy to a BGP IPv4 unicast peer.
      1. Run system-view

        The system view is displayed.

      2. Run bgp as-number

        The BGP view is displayed.

      3. Run peer { ipv4-address | group-name } as-number as-number

        A BGP peer is specified.

      4. Run ipv4-family unicast

        The IPv4 unicast address family view is displayed.

      5. Run peer { ipv4-address | group-name } route-policy route-policy-name { import | export }

        The BGP import or export route-policy is applied.

      6. Run commit

        The configuration is committed.

    • Apply the route-policy to a BGP IPv6 unicast peer.
      1. Run system-view

        The system view is displayed.

      2. Run bgp as-number

        The BGP view is displayed.

      3. Run peer { ipv6-address | group-name } as-number as-number

        A BGP peer is specified.

      4. Run ipv6-family unicast

        The IPv6 unicast address family view is displayed.

      5. Run peer { ipv6-address | group-name } route-policy route-policy-name { import | export }

        The BGP import or export route-policy is applied.

      6. Run commit

        The configuration is committed.

    • Apply the route-policy to a BGP VPNv4 peer.
      1. Run system-view

        The system view is displayed.

      2. Run bgp as-number

        The BGP view is displayed.

      3. Run peer { ipv6-address | group-name } as-number as-number

        A BGP peer is created.

      4. Run ipv4-family vpnv4

        The BGP VPNv4 address family view is displayed.

      5. Run peer { ipv6-address | group-name } enable

        The BGP VPNv4 peer relationship is enabled.

      6. Run peer { ipv6-address | group-name } route-policy route-policy-name { import | export }

        The BGP import or export route-policy is applied.

      7. Run commit

        The configuration is committed.

    • Apply the route-policy to a BGP EVPN peer.
      1. Run system-view

        The system view is displayed.

      2. Run bgp as-number

        The BGP view is displayed.

      3. Run peer { ipv6-address | group-name } as-number as-number

        A BGP peer is created.

      4. Run l2vpn-family evpn

        The BGP EVPN address family view is displayed.

      5. Run peer { ipv6-address | group-name } enable

        The BGP EVPN peer relationship is enabled.

      6. Run peer { ipv6-address | group-name } route-policy route-policy-name { import | export }

        The BGP EVPN import or export route-policy is applied.

      7. Run commit

        The configuration is committed.

    • Apply the route-policy to a VPN instance IPv4 address family.
      1. Run system-view

        The system view is displayed.

      2. Run ip vpn-instance vpn-instance-name

        The VPN instance view is displayed.

      3. Run ipv4-family

        The VPN instance IPv4 address family view is displayed.

      4. Run import route-policy policy-name

        An import route-policy is configured for the VPN instance IPv4 address family.

      5. Run export route-policy policy-name

        An export route-policy is configured for the VPN instance IPv4 address family.

      6. Run commit

        The configuration is committed.

    • Apply the route-policy to a VPN instance IPv6 address family.
      1. Run system-view

        The system view is displayed.

      2. Run ip vpn-instance vpn-instance-name

        The VPN instance view is displayed.

      3. Run ipv6-family

        The VPN instance IPv6 address family view is displayed.

      4. Run import route-policy policy-name

        The import route-policy for the VPN instance IPv6 address family is applied.

      5. Run export route-policy policy-name

        The export route-policy for the VPN instance IPv6 address family is applied.

      6. Run commit

        The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >