BGP Communities Explained

Hello Mathias

I tried to replicate your results, but I was unable to. What I did was I removed the following command from the BGP configuration of ISP1:

neighbor 192.168.12.2 route-map PREPEND_EU out

…and I replaced it with the following command:

neighbor 192.168.10.10 route-map PREPEND_EU in

The result was that the prepending of the AS’es takes place as the BGP update comes into ISP1, so I see the prepended AS’es within the BGP table of both ISP1 as well as ISP2 as expected. Actually, it took a little bit of time (about 30 seconds) before the BGP table of ISP1 was updated.

You may want to check your configuration again? Let us know how your troubleshooting goes.

I hope this has been helpful!

Laz

1 Like

Thank you for the feedback. I probably misconfigured something then. Glad to know it should work like I expected it would.

1 Like

Hi @lagapidis Aren’t the BGP communities and extended communities optional transitive? Why have you mentioned BGP communities as “well known” ? Please correct me if I am wrong.

Thanks,
Nihar

Hello Nihar

When we talk about “well known” communities, we are simply saying that there are four predefined communities in BGP. These are known as:

  • Internet
  • No-Advertise
  • No-Export
  • Local-AS

These are further described in the lesson. They are well-known in the sense that they have built-in commands that you can use to activate them simply because they are used quite often. For example, the No Advertise community can be

Furthermore, RFC1997 describes these well-known communities as those that “have global significance and their operations shall be implemented in any community-attribute-aware BGP speaker.”

BGP communities and extended communities are indeed transitive, however, they are not optional. Even if you configure no community in your implementation, by default, you are using the “Internet” well-known community, which simply advertises the prefix to all BGP neighbors.

For more information on community types and community propagation, take a look at this NetworkLessons Note on BGP community types.

I hope this has been helpful!

Laz

Hi Team,

In my lab a single router is acting as ASBR with OSPF on one leg and BGP into other. I am trying to match the Router ID of the router that send OSPF routes and set the community string over BGP, is this technically possible ?
Regards,
Dhruv

Hello Dhruv

It is possible to create a route map that will set the community string for particular prefixes it sends to its BGP neighbors. This can be done by using the match ip route-source route-map command where the OSPF router ID is the route source.

You can then set the community of those prefixes that are sent from the desired route source (OSPF router ID) to whatever you like.

For more info on setting BGP communities using a route map take a look at this lesson:

For more info on route maps in general, take a look at this lesson:

For more info on the match ip route-source command, take a look at the NetworkLessons note on matching OSPF router IDs using route maps.

I hope this has been helpful!

Laz

Hi Laz,

Thank you for your response, but for some reasons after configuring my OSPF connections are not distributed now.

#########################################

!
access-list 10 permit host 16.16.16.16 
!
route-map N7K-NDC-OSPF permit 20
match ip route-source 10
set community 64700:2
!
router bgp 64700
 bgp log-neighbor-changes
 network 11.0.0.0
 redistribute ospf 1 route-map N7K-NDC-OSPF
 neighbor 11.11.11.12 remote-as 65440
!
ip bgp-community new-format
!

###############################

N7K-SiteA#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
16.16.16.16       1   FULL/DR         00:00:35    15.15.15.16     GigabitEthernet3
1.1.1.1           1   FULL/BDR        00:00:39    10.10.10.10     GigabitEthernet2

Regards,
Dhruv

Hello Dhruv

The route map you have configured matches all prefixes that come from your neighboring OSPF router with ID 16.16.16.16, and assigns the appropriate community to that prefix. However, by applying that route map to the redistribution into BGP, this route map also filters all other OSPF prefixes from being redistributed. Remember that a route map always has an implicit deny-all at the end. You must add a second command entry to the route map to allow everything else to go through, without changing the community. This command would resolve your issue:

N7K-SiteA(config)#route-map N7K-NDC-OSPF permit 30
N7K-SiteA(config-route-map)#exit

This essentially counteracts the implicit deny statement at the end, allowing all other prefixes to be redistributed.

I hope this has been helpful!

Laz

Hello,

Can you add section on large BGP communities? These communities are with 12 byte values that appear to be new RFC

Hello Shaunak

Large BGP communities are not part of the lesson content, however, I have created a NetworkLessons Note on large BGP communities that you may find useful.

I hope this has been helpful!

Laz

@ReneMolenaar @lagapidis @lagaused
which type this one? what we name it?

Hello Ali

I don’t understand your question. Can you clarify? Thanks!

Laz

Is the explained community is standard type?
I am asking about the type
As we know there is 4 types in well-know and 2 types in private community .
Which type this one?

Hello Ali

The lesson speaks about BGP communities in general, and it points out that there are four well-known BGP communities. When you say standard type, do you mean well-known?

These are the well known communities:

  • Internet: advertise the prefix to all BGP neighbors.
  • No-Advertise: don’t advertise the prefix to any BGP neighbors.
  • No-Export: don’t advertise the prefix to any eBGP neighbors.
  • Local-AS: don’t advertise the prefix outside of the sub-AS (this one is used for BGP confederations).

In the lesson, all four are mentioned. When you say “which type is this one?” which “one” are you talking about?

I hope this has been helpful!

Laz

Hi
Well know has 4 types and all clear

There is another type called private community and has 2 type
Standard and extended

I am talking about this one which you can use it to manipulate as path prepend
Which type this? Is it standard?

Hello Ali

I see, you’re talking about the two different types of BGP communities, the standard and extended communities. These are two different ways of representing communities. The standard BGP community is defined by a 32-bit number that can be included with a route within the BGP update. A community is actually an optional transitive attribute.

Now an extended BGP community is simply a redefining of the BGP header that allows a 64-bit number to represent the community rather than a 32-bit number. This simply gives more granularity to the configuration of various attributes. In particular, extended BGP communities provide structure for various classes of information and are very often used for VPN services. The extended communities format is explained in detail in RFC 4360.

Now this should not be confused with a Private BGP community. Private BGP communities follow the convention that the first 16-bits represent the AS of the community origination, and the second 16-bits represent a pattern defined by the originating AS. The private BGP community pattern could vary from organization to organization, do not need to be registered or published. That’s the meaning of the word “private” in the title.

You can find more info about all of these at the following links:

I hope this has been helpful!

Laz

@ReneMolenaar : Thanks for this amazing BGP community explanation which I have had used for troubleshooting. I have a question here.
Is there a possibility for any customer to present with their communities like : and ask to add this is within t he BGP communities.
I have had checked the community examples that you have shared with specific like Prepending/Regional/Local pref
but not able to wrap my head around the customer ASN number for specific customer.

Hello Rinat

From what I understand, you’re asking if you as a customer can create your own community and share it with the ISP? I’m not sure I understand your question. Can you share a little bit more and clarify so that we can help you further?

Thanks!

Laz

the link is broken BGP Community No Advertise

Hello Konstantinos

I think it’s OK now:

Thanks!

Laz