Configuring BGP community
By default, a router does not advertise the COMMUNITY or extended community attribute to its peers or peer groups. When the router receives a route carrying the COMMUNITY or extended community attribute, it removes the attribute before advertising the route to other peers or peer groups.
Perform this task to enable a router to advertise the COMMUNITY or extended community attribute to its peers for route filtering and control. You can also use a routing policy to add or modify the COMMUNITY or extended community attribute for specific routes. For more information about routing policy, see "Configuring routing policies."
To configure BGP community (IPv4 unicast/multicast address family):
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, or BGP IPv4 multicast address family view. |
| N/A |
3. Advertise the COMMUNITY or extended community attribute to a peer or peer group. |
| By default, the COMMUNITY or extended community attribute is not advertised. |
4. (Optional.) Apply a routing policy to routes advertised to a peer or peer group. | peer { group-name | ipv4-address [ mask-length ] } route-policy route-policy-name export | By default, no routing policy is applied. |
To configure BGP community (IPv6 unicast/multicast address family):
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter BGP IPv6 unicast address family view, BGP-VPN IPv6 unicast address family view, or BGP IPv6 multicast address family view. |
| N/A |
3. Advertise the COMMUNITY or extended community attribute to a peer or peer group. |
| By default, the COMMUNITY or extended community attribute is not advertised. |
4. (Optional.) Apply a routing policy to routes advertised to a peer or peer group. | peer { group-name | ipv6-address [ prefix-length ] } route-policy route-policy-name export | By default, no routing policy is applied. |