The ext-community-change enable command enables a device to change extended community attributes based on a Route-Policy.
The undo ext-community-change enable command disables a device from changing extended community attributes based on a Route-Policy.
By default, extended community attributes cannot be changed based on a Route-Policy.
BGP view, BGP-IPv4 unicast address family view, BGP-VPN instance IPv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view
Usage Scenario
By default, BGP prevents a device from changing extended community attributes from a peer or peer group based on an import policy or changing extended community attributes to be advertised to a peer or peer group based on an export policy. To enable a device to change extended community attributes from a peer or peer group based on an import policy and change extended community attributes to be advertised to a peer or peer group based on an export policy before advertising them, run the ext-community-change enable command.
Precautions
The ext-community-change enable and peer route-policy import commands must both be run so that the device can change extended community attributes from a peer or peer group based on an import policy.
# Enable the device to change extended community attributes of the BGP routes received from peer 10.1.1.1 based on a Route-Policy named policy1.
<sysname> system-view
[sysname] route-policy policy1 permit node 10
[sysname-route-policy] if-match as-path-filter 2
[sysname-route-policy] apply extcommunity rt 10.1.1.1:1 additive
[sysname-route-policy] quit
[sysname] bgp 100
[sysname-bgp] ipv4-family unicast
[sysname-bgp-af-ipv4] ext-community-change enable
[sysname-bgp-af-ipv4] peer 10.1.1.1 route-policy policy1 import
# Enable the device to change extended community attributes of the BGP routes advertised to peer 2000::1 based on a Route-Policy named policy2.
<sysname> system-view
[sysname] route-policy policy2 permit node 10
[sysname-route-policy] if-match interface GigabitEthernet0/0/0
[sysname-route-policy] apply extcommunity rt 100:2 additive
[sysname-route-policy] quit
[sysname] bgp 100
[sysname-bgp] ipv6-family unicast
[sysname-bgp-af-ipv6] ext-community-change enable
[sysname-bgp-af-ipv6] peer 2000::1 advertise-ext-community
[sysname-bgp-af-ipv6] peer 2000::1 route-policy policy2 export