Configuring a BGP Extended Community

This section describes how to add a BGP extended community, that is, the Color Extended Community, to a route through a route-policy, enabling the route to be recursed to an SR-MPLS TE Policy based on the color value and next-hop address in the route.

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 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 Color extended community is configured.

    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-plain | as-number-dot }

        A BGP peer is created.

      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 }

        A BGP import or export route-policy is configured.

      6. Run commit

        The configuration is committed.

    • Apply the route-policy to a BGP4+ 6PE 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-plain | as-number-dot }

        A BGP4+ 6PE peer is created.

      4. Run ipv6-family unicast

        The IPv6 unicast address family view is displayed.

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

        A BGP4+ 6PE import or export route-policy is configured.

      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 { ipv4-address | group-name } as-number { as-number-plain | as-number-dot }

        A BGP peer is created.

      4. Run ipv4-family vpnv4

        The BGP VPNv4 address family view is displayed.

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

        The BGP VPNv4 peer relationship is enabled.

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

        A BGP import or export route-policy is configured.

      7. Run commit

        The configuration is committed.

    • Apply the route-policy to a BGP VPNv6 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-plain | as-number-dot }

        A BGP peer is created.

      4. Run ipv6-family vpnv6

        The BGP VPNv6 address family view is displayed.

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

        The BGP VPNv6 peer relationship is enabled.

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

        A BGP import or export route-policy is configured.

      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 l2vpn-family evpn

        The BGP EVPN address family view is displayed.

      4. Run peer { ipv4-address | group-name } enable

        The BGP EVPN peer relationship is enabled.

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

        A BGP EVPN import or export route-policy is configured.

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

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

      5. Run export route-policy policy-name

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

      6. Run commit

        The configuration is committed.

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