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 100.100.100.0/24 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
*> 12.12.12.0/30    34.34.34.1                             0 20 i
*> 23.23.23.0/30    34.34.34.1               0             0 20 i
r> 34.34.34.0/30    34.34.34.1               0             0 20 i
*> 100.100.100.0/24 34.34.34.1                             0 20 10 i
*> 200.200.200.0    34.34.34.1                             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 100.100.100.0/24
R2(config)#
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)#exit
R2(config)#
R2(config)#route-map no_export_100_network permit 20
R2(config-route-map)#router bgp 20
R2(config-router)#neighbor 23.23.23.2 route-map no_export_100_network out
R2(config-router)#neighbor 23.23.23.2 send-community
R2(config-router)#end
R2#
R2#clear ip bgp * in
R2#clear ip bgp * out

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

R3#sh ip bgp 100.100.100.0
BGP routing table entry for 100.100.100.0/24, 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
    12.12.12.1 from 23.23.23.1 (2.2.2.2)
      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
*> 12.12.12.0/30    34.34.34.1                             0 20 i
*> 23.23.23.0/30    34.34.34.1               0             0 20 i
r> 34.34.34.0/30    34.34.34.1               0             0 20 i
*> 200.200.200.0    34.34.34.1                             0 20 10 i

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

7 Comments

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

Hi
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

Hello
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 100.100.100.0/24 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

Leave a comment

Your comment