Blog
BGP Communities: The Modern Traffic-Engineering Tool
Border Gateway Protocol (BGP) has always been the steering wheel of the Internet, but communities are the torque converter that lets operators shift routes with surgical precision. An IMC 2018 study of public BGP data found that more than 75% of BGP announcements observed at 190+ collectors carried at least one community, and a RIPE Labs summary of the same research noted that the number of observed communities almost tripled between 2010 and 2018. Those tiny integers are how sophisticated networks—ours included—tell upstream carriers exactly what to do with a route without ever touching a physical cable.
Below is a focused, outcome-driven look at three community techniques every multi-ISP architect should keep in the toolbox: setting local-preference, applying selective AS-path prepending, and issuing graceful-drain signals before planned work. Each section illustrates how documented tags from major Tier-1s can shape paths quickly where supported—plus the pitfalls to avoid.
Choose Melbicom— 1,100+ ready-to-go servers — 21 Tier III/IV data centers — BGP sessions with BYOIP |
![]() |
Local-Pref Communities in Action
Problem: Inbound traffic may ignore a cheaper, lower-latency primary link.
Classic workaround: Globally prepend your AS on the backup path and hope everyone respects AS-path length.
Modern fix: Tag the route with a community that lowers local preference inside the backup provider’s network.
Some major backbones expose multiple “priority” values. Arelion’s AS1299 documentation lists 1299:50 as its lowest backup local preference, 1299:150 as equal-to-peer backup, and default local-pref 200 as equal to customer. The RADb AS3356 object lists Lumen/Level 3 communities 3356:70 and 3356:80 as local-pref downgrades. When a Melbicom customer wants all inbound traffic to favor a primary upstream over a backup path, the pattern is:
| Step | Action | Result inside upstream |
|---|---|---|
| 1 | Announce prefix X to the preferred upstream (for example, Arelion) without special tags | Preferred upstream keeps its default local-pref (Arelion’s documented default is 200) |
| 2 | Announce prefix X to the backup provider with its documented low-pref tag | That upstream lowers local-pref so its routers de-prefer the path |
Traffic shifts after normal BGP convergence, and if the preferred carrier fails, the alternate already has the route—just at a lower rank—so failover is automatic. Because local-pref is evaluated before AS-path length, the outcome is deterministic and doesn’t rely on transit domains interpreting prepends the same way.
Pitfall to avoid: Mixing contradictory communities. If you accidentally tag the same route with both high- and low-pref codes, upstream automation may default to the safest (lowest) value, turning a primary link into backup without notice.
BGP Fine-Tuning with Selective Prepend

Problem: A single eyeball network—or an entire continent—approaches your ASN on an expensive or long-latency route.
Classic workaround: Prepend your AS everywhere and accept collateral damage.
Modern fix: Use targeted prepend communities that instruct an upstream to lengthen the AS-path only when advertising to specific peers or regions.
Example: Lumen/Level 3’s RADb AS3356 object lists 65001:0 through 65004:0 for one to four prepends to all peers, and 65001:XXX through 65004:XXX for peer-specific prepending at peerings to AS XXX. Arelion uses communities such as 1299:200x, 1299:500x, and 1299:700x for regional peer prepending, where x is the number of prepends from 0 to 3 or 9 to suppress advertisement. This means you can prepend three times only toward a latency-sensitive mobile carrier in Asia while leaving European paths untouched. Testing is reversible within a BGP re-advert interval—no need to wait for a maintenance window.
A safe rollout pattern is lab verify > announce to a /24 test prefix > extend to full production. Melbicom’s BGP Session service supports BYOIP and BGP communities, so routing-policy changes can be tested on a narrow prefix and verified with looking-glass checks before being applied broadly.
Pitfall to avoid: Prepending on top of a reduced local-pref tag. If the upstream already deprioritized your route via local-pref, the extra AS-path length adds no marginal value and complicates troubleshooting. Log all changes and keep the logic simple: lower local-pref OR prepend, rarely both.
Graceful-Drain Signals for Maintenance

Problem: You need a 3 a.m. optics upgrade without BGP flap drama.
Modern fix: RFC 8326’s 65535:0 Graceful Shutdown community. Tag all routes, wait a few minutes for neighbors to rank them lowest, then close the session cleanly.
For example, Arelion documents lowering local-pref to 20 for this tag; many IX route servers propagate it so peers proactively re-route. If your upstreams support RFC 8326 graceful shutdown, you can:
- Tag
65535:0toward the link under work. - Confirm traffic volume is near zero.
- Shut down the BGP session or physical port.
- Bring it back up, withdraw the tag, and watch traffic return.
The method beats “cold-turkey” shutdowns that cause transient route flutters. It also fits DevOps pipelines: plug the tag into CI/CD jobs instead of one-off CLI work.
Pitfall to avoid: Announcing Graceful Shutdown to an upstream that doesn’t support it; you’ll gain no relief and assume traffic drained when it didn’t. Always validate via neighbor logs or external looking glasses.
Tags, Tables, and Large Communities
| Technique | Why It Matters | One-Line Best Practice |
|---|---|---|
| Local-pref tags | Deterministic primary/backup | Tag only one priority community per prefix |
| Selective prepend | Regional cost or latency tuning | Prepend narrowly—per ASN or per continent |
| Selective export / scope tags | Limit who hears your routes (e.g., regional or peer-specific) | Use documented no-export / regional communities; verify via looking glasses |
65535:0 drain |
Lower-loss planned maintenance | Where supported, automate and verify before shutdown. |
Large communities (RFC 8092) expand the namespace to three 32-bit fields, avoiding collisions with 32-bit ASNs and providing a canonical ASN:action:modifier style. Where a provider documents large-community equivalents, the same policy intent can be expressed in large-community form. If your AS > 65535, plan to use large communities whenever the counterparty supports them.
Common Pitfalls—The 90-Second Checklist
- Assume Nothing. One provider’s backup tag could be another’s do-not-propagate.
- Strip Unknowns. Sanitize incoming communities from peers to prevent remote policy bleed-through.
- Harden Policy Changes. Require peer-review or approval before pushing community changes in automation.
- Log Everything. Use commit-log diffs or NetConf/YANG to track community edits; rollback is your friend.
- Monitor Results. RouteViews, RIPE RIS, or looking-glass checks confirm a change propagated as planned.
Smart Communities, Smarter Routing

BGP communities have grown from obscure metadata to a de-facto control plane for fine-grained routing policy. Set a documented 32-bit community, where supported, and you can influence which carrier hauls your packets and how gracefully users ride out maintenance. The networks that master communities extract more value from every transit dollar and deliver steadier performance to every end user—even as traffic volumes and topologies evolve.
For engineers, the message is clear: treat communities as code. Document the intended outcome, tag the route, verify in near-real time, and roll back with confidence. The Internet already understands these cues; you only need to speak its language fluently.
Order Your BGP Session
Order a BGP session and start shaping traffic with fine-grained community tags.
