ccie blog

BGP No-Export Community

BGP No-Export ensures prefixes to not get advertised outside of an AS. In the diagram below, I’m going to configure R2 to advertise the network to R3 using the no-export community so that R3 does not advertise this to R4.

Let’s jump on R4 to ensure the prefix has been received.

R4#sh ip bgp | b Network
   Network          Next Hop            Metric LocPrf Weight Path
*>                             0 20 i
*>               0             0 20 i
r>               0             0 20 i
*>                             0 20 10 i
*>                             0 20 10 i

Okay let’s set this up. On R2 I’m going to configure a route-map that sets this prefix with a community of no-export, and apply it outbound towards R3.

R2(config)#ip prefix-list 100_network seq 5 permit
R2(config)#route-map no_export_100_network
R2(config-route-map)#match ip address prefix-list 100_network
R2(config-route-map)#set community no-export
R2(config)#route-map no_export_100_network permit 20
R2(config-route-map)#router bgp 20
R2(config-router)#neighbor route-map no_export_100_network out
R2(config-router)#neighbor send-community
R2#clear ip bgp * in
R2#clear ip bgp * out

Let’s check the affect on R3’s BGP entry. Hopefully it will have sent the prefix with a no-export community.

R3#sh ip bgp
BGP routing table entry for, version 7
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer)
Flag: 0x880
  Not advertised to any peer
  10 from (
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Community: no-export

Easy as that. Let’s verify that this prefix no longer gets sent to R4.

R4#sh ip bgp | b Network
   Network          Next Hop            Metric LocPrf Weight Path
*>                             0 20 i
*>               0             0 20 i
r>               0             0 20 i
*>                             0 20 10 i

There we have it. R4 no longer receives this prefix.


sudhakar SharmaApril 22nd, 2013 at 9:17 am

It’s really helpful and easy to understand article for no-export community ..

sudhakar SharmaApril 22nd, 2013 at 9:19 am

This is realy helpful and easy to understand NO-Export community .

Thanks ..

SamanAugust 11th, 2014 at 11:06 pm

Thanks it was helpful.

AbdelhamidNovember 30th, 2014 at 5:10 pm

It very helpful, with simple example to undranstand correctelly.
Thanks lot

VISHAL KOLAMKARDecember 8th, 2015 at 8:55 pm

I would like to throw more light on this, You can achieve the same by advertsing the same prefix from R1 AS10 routers to R2 AS20 router. This will tell AS20 routers that as i have recieved a prefix with no export from neighour AS10 i will keep this prefix within my AS(AS20) so i wont advertised this to my any external bgp peer ie AS30.
If you want same prefix from AS10 R1 to be restrcied to AS20 R2only tag the prefix from R1 with no advertise which will block the advertisement within AS

VijayJune 16th, 2016 at 9:04 pm

Explained so well. Thanks

Krishna B.GDecember 21st, 2016 at 11:13 am

very simple and smart explanation to understand better …. thanks a lot

SanjoyDecember 24th, 2017 at 12:00 pm

It very helpful, with simple example
Thanks Lot.

PradeepMay 12th, 2018 at 12:39 pm

this article is good. Explained so well.

Deepak kumar DasFebruary 24th, 2019 at 1:33 pm

excellent understanding

Leave a comment

Your comment