BGP Community No Advertise

The BGP No Advertise community is one of the four well known communities. If you have no idea what BGP communities are about, I would suggest to check the introduction lesson first. That’s where you will learn about the basics of BGP communities.

When you add the no-advertise community to a prefix then the receiving BGP router will use and store the prefix in its BGP table but it won’t advertise the prefix to any other neighbors.

Let’s look at an example, this is the topology I will use:

BGP Community No Advertise Topology

Above you can see R1 with a loopback interface that has network 1.1.1.1 /32. We will advertise this network in BGP towards R2 with the no advertise community set. As a result, R2 will not advertise it to R3 (eBGP) or R4 (iBGP).

Configuration

Here’s the basic BGP configuration in case you want to try this example yourself.

Configurations

Want to take a look for yourself? Here you will find the startup configuration of each device.

R1

hostname R1
!
ip cef
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!         
interface GigabitEthernet0/1
 ip address 192.168.12.1 255.255.255.0
!
router bgp 1
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 neighbor 192.168.12.2 remote-as 24
!
end

R2

hostname R2
!
ip cef
!
interface GigabitEthernet0/1
 ip address 192.168.12.2 255.255.255.0
!
interface GigabitEthernet0/2
 ip address 192.168.23.2 255.255.255.0
!
interface GigabitEthernet0/3
 ip address 192.168.24.2 255.255.255.0
!
router bgp 24
 bgp log-neighbor-changes
 neighbor 192.168.12.1 remote-as 1
 neighbor 192.168.23.3 remote-as 3
 neighbor 192.168.24.4 remote-as 24
 neighbor 192.168.24.4 next-hop-self
!
end

R3

hostname R3
!
ip cef
!
interface GigabitEthernet0/1
 ip address 192.168.23.3 255.255.255.0
!
router bgp 3
 bgp log-neighbor-changes
 neighbor 192.168.23.2 remote-as 24
!
end

R4

hostname R4
!
ip cef
!
interface GigabitEthernet0/1
 ip address 192.168.24.4 255.255.255.0
!
router bgp 24
 bgp log-neighbor-changes
 neighbor 192.168.24.2 remote-as 24
!
end

Let’s see if R2, R3 and R4 have learned our prefix:

R2#show ip bgp | include 1.1.1.1
*> 1.1.1.1/32       192.168.12.1             0             0 1 i
R3#show ip bgp | include 1.1.1.1
*> 1.1.1.1/32       192.168.23.2                           0 24 1 i
R4#show ip bgp | include 1.1.1.1
* i1.1.1.1/32       192.168.24.2             0    100      0 1 i

It’s in the BGP table of these routers. Now let’s configure R1 to add the no advertise community:

R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 send-community

First we have to tell R1 to send BGP communities, by default this is disabled. Now we can create a route-map that sets the community value:

R1(config)#route-map NO_ADVERTISE permit 10
R1(config-route-map)#set community no-advertise

This route-map doesn’t have any match statements so it will set the no advertise community to all prefixes. Let’s activate it:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Full Access to our 660 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

505 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags:


Forum Replies

  1. Hi Hamood,

    Like Mauro explained below, AS path prepending is used to make the path less preferable. BGP uses AS path length in its selection for the best path.

    The community values are defined by an ISP, there are no fixed values or anything. Basically it’s just a “tag”, if you tag your prefixes with a certain value then the ISP will do something with it…prepend it’s AS path, set the local preference, etc.

    Rene

  2. Hi Rene,

    Now I have a problem that makes me want to pull my hairs out. We’re a global company that has 5 different branches in 3 different countries. The current situation is every branch has its own private AS# and we use eBGP to connect all the branches. We have all the devices run OSPF and IBGP inside of each branch. As I said before, we have 5 different branches in 3 different countries, which means actually 3 branches we’ll need to use the same ISP. In order to help with the understanding, please refer to the diagram attached. let’s see 65521 R3 is running

    ... Continue reading in our forum

  3. 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

  4. 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

    ... Continue reading in our forum

  5. 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

23 more replies! Ask a question or join the discussion by visiting our Community Forum