Configuring the BGP Community Attribute
The Community attribute is a private BGP route attribute. It is transmitted between BGP peers and is not restricted within an AS. The Community attribute allows a group of BGP devices in multiple ASs to share the same routing policies, which simplifies routing policy applications and facilitates routing policy management and maintenance. A BGP device can add or change the community attributes of routes to be advertised.
Enable Community Exchange with Peer
The set protocols bgp neighbor send-community command enables community and/or extended community exchange with the specified neighbor. When this command is configured for the peer-group, then all the neighbors that are part of peer-group will send the community values to the peers.
The following example allows community values to be sent to a specific neighbor.
admin@XorPlus# set protocols bgp neighbor 2.2.2.2 ipv4-unicast send-community both admin@XorPlus# commit
Apply a Routing Policy to Routes Advertised
The set protocols bgp neighbor route-map command applies a route map to incoming or outgoing routes. It can be used to configure the route map for modifying the community attribute of the route.
admin@XorPlus# set protocols bgp neighbor 2.2.2.2 ipv4-unicast in route-map map1 admin@XorPlus# commit
BGP Community Lists
You can use community lists to define a BGP community to tag one or more routes. You can then use the communities to apply a route policy on either egress or ingress.
The BGP community list can be either standard or expanded. The standard BGP community list is a pair of values (such as 100:100) that can be tagged on a specific prefix and advertised to other neighbors or applied on route ingress. Or, it can be one of four BGP default communities:
- internet: a BGP community that matches all routes
- local-AS: a BGP community that restricts routes to your confederation’s sub-AS
- no-advertise: a BGP community that is not advertised to anyone
- no-export: a BGP community that is not advertised to the eBGP peer
An expanded BGP community list takes a regular expression (BGP Regular Expressions) of communities and matches the listed communities.
When the neighbor receives the prefix, it examines the community value and takes action accordingly, such as permitting or denying the community member in the routing policy.
Here is an example of a standard community list filter:
admin@Xorplus# set routing community-list standard COMMUNITY1 permit community 100:100 admin@Xorplus# commit
You can apply the community list to a route map to define the routing policy:
admin@Xorplus# set routing route-map GlobalMap order 10 match community COMMUNITY1 admin@Xorplus# set routing route-map GlobalMap order 10 matching-policy permit admin@Xorplus# commit
Copyright © 2024 Pica8 Inc. All Rights Reserved.