BGP Communities Explained

Hi Mark,

It depends on your loopback interface. In my case, I had a /32 on the loopback which was advertised in BGP:

Customer#show running-config | section bgp
router bgp 10
 no synchronization
 bgp log-neighbor-changes
 network 10.10.10.10 mask 255.255.255.255

Hi Rene,

very nice introduction to BGP communities. However, I’ve a little improvement: A hint that communities were only forwarded from second router to a third one if send-community is activated on that neighborhood were be helpful.

Br,
Sebastian

1 Like

Rene/ Andrew, I have a requirement that I need a community attribute received from another peer [ Not Cisco]. What is the configuration then on my cisco router to RECEIVE only? Is there something line ‘receive-community’ as of ‘send-community’.

Hi @dpex77,

There is no need to configure this, your router will receive communities by default.

there are two statements, which one being used?

ISP1(config)#route-map PREPEND_EU permit 10

ISP1(config)#route-map PREPEND_EU permit 20

Hi Hoan,

You mean this part?

ISP1(config)#route-map PREPEND_EU permit 10     
ISP1(config-route-map)#match community 1
ISP1(config-route-map)#set as prepend 1 1 1 1                 
ISP1(config-route-map)#exit
ISP1(config)#route-map PREPEND_EU permit 20

A route-map starts at the top and works it way to the bottom. First, it checks for everything in statement 10 and if it matches community 1, it prepends the AS path.

Then it processes the permit 20 statement which is empty. An empty statement means “match everything” so the end result will be that we advertise all other routes without changing the AS path.

If you don’t add this empty statement then everything else will be denied by default, just like an access-list. What happens is that only the networks that are matched in statement 10 get advertised and nothing else.

Hope this helps!

Rene

Hello Rene,
Would you please explain more on the extended communities and any other types of communities available?
Thanks

Hello sed

@ReneMolenaar has not yet created a lesson that encompasses extended communities as well. However, in the meantime you can take a look at this Cisco documentation that covers some configuration issues:

I hope this has been helpful!

Laz

Hello,

I haven’t read yet the well known communities chapters, but can you give an example for Internet community (I don’t see a lesson for this one)? The description sounds strange (advertise the prefix to all BGP neighbors), this should be done by default (I guess…).

Many thanks,
Stefanita

Hello Staut

You make a good point, and this is an opportunity for clarification.

The Internet community is actually a Cisco defined community. It is kind of like a “catch all” that defines “normal” behaviour in the event that no other communities are defined. So in a sense, it is the “default” community that allows all prefixes to be advertised. Where the other three say “don’t advertise such and such” the Internet community says “advertise everything!”

I hope this has been helpful!

Laz

1 Like

Hi,

ISP1(config)#route-map PREPEND_EU permit 10     
ISP1(config-route-map)#match community 1
ISP1(config-route-map)#set as prepend 1 1 1 1                 
ISP1(config-route-map)#exit
ISP1(config)#route-map PREPEND_EU permit 20

Why do we need route-map PREPEND_EU permit 20 here

Thanks

Hi Sims,

The route-map has an invisible deny statement at the bottom, similar to how an access-list works. If you don’t add that empty permit 20 statement, you’ll deny everything that you don’t permit in the first statement.

Rene

HI
I currently have a fortigate connected to a ISP via a 1g and 10 g link.
I have asymmetric routing, so I shut down the 1G. however this is a back up.
I need to put an inbound route filter on the routes learned from the ISP to stop routes we announce to then on one link from being learned back on the other . I am thinking of tagging the routes with a BGP extended community so that they can be easily recognized on the way back in without maintaining an explicit prefix list.

Hello Michael

Yes, one option would be to use an extended community in the manner you describe. This lesson here will give you more information about this.


If you know the specific prefixes in question, and they will not change over time, then you can also use prefix lists to filter out the prefixes you want. You can find out more about this here:

I hope this has been helpful!

Laz

Hello Rene, from the example i see that ISP 2 is seeing prepend path 1 1 1 1 1 10 i
But isp 3 is not showing the prepended path. its just showing “1 10 i”.
my question is as per the config ISP 3 should also see the prepend path as 1 1 1 1 1 10 i right ??

Hello Nanda

Notice that on ISP1, the command Rene used is the following:

ISP1(config)#router bgp 1 
ISP1(config-router)#neighbor 192.168.12.2 route-map PREPEND_EU out

This means that the prepending route map will only be applied for routes that are sent from ISP1 to the neighbor with IP address 192.168.12.2, which is ISP2. ISP3 is not affected at all by the prepending that takes place, even though the customer sends the community configuration to ISP1. In order for ISP3 to also have this prepend path, the following would have to be added to ISP1:

ISP1(config-router)#neighbor 192.168.13.3 route-map PREPEND_EU out

I hope this has been helpful!

Laz

Are there 2 types of communities in BGP?
I saw about the cost communities which only works for iBGP and then this communities
with EBGP.

Hello Diafeked

BGP communities are additional piece of information attached to prefixes that tell BGP routers how to handle those prefixes. Communities are shared between iBGP and eBGP peers alike. BGP communities are transitive BGP attributes, which means they are shared between different Autonomous Systems.

Now there are two types of communities. The first consists of four “well known” communities which are predefined for all BGP routers. These are described in the lesson. The second type consists of extended communities, that is, those that are not well known. These are custom communities that you can define yourself. So when we say type, there really isn’t any difference in the way the communities are actually managed, it’s just a set of predefined communities that all BGP routers know about. All communities are managed in the same way.

Now some vendors, like Cisco have created extended BGP communities that are predefined within their own devices. One such extended community is indeed the cost community. Cisco has predefined this extended community to function in a specific way, and can be enabled by using predefined commands. Specifically, the set extcommuhity cost command can be used to create this community, along with all of the parameters that Cisco has predetermined. This specific extended community is a configured to be a non transient extended community, and this does indeed mean that it is passed between iBGP peers but not between eBGP peers.

You can find out more info about the cost extended BGP community at the following Cisco documentation:

I hope this has been helpful!

Laz

Thank you sir, i got it now.

1 Like

The link to Internet community is broken, do you have another one