Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

iBGP neighbor --> route-map in with weight?


I have a very basic question here...

4 BGP Routers with different eBGP uplinks and iBGP full mesh over all 4.

Routers learn some of the prefixes (only) from other Routers via iBGP and selects the path with "nearest" neighbor (lowest next hop?) - all prefixes have same metrics for all next hops...

I want to prefer an exit point for these prefixes on my own - so I want to change metrics on iBGP....


Is it legitime to apply a route-map in on iBGP neighbors and set different weight based on communities or other criterias?


router bgp 1

neighbor remote-as 1

neighbor next-nop-self

neighbor route-map WEIGHT in

route-map WEIGHT permit 10

match community 1:1

set weight 10000

I ask this because I never see filter, metric confguration on iBGP peerings in any networks and not even in documentation.

I configured it and it works, so is this to be declared as bad design then?

Tough, don't see another possiblility to change Metrics on iBGP peerings with >2 neighbors and same metric prefixes...

Thanks for your comments


Everyone's tags (3)

iBGP neighbor --> route-map in with weight?


This is completely doable, and a very good option btw.

Since you have 4 routers running eBGP then iBGP between all 4, you can configure a route-map, to set a specific community value to routes coming in from each eBGP peer, on each router. For instance.

By default, community values are configured using a decimal number on Cisco routers. You can also change to using ASN:NN where ASN is your AS number and NN is an administratively designed value.

So for instance, if you could configure 'ip bgp-community new-format' and for ech eBGP neighbor, you could do a specific eBGP AS, of if they are teh same, you do the following

Different [65512:100, 65513:200, 65514:300, 65515:400]

Same [65512:100, 65513:200, 65514:300, 65514:400]

Decimal [ 100,200,300,400 ]

So you could tag routes coming from a specific eBGP neighbor, and set a weight based upon these values'

iBGP neighbor --> route-map in with weight?


Making route preference from one path over the other can't be think as a bad design, if it is bussiness requirement, it is perfectly normal.

Please refer to following docs,

BGP best path selection algorithm -

BGP best path selection and manipulation -

BGP case studies -

Route-map is misconfigured with match community command, refer to following doc, for how to use match community -


New Member

iBGP neighbor --> route-map in with weight?


thanks for your replies,

that's exactly what I plan to do - marking learned eBGP peer prefixes with communities and then set a weights with match on these communities on my different iBGP peers...

(because I have two sites and want to direct the exit points per site accordingly)

Just still wondering, also in your posted links Vishesh only route-maps on eBGP peers are set and I am a very sceptic person when I cannot find cisco documentation missing something that I decide to configure



iBGP neighbor --> route-map in with weight?


I used route-maps for iBGP neighbors in my network without any problem.

And I have never seen any restrictions for iBGP in Cisco documents.

The only restriction I can imagine might be for "set as-path ..." command but you don't need it in your case.

IMHO, it might be easier to manipulate Local Preference attribute possibly with an ougoing route-map than to mark prefixes by communities and matching them again?

(As noted by Vishesh already, your matching syntax is incorrect.)

Best regards,


New Member

iBGP neighbor --> route-map in with weight?

Hi Milan,

thanks for your feedback.

In my setup with two router per geographical site (and all 4 routers are connected onto a shared LAN),

when I want to make sure that site local traffic should leave on same local site, Local Preference won't work because you can only prefer one exit point...

So for that reason I use weight together with commnity matches to make sure every BGP router decides best path in iBGP by its own metrics.



iBGP neighbor --> route-map in with weight?


Route-maps are protocol independent, so it doesn't matter if you apply them on the ebgp or ibgp neighbor. Functionality is the same. It is all about the semantics (logic) that you put in a route-map to be used with different routing protocols. The documents I provided were to help you understand the same.


iBGP neighbor --> route-map in with weight?


what I was trying to explain is;

Some route-map features will not work with some protocols.

Like set as-prepend will not work with iBGP, e.g.

Or set tag will not work with BGP at all.

Best regards,