< Home

Configuring the BGP Community Attribute

Community attributes are used to simplify routing policy management.

Context

Community attributes are used to simplify routing policy application and facilitate network maintenance. They allow a group of BGP devices in different ASs to share the same routing policies. Before advertising a route with the community attribute to peers, a BGP device can change the original community attribute of this route. Community attributes are route attributes, which are transmitted between BGP peers, and the transmission is not restricted within an AS.

Procedure

  • Configure community attribute-related routing policies.
    1. Access the system view.

      system-view

    2. Configure a node for a routing policy and access the view of the routing policy.

      route-policy route-policy-name { deny | permit } node node

    3. (Optional) Configure filtering conditions (if-match clauses) for a routing policy. Community attributes can be added only to the routes that pass the filtering, and the community attributes of only the routes that pass the filtering can be modified.
    4. Configure community or extended community attributes for BGP routes.

      • Configure community attributes for BGP routes.

        apply community { community-number | aa:nn | internet | no-advertise | no-export | no-export-subconfed } &<1-32> [ additive ]

        A maximum of 32 community attributes can be configured in the apply community command.

      • Configure an extended community attribute (Route-Target) for BGP routes.

        apply extcommunity { rt { as-number:nn | ipv4-address:nn } } &<1-16> [ additive ]

  • Configure a BGP device to send community attributes to its peer.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Access the BGP-IPv4 unicast address family view.

      ipv4-family unicast

    4. Configure an export routing policy.

      peer { ipv4-address | group-name } route-policy route-policy-name export

    5. Run the following commands to advertise community attributes to the peer group.

      • Configure the BGP device to send a standard community attribute to its peer or peer group.

        peer { ipv4-address | group-name } advertise-community

      • Advertise an extended community attribute to a specified peer or peer group:

        1. Run the peer { ipv4-address | group-name } advertise-ext-community command to advertise an extended community attribute to a specified peer or peer group.

        2. (Optional) Run the ext-community-change enable command to enable the device to change extended community attributes using a routing policy.

          By default, BGP peers cannot change extended community attributes using a route-policy; specifically, BGP peers advertise only the extended community attributes carried in routes to a specified peer or peer group, and the peer route-policy command cannot be used to modify the extended community attributes.

      After the peer advertise-ext-community command is enabled, BGP sends the routes with extended community attribute to its peer or peer group. If the peer or peer group only want to receive the routes, but not extended community attribute, you can configure the peer discard-ext-community command on the peer or peer group to discard the extended community attribute from the received routing information.

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