03-21-2025 01:07 PM
Hi,
I'm confused as to the reason for the existence of the BGP Cost community.
Surely what it does can be achieved by using path attributes. E.g. weight, if you only want to influence a single router, or local preference if you want to affect the entire AS.
I just do not understand in what scenarios you would want to use it when other options are available.
Thanks in advance for the help.
Sam
Solved! Go to Solution.
04-12-2025 12:09 PM - edited 04-12-2025 12:23 PM
Hi @Sam-CCNP ,
Sorry for initially misreading the question.
> If you use pre-bestpath for the point of insertion then doesn't it behave exactly like weight or local-preference?
It actually takes precedence over weight and local preference, making sure that a lower cost is always preferred. Also bear in mind that weight is Cisco proprietary, is not advertised in BGP updates and therefore only used for local selection.
The BGP cost community is used by default when eigrp is used a a PE-CE routing protocol. Without the cost community (with pre best path point of insertion) the locally redistributed eigrp routes would have with a weight of 32768 and would always be preferred over routes received from the MPLS VPN core via BGP VPNv4. The EIGRP remote routes would therefore never be considered regardless of their cost.
03-21-2025 03:39 PM
Hi @Sam-CCNP ,
The BGP community attribute is a simple way to tag a route or a group of routes. This community can later be acted upon by routers in local or remote autonomous systems. It simplifies the BGP routing policy as different policies can be applied to communities instead of individual routes.
There is wide variety of scenarios where the community attribute can be useful.
The mutual redistribution scenario is one of them. You could for instance redistribute IGP routes in BGP and tag the redistributed routes with a specific community. When redistributing BGP prefixes back in the IGP, you would check the community and reject the prefixes matching the community previously set. You would use a tag on the IGP side to achieve the same.
Here's another scenario. Some ISPs allow you to influence the routing policy apply to the prefixes they received from you based on predetermined community values. They normally publish the said community values and the respective expected behaviors on their web site.
Those are just two scenarios, although many more are possible.
04-12-2025 09:27 AM
Hi Harold,
Thanks for responding.
It's specifically the cost community that I am confused by the existence of, not communities in general.
If you use pre-bestpath for the point of insertion then doesn't it behave exactly like weight or local-preference? The igp option I now understand, because the tie breakers after IGP metric offer a 'less easy' way to control which path is selected.
Your previous answer here made sense: https://community.cisco.com/t5/routing/bgp-cost-community-and-point-of-insertion/td-p/1065542.
Thanks.
Sam
04-12-2025 12:09 PM - edited 04-12-2025 12:23 PM
Hi @Sam-CCNP ,
Sorry for initially misreading the question.
> If you use pre-bestpath for the point of insertion then doesn't it behave exactly like weight or local-preference?
It actually takes precedence over weight and local preference, making sure that a lower cost is always preferred. Also bear in mind that weight is Cisco proprietary, is not advertised in BGP updates and therefore only used for local selection.
The BGP cost community is used by default when eigrp is used a a PE-CE routing protocol. Without the cost community (with pre best path point of insertion) the locally redistributed eigrp routes would have with a weight of 32768 and would always be preferred over routes received from the MPLS VPN core via BGP VPNv4. The EIGRP remote routes would therefore never be considered regardless of their cost.
04-20-2025 07:27 AM
Hi @Harold Ritter ,
On the surface, if the cost community is not included as an NLRI path attribute it would appear to have the same affect as weight, and if it is included (using neighbor send-community extended) it would act like local-preference. Both of which are #1 and #2 on the best patch algorithm anyway.
I am not familiar with MPLS VPN BGP (yet) and but you brief explanation appears to justify its existence and I will look into it.
Thanks very much for the explanation.
Sam
04-20-2025 07:37 AM
Cost community not use directly (not directly use as best path criteria)' you need Route-map to influence the path.
MHM
04-20-2025 07:52 AM - edited 04-20-2025 07:53 AM
Hi @MHM Cisco World ,
I am not sure what you are referring to, but the cost community is taken in consideration and included in the BGP best path selection process by default depending on the OS. With IOS, the default behavior can be disabled with the following command; "bgp bestpath cost-community ignore".
04-20-2025 08:00 AM
LP and weight and AS-path ...etc. all mandatory attribute is by defualt add.
Cost community need route-map to push this vlaue to other peers.
MHM
04-20-2025 08:08 AM
The cost community is added automatically when eigrp is used as a PE-CE protocol.
04-20-2025 07:47 AM - edited 04-20-2025 05:03 PM
Hi @Sam-CCNP ,
> On the surface, if the cost community is not included as an NLRI path attribute it would appear to have the same affect > as weight
The intent behind the cost community was to actually have something that could override the weight for the scenario I mentioned where eigrp is used as a PE-CE protocol.
You are very welcome and thanks for the feedback.
04-18-2025 02:25 AM
Friend
Now I know what yoh confuse about
Let explain
PE1 connect to PE2 and PE3 via ibgp
PE2 and PE3 advertise same prefix with same path (all same LP AS ...etc.)
PE1 use IGP metric as tie breaker' this IGP is cost between PE1 and PE2/3
But what if PE2 or PE3 have better cost to prefix itself?
Here cost community come
It make BGP add cost between BGP peer to prefix into Path att. Make other peer use it to select best path.
So there are two IGP metric (cost)
One between PE's
Other between PE and prefix
MHM
03-22-2025 07:36 AM
The BGP Cost Community exists to provide a more granular and flexible way to influence route selection within an autonomous system (AS). Unlike path attributes like weight or local preference, which apply broadly to routes or routers, the BGP Cost Community allows you to assign specific cost values to individual routes. This feature is particularly useful in scenarios where you need to customize route preferences across multiple iBGP peers or confederation members without affecting eBGP peers. It can also help in complex network topologies, such as MPLS VPNs with backdoor links, where fine-tuned control over route selection is essential...
03-31-2025 05:29 AM
What you meaning cost community? Can you more elaborate
MHM
04-01-2025 04:22 AM
Hello
This bgp extended community attribute can be used for bestpath path selection
An example of using this feature would be when you wish to change the route path of a particular prefix/network that bgp has already chosen.
When applied cost community determines 3 values.
See attached..
04-18-2025 02:20 AM
Again dont mention me in your reply.
MHM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide