BGP Routing Policy, Filters and Communities
Policy decides which routes are usable
BGP policy is the set of rules controlling which routes a router accepts, how it ranks them, and which routes it announces. Import policy works on received routes; export policy works on routes considered for advertisement to a particular neighbor. Neither is a packet firewall. Start with the allowed business relationships, then express them as explicit rules. RFC 8212 specifies restrictive eBGP defaults without explicit policies; inspect the implementation and configuration rather than assuming these defaults.
A worked export decision
In this paper network, AS 64496 owns 192.0.2.0/24 and accepts exactly 198.51.100.0/24 from a customer. Its upstream export policy permits only those two exact prefixes, and only if learned from the authorized source. It rejects all other rows. Evaluate provenance and prefix together; an exact prefix match does not imply a match for a more-specific prefix.
Prefix Source Export192.0.2.0/24 local permit198.51.100.0/24 customer permit198.51.100.0/25 customer deny203.0.113.0/24 provider denyThis table is a fictional policy, not a router command or proof of ownership.
Communities are routing metadata
A standard community is a 32-bit value often written as two 16-bit numbers separated by a colon. Large communities have three 32-bit fields, supporting four-octet ASNs. An operator might use 64496:100 to identify a customer route; the meaning is local unless agreed with another network. Extended communities are another distinct attribute family. Well-known NO_EXPORT restricts announcements beyond the AS or confederation boundary, and NO_ADVERTISE prevents advertisement to any BGP peer. Ordinary tags do not enforce policy by themselves or authenticate route origin. Validate customer-supplied tags and document how each tag is used.
Traffic engineering and safeguards
LOCAL_PREF can express an internal preference for an eligible outbound path. A neighboring AS makes its own selection decisions; MED and other signals do not guarantee inbound traffic distribution. Aggregation reduces route count but may attract traffic for unreachable components: verify coverage and forwarding before permitting a summary. Maximum-prefix limits bound accepted or received route counts depending on implementation; exceeding the threshold may warn or interrupt a session. Treat the limit as a guardrail, not a prefix authorization check. Review the expected route set, counters, policy ordering, rollback and both directions of reachability before approving changes.
Practice and common mistakes
In the manual task, classify a fresh set of received routes using an exact-prefix and source policy. Record the first reason for each rejection. Do not equate an established session with accepted prefixes, or assume a community name is globally meaningful. The next lesson addresses how selected routes are distributed inside an AS. All prefixes and ASNs here are documentation examples; no external advertisements or device changes are part of this exercise.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
BGP Routing Policy, Filters and Communities Quiz
Apply advanced BGP concepts to fictional routing evidence.
Which stage controls a route received from a neighbor?
An exact allowlist contains 198.51.100.0/24. Does 198.51.100.0/25 match?
What does an ordinary community 64496:100 mean?
Which attribute restricts advertisement to every BGP peer?
Why is a maximum-prefix limit insufficient by itself?