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! Here is why:

  • 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 660 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

506 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