cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
501
Views
0
Helpful
7
Replies

bgp best-path and cumulated communities

razvan.radu
Level 1
Level 1

hello,

I am receiving an announcement, (ex. 1.2.3.4/24) from multiple peers, each of them sets an community on it

my bgp chooses an "best-path" and I can only see the community set by that peer (chosen as "best")

is there an way I can configure bgp to cumulate communities from ALL peers, even it they are not selected as "best" ?

thanks,

razvan radu

7 Replies 7

Calin C.
Level 5
Level 5

Hi!

Not sure what you want to do actually, but

show ip bgp 1.2.3.4

Will show you details about that prefix in the BGP table.

If this is not what you expect, please give some more details.

Cheers,

Calin

Florin Barhala
Level 6
Level 6

Post your BGP configuration along with route-maps and all the rest, then tell us what you need.

hello all,


---
router#sh ip bgp 1.2.3.4/24
BGP routing table entry for 1.2.3.4/24, version 65943077
Paths: (12 available, best #9, table default)
  Advertised to update-groups:
     2          3          4          12         14         15       
  12345
    10.20.30.40 from 10.20.30.40 (10.20.30.40)
      Origin IGP, metric 0, localpref 7500, valid, external, best
      Community: xxxxx:7500
  12345
    10.20.30.50 from 10.20.30.40 (10.20.30.40)
      Origin IGP, metric 0, localpref 6500, valid, external
      Community: xxxxx:6500
=== additional peers removed ====
---

I want to use comunity "xxxxx:6500" in an out route-map

---
ip community-list 10 permit xxxxx:6500
route-map UPSTREAM_PROVIDER permit 100
match community 10
---

I can not use the above route-map because the bgp router only uses the community "xxxxx:7500" from the "best" route (I also use "xxxxx:7500", so I can not change local pref)

I have tried to use "aggregate-address" but that does not work because is the same prefix and there is nothing to aggregate

is there an way I can configure bgp to cumulate all attributes for all identical prefixes received, or maybe something I can set with an route-map /peer to cumulate attributes ?

thanks,

razvan radu

OK,

You get the same prefix from 2 peers:


1st with local pref 7500 (community xxxxx:7500)

2nd with local pref 6500 (community xxxxx:6500)

The route with local pref 7500 is prefered for outgoing traffic to that specific prefix (7500 > 6500, so it's prefer).

On the "out" route-map in BGP, what do you want to specify? For sure you cannot use local-preference. What do you want to achieve with the "out" route-map?

The example that you add there is for an "in" route-map, because the incoming prefixes are having that community. That route-map does nothing if you apply it "out".

The best would be to tell exactly what you want to achieve. To "cumulate" attributes does not work.

You can set in a route-map something like:

set community xx:xx additive

This will add your community to the rest of communities already existing for that prefix.

Cheers,

Calin

ok, sorry for that,

I want to announce prefix 1.2.3.4/24 to peer X only if received from peer A

and to announce prefix 1.2.3.4/24 to peer Y only if received from peer B

thanks,

razvan radu

OK, the problem here is not technical, but about the concept.

From your last phrase, I assume that we are talking about one subnet 1.2.3.4/24 and multiple peers (X / Y) to be advertised to.

Obviously, you are receiving the 1.2.3.4 /24 from both of your providers (A and B).

You cannot stop this, except if explicitly deny to receive the prefix from one of your provider. Of course you can prefer one provider (A or B) for this prefix, by using a route-map "in" on which you match that prefix and modify attributes to prefer that path.

Since the prefix is received automatically from your A and B providers, you cannot accomplish what you want, because only one of the two prefixes will be installed on the routing table (either A or B).

A possible solution can be the following:

- configure BGP for multipath; in this way you will have 2 routes in routing tables (1.2.3.4 /24 next-hop A ; 1.2.3.4 /24 next-hop B)

- configure route-map "in" on BGP applied to A and B; in this route-map you match the prefix 1.2.3.4 /24 and assign a unique community (let's say xxxxx:1 for A and xxxxx:2 for B); this can be additive if you want to keep the communities from your provider

- configure route-map "out" on the BGP for X and Y (one route-map out for each); the route-map for X will match the  community xxxxx:2 and deny it (e.g. route-map TO_X_OUT deny 10) and them allow everything else in a route-map TO_X_OUT permit 20; viceversa for Y

This could work but it's quite complex to achieve, and to be honest I don't see any gain. If you "deny" advertising a prefix if it comes from the "wrong" provider you reduce to zero the redundancy. Of course there are some solutions, like in the route-map "out" you prefer one community over the other one using the correct BGP attributes.

I repeat myself, you need some acceptable BGP knowledge to be able to do this.

Please let me know if I can help in any other way.

Calin

hello,

thanks for scenario,

I have considered multipath myself, but I do not think it will work, I think I will have two routes installed, but still only one "best" that is in the bgp table and carries communities.

this I have not tested myself, but based on http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml

---

BGP Multipath does not affect       bestpath selection. For example, a router still designates one of the paths as       the best path, according to the algorithm, and advertises this best path to its       neighbors

---

do you have access to an multipath enabled router and can confirm that communities are carried (to be matched for an "out" route-map) for each route ?

thanks again,

razvan radu

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card