Course contents

Module 1: Communities and MultihomingLesson 1.1 (1 of 3 in this module)1 of 11 in the Advanced BGP course

BGP communities

Standard, extended and large communities, the well-known ones, and how ISPs use them.

Advanced · 20 min read

You'll learn to read and set standard communities, use the well-known values, match a community in a route map, and say what extended and large communities add.

A label that travels with the route

The attributes you have used so far change how a route is chosen. A community does something different: it tags a route so that other routers can recognise it and apply policy. The tag is optional and transitive, so it can pass through many networks. By convention a standard community is written AS:value, such as 64501:80.

A community follows the route
A community follows the routeA router tags a route, the tag travels in the UPDATE, and another router acts on it.TagR1 sets 64500:100CarryUPDATE with theCOMMUNITY attributeMatchanother routermatches 64500:100Actset local prefor filter

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

The tag does nothing until a policy matches it.
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.

Well-known communities

Well-known communities
Well-known communitiesThese values are defined by standards and understood by every implementation.no-exportDo not advertise outside the AS (or confederation)no-advertiseDo not advertise to any peerlocal-ASDo not advertise outside the local sub-ASinternetThe default meaning: no restriction

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

Most real policy uses private AS:value tags instead.
Well-known communities
Well-known communitiesValue; Effect. no-export: Do not advertise to eBGP peers outside the AS (or confederation) no-advertise: Do not advertise to any BGP peer local-as: Do not advertise outside the local sub-AS, used with confederations internet: The default meaning of no restrictionValueEffectno-exportDo not advertise to eBGP peers outside the AS (or confederation)no-advertiseDo not advertise to any BGP peerlocal-asDo not advertise outside the local sub-AS, used with confederationsinternetThe default meaning of no restriction

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

Each item on the left, with what it means on the right.

What each well-known community does in practice

The well-known communities are the easiest to try, because they need no agreement with anyone: every BGP router understands them. Each one limits how far a route may be advertised. Think of them as a boundary around the route.

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.

no-export

R1 receives a prefix from a neighbour with no-export attached. R1 installs it and uses it normally, and advertises it to its iBGP peers, which also keep the tag. None of them advertise it to an eBGP neighbour. This is the community to attach on routes learned from a provider so that you never pass them on to another provider.

no-advertise

The route is kept and used by the router that received it, and is sent to no BGP neighbour at all, iBGP included. Use it to test a route on one router, or to hold a route that only that router needs.

local-AS

In a confederation, a router in one sub-AS sees a neighbour in another sub-AS as a confederation eBGP peer, and no-export would allow the route to cross that boundary. local-AS is stricter: the route stays inside its own sub-AS. Outside a confederation it behaves like no-export.

route-map TAG-NO-EXPORT permit 10 set community no-export additive ! router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 route-map TAG-NO-EXPORT in neighbor 10.255.0.2 send-community

R1. Routes from ISP A are kept inside AS 64500. send-community on the iBGP neighbour passes the tag to R2 so that R2 also refuses to export them. Use no-advertise or local-AS in the set line for the other behaviours.

Illustrative Cisco IOS XE output written for this lesson, not a router capture
R2#show ip bgp community no-export
     Network          Next Hop            Metric LocPrf Weight Path
 *>i 203.0.113.0      10.255.0.1               0    100      0 64501 i
Lists every route carrying the community. To see the tag on one prefix, run show ip bgp 203.0.113.0 and look for the Community line, which reads no-export for this route.
Replace or add to existing tags
Replace or add to existing tagsThe additive keyword.set community XReplaces all tagsProvider tags lostset community X additiveAdds to the listExisting tags keptvs

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

Without additive, a set community command replaces every community on the route, including ones the provider set.

Send, match and set

Three steps make communities work. First, allow them to be sent. Second, match them with a community list. Third, act on them in a route map.

Without and with send-community
Without and with send-communityOn Cisco IOS a community is kept on the router and not sent to a neighbour unless send-community is configured.Without send-communityTag set locallyNeighbour never sees itWith send-communityTag is carried inthe UPDATEvs

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

Missing send-community is the most common reason tags do not arrive.
ip bgp-community new-format ip community-list standard ISPA-PREFER permit 64501:80 route-map ISPA-IN permit 10 match community ISPA-PREFER set local-preference 80 route-map ISPA-IN permit 20 router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 send-community neighbor 192.0.2.1 route-map ISPA-IN in

R1. new-format makes IOS XE show AS:value instead of one large decimal number. Sequence 10 lowers the preference of routes ISP A has tagged 64501:80. Sequence 20 passes everything else unchanged.

To tag routes you send, set the community in an outbound route map. Use additive so existing tags are kept instead of replaced.

route-map TO-ISPB permit 10 match ip address prefix-list COMPANY-ONLY set community 64502:200 additive

R2. Asks ISP B to apply whatever policy 64502:200 means in its published list. Check the provider's documentation first; the number here is an example.

Illustrative Cisco IOS XE output written for this lesson, not a router capture
R1#show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 8
Paths: (1 available, best #1, table default)
  64501
    192.0.2.1 from 192.0.2.1 (11.11.11.11)
      Origin IGP, metric 0, localpref 80, valid, external, best
      Community: 64501:80
The Community line shows the tag, and localpref 80 shows the route map acted on it. If the line is missing, check that the neighbour sends communities and that new-format is set.

Extended and large communities

Extended communities are 8 bytes and carry typed values such as the route targets used by MPLS VPNs. Large communities are 12 bytes, written global:local1:local2. The first field is a full 32-bit AS number, which standard communities cannot hold, and the two local fields leave room for a function and a parameter.

Standard and large communities
Standard and large communitiesStandard communities are 32 bits, written AS:value. Large communities add a third field for 4-byte AS numbers.Standard64500:10016-bit AS and 16-bit valueLarge64500:1:100Global admin, two valuesWorks with 4-byte ASand

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

Use the format your devices and peers support.

Technical references: RFC 1997 (communities) and RFC 8092 (large communities). Output above is illustrative.

Where communities are used in practice

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.

Communities let one network give others a simple way to ask for a behaviour without sharing its internal design. A provider may publish a table such as set 64501:80 to lower local preference, or a value that blocks advertisement to a certain region. Inside a company, tags mark where a route was learned so that policy elsewhere can act on it.

Three typical uses of communities
Three typical uses of communitiesTag by origin, ask a provider for a behaviour, or limit how far a route travels.Community useMark origintag routes by site orcustomer for later policyAsk the providersend a value that setspreference or blocks a pathLimit scopeno-export keeps aroute inside the AS

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

A published table of values is the contract between networks.

Check your understanding

Predict · scenario 1

A route arrives with a community but your neighbours downstream never see it. What is the most likely cause?

Predict · scenario 2

What does no-export do?

Predict · scenario 3

Why use set community ... additive?

FAQ

Are communities sent by default on Cisco IOS XE?
No. A neighbour must be configured with send-community, otherwise tags are stripped when the route is advertised.
Does a community change how a route is chosen?
Not by itself. A community is a label. Policy somewhere, usually a route map, reads the label and changes an attribute such as local preference.
What is a large community?
A 12-byte tag in the form global:local1:local2, defined in RFC 8092, that supports 4-byte AS numbers in the first field. Support depends on the release, so check yours.