BGP Community No Export

The well known BGP community no export tells BGP neighbors to advertise a prefix only to iBGP neighbors. If you are not sure what BGP communities are and how they work then I advise you to read my introduction to BGP communities first before you continue. Having said that, let’s take a look at a configuration example. Here’s the topology we will use:

BGP Community No Export Topology

Above we see R1 with network 1.1.1.1/32 on a loopback interface. It will advertise this prefix with the no export community set. As a result, R2 will install it in its BGP table and advertises it to R4 (iBGP). It will not be advertised to R3 since this is a eBGP session.

Configuration

Basic BGP Configuration

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

R1#show running-config | section bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 neighbor 192.168.12.2 remote-as 24
 no auto-summary
R2#show running-config | section bgp
router bgp 24
 no synchronization
 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
 no auto-summary
R3#show running-config | section bgp
router bgp 3
 no synchronization
 bgp log-neighbor-changes
 neighbor 192.168.23.2 remote-as 24
 no auto-summary
R4#show running-config | section bgp
router bgp 24
 no synchronization
 bgp log-neighbor-changes
 neighbor 192.168.24.2 remote-as 24
 no auto-summary

By default BGP does not send any communities. All routers will learn about 1.1.1.1/32:

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.12.1             0    100      0 1 i

BGP Community No-Export Configuration

Let’s configure our BGP community. First we have to tell R1 to send communities:

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

Now we can create a route-map that sets the BGP community to no-export and we attach it to our neighbor R2:

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

If you like to keep on reading, Become a Member Now!

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 800 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)
527 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. Thank you Rene for making it easy to learn this kind of stuff :slight_smile:

  2. thanks your rene, you d best !

    quick check : why you gave next-hope-self on 4. without that also I get the same result.

  3. Hi Abhishek,

    Without next-hop-self, R4 would learn the IP address of R1 as the next hop address. As long as you advertise the network in between R1/R2 into BGP, you will be fine. If you don’t, you have to use next hop self.

    Rene

  4. R2 do not send-community to R4, in this case what happens if R4 is connected to another AS ?
    i think R4 will advertise the prefix because it does not any thing about the community, please correct me if wrong

  5. Mahmoud,
    You are exactly right! This is the output of R2 with respect to the BGP advertised route of 1.1.1.1

     Origin IGP, metric 0, localpref 100, valid, external, best
          Community: no-export
    

    If R2 isn’t configured to send communities to R4, this would be R4’s output of 1.1.1.1
    Origin IGP, metric 0, localpref 100, valid, internal, best

    Notice the community is missing. Because of this, R4 doesn’t know that it isn’t supposed to advertise this to another AS, so any other AS connected via R4 would also learn of 1.1.1.1/32

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