BGP no_export and Well-Known Communities
BGP no_export and Well-Known Communities
Thesis
Well-known BGP communities are a portable policy language. no_export (65535:65281) means “do not announce this route to eBGP peers”; no_advertise keeps it off all peers; no_export_subconfed stops it at confederation boundaries. Mis-applying them is a classic route-leak footgun.
Mental model
route with community no_export
│
├─ iBGP: still propagated inside the AS (usual)
└─ eBGP: stripped from announcements to external peers
Vendor knobs differ: some require send-community on the neighbor before communities travel at all.
Worked example
Conceptual FRR / policy sketch (lab with netlab/containerlab — not executed on this box; no sudo/lab installs):
! tag a prefix so upstreams do not re-advertise it onward
ip prefix-list LOCAL-ONLY permit 192.0.2.0/24
route-map TAG-NO-EXPORT permit 10
match ip address prefix-list LOCAL-ONLY
set community no-export
!
router bgp 65001
neighbor 203.0.113.1 remote-as 65002
address-family ipv4 unicast
neighbor 203.0.113.1 route-map TAG-NO-EXPORT out
neighbor 203.0.113.1 send-community
Verification on a lab router after the session is up:
show bgp ipv4 uni 192.0.2.0/24
# expect Community: no-export
# on the eBGP peer: prefix absent (or present only if they ignore well-known — treat as bug)Trap
Assuming communities are sent by default. Many implementations require an explicit send-community [both]. Also: no_export does not replace NO_PEER / RFC 7999 peer communities — pick the community that matches the business intent.
Boring rule
Document each tagged prefix: who may see it, which community encodes that, and whether send-community is on. Test with an eBGP session in the lab before production.
Try this
- In netlab/containerlab, announce a prefix with and without
no_exportand watch the second-hop AS. - Compare
no_exportvsno_advertiseon an iBGP mesh. - Read IANA well-known community registry values.
Sources
- RFC 1997 (BGP Communities Attribute)
- RFC 3765 (
NOPEER) / RFC 7999 (BLACKHOLE) as related well-knowns - FRR docs: BGP communities / route maps