< Home

apply extcommunity

Function

The apply extcommunity command configures extended community attributes for BGP routes.

The undo apply extcommunity command cancels the configuration.

By default, no BGP extended community attributes are configured.

Format

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

undo apply extcommunity

Parameters

Parameter Description Value
rt Indicates the route-target extended community. -
as-number Specifies the AS number. The value is an integer ranging from 0 to 65535.
4as-number Indicates a 4-byte AS number.
A 4-byte AS number is divided into the following types:
  • It is an integer ranging from 65536 to 4294967295.
  • It is in the format of x.y, where "x" and "y" are both integers ranging from 0 to 65535.
ipv4-address Specifies the IPv4 address. It is in dotted decimal notation.
nn Specifies an integer. For as-number, the value of nn ranges from 0 to 4294967295; for 4as-number, the value ranges from 0 to 65535; for ipv4-address, the value of nn ranges from 0 to 65535.
additive Indicates that existing community attributes can be added to routes. -

Views

Route-policy view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The apply extcommunity command is applicable to BGP/MPLS IP VPNs. At present, there are two types of BGP extended community attributes.
  • VPN route-target (RT) extended community
  • Source of Origin (SoO) extended community

At present, RT extended community attributes can be set only through the route-policy. This command cannot specify an extended community attribute for public routes.

Prerequisites

The apply extcommunity command can be used only after a route-policy is configured.

Configuration Impact

After a route matches a route-policy, you can change the RT extended community attribute of the route.

Precautions

If the keyword additive is not set in the apply extcommunity command, the original extended community attribute is replaced.

VPN routes may be imported in some scenarios. For example, if VPNA wants to learn routes from VPNB, configure a route-policy and run the apply extcommunity command. If the outbound interface of the VPNB routes to be learned by VPNA is a VLANIF interface, Dot1Q VLAN tag termination sub-interface, the route-policy must allow VPNA to learn the 32-bit routes of VPNB. If no such route-policy is configured, forwarding VPNA traffic through the learned VPNB routes will trigger invalid ARP Miss messages to be generated, causing high CPU usage.

Example

# Add 100:2 to the VPN route-target extended community attribute of BGP.

<sysname> system-view
[sysname] route-policy policy permit node 10
[sysname-route-policy] apply extcommunity rt 100:2 additive
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >