Course contents

Module 3: Path SelectionLesson 3.8 (8 of 13 in this module)17 of 43 in the BGP course

Attribute: communities

A community is a label you attach to a route so that routers further along can act on it without matching prefixes one by one. It is the scalable way to express policy.

Advanced · 9 min read

You'll learn to tag routes with a community, send it to a neighbour, match it in a route map, and describe the well-known communities.

What a community is

A community is an optional transitive attribute holding one or more 32-bit tags, written ASN:number such as 64500:100. The tag does nothing by itself. A policy somewhere reads it and acts: filter, set local preference, prepend, or refuse to advertise.

A community is a tag that travels with the route
A community is a tag that travels with the routeISP A tags the company prefix with community 64501:80. The company router matches the tag and sets local preference 80 on the route.CompanyAS 64500ISP AAS 64501Customer R1AS 64500UPDATE 203.0.113.0/24COMMUNITY 64501:80route map matches itand sets LOCAL_PREF 80Well-known valuesno-export · no-advertiselocal-as · internet

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The tag carries no meaning on its own. The receiving network decides what each value does, which is why providers publish a community list.

Tagging a route

Attach a tag with set community in a route map, then make sure the neighbour actually receives it with send-community.

route-map TAG-ISPA permit 10 set community 64500:100 additive ! router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 route-map TAG-ISPA in neighbor 10.255.0.2 send-community both end clear ip bgp 192.0.2.1 soft in

R1. Routes from ISP A are tagged 64500:100 and the tag is sent to R2. Additive keeps any tags the route already had instead of replacing them.

Illustrative Cisco IOS XE output written for this lesson, not a router capture
R2#show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 12
Paths: (1 available, best #1, table default)
  64501
    10.255.0.1 from 10.255.0.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Community: 64500:100
R2 sees the tag because R1 sent it. Without send-community the Community line would be missing.

Well-known communities

How far a route travels with each well-known community
How far a route travels with each well-known communityA route tagged no-advertise is kept by the router that received it and sent to no BGP neighbour. A route tagged local-AS is sent only to neighbours in the same sub-AS of a confederation. A route tagged no-export is sent to iBGP peers and confederation peers but not to eBGP neighbours outside the AS. A route with no restricting community travels as far as policy allows.no-advertiseStays on the router that received itlocal-ASReaches routers in the same sub-AS onlyno-exportStays inside the AS or confederationno communityTravels as far as policy allows

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The wider the bar, the further the route may be advertised. Use these to keep routes from leaving a boundary without writing a filter.
The four well-known communities
The four well-known communitiesStandard meanings understood by every router.internetAdvertise to everyoneThe default behaviourno-exportNot to eBGP neighboursStays in the ASno-advertiseNot to any neighbourStays on this routerlocal-asNot outside the local sub-ASUsed with confederations

On small screens, swipe sideways or focus the diagram and use the arrow keys.

They limit how far a route spreads.

Using communities to steer traffic

Providers publish community values that act as remote controls. Tag a route with the provider value for prepend once, and the provider prepends for you. Tag it with a local preference value, and the provider lowers its preference for that route. This reaches farther than your own AS can.

Who sends which routes to whom
Who sends which routes to whomYour AS has a provider above it, a peer beside it and a customer below it. Customer routes are advertised to everyone, because customers pay for reachability. Provider and peer routes are advertised only to your customers, so you never carry traffic between two networks you do not charge or serve.ProviderAS 64501Your ASAS 64500PeerAS 64502CustomerAS 64510you paysettlement-freepays youTo provider and peersend customer + own routes onlyTo customersend everything

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Communities are the usual way to mark where a route was learned, so one outbound filter can apply this rule. Leaking provider or peer routes to another provider or peer makes your AS a transit network without being paid for it.
ip community-list standard FROM-CUSTOMER permit 64500:100 ! route-map TO-PEER permit 10 match community FROM-CUSTOMER route-map TO-PEER deny 20

Advertise to a peer only routes that carry the customer tag. The final deny makes the intent explicit.

Check your understanding

Predict · scenario 1

R1 sets a community with a route map but R2 never sees it. What is missing?

Predict · scenario 2

A route carries no-export. Where is it not advertised?

Predict · scenario 3

What does the additive keyword do in set community?

FAQ

Are communities sent automatically?
No. On Cisco IOS XE you must configure send-community toward each neighbour, or the tag stays on the router.
What does no-export do?
A route carrying no-export is not advertised to eBGP neighbours, which keeps it inside your AS or confederation.
Who defines community values?
The well-known values are standard. Other values are written ASN:number and each network decides its own meaning, so read the provider documentation.