BGP Policy
Ze applies ordered import and export filter chains to BGP updates. Define named policy objects once, attach them globally, to a group, or to one peer, then verify both accepted routes and the routes sent onward.
Policy model
Policy has two parts:
- Named filter instances under the top-level
policy { ... }root. - Direction policies under
filter, each with orderedfiltersand a requiredfinal acceptorfinal reject.
policy {
loop-detection no-self-as {
allow-own-as 0
}
}
bgp {
router-id 192.0.2.1
session {
asn {
local 65000
}
}
filter {
import { filters [ no-self-as rpki:validate ]; final accept; }
}
group customers {
filter {
import { filters [ community:scrub ]; final accept; }
export { filters [ prefix:customer-export ]; final accept; }
}
}
}
The policy root is shared by every protocol, and policy routing's
policy route list lives in it too. A filter type is a list the YANG schema
marks ze:filter; route carries no marker, so a filter chain cannot name a
policy route entry.
The effective references are cumulative: automatic safety filters run first,
followed by global, group, and peer references. The most-specific configured
direction supplies its final decision; references inherited from less-specific
levels are not replaced. Each configured direction must state its own final,
even if it has no references. Use insert in the editor when order matters.
For example, filter { import { filters [ name ]; final accept; } export { final reject; } } runs name on import and rejects every export that reaches
the policy final. With no explicit policy at any level, EBGP rejects routes
in that direction (RFC 8212 Section 3). IBGP keeps its accepting default,
including sessions using the migration AS. Automatic and inactive references
do not count as an explicit policy.
A non-required automatic reference you deactivate stays disabled after a plugin restart or an unrelated declaration rebuild. A reload uses its current deactivation settings, not the settings from boot. Required automatic references still cannot be overridden.
Named loop-detection instances remain visible in the effective import policy,
including when the direction has no operator final. Plain no-self-as,
loop-detection:no-self-as, and canonical loop:no-self-as references select
the same instance. Its settings control the existing protocol-stage loop check;
the instance is not an external plugin and is not executed a second time in
the policy RPC chain. Deactivating its import reference disables that check
for the peer. Earlier named automatic references could incorrectly attempt an
RPC to the instance name and fail with unknown plugin.
An active named internal reference on export is refused: these instances
configure ingress checks, not an export policy. The refusal names the location
where the reference was written and prints the exact editor command to
deactivate it. Use that original location and spelling, not the effective
peer's canonical reference. For example, a reference written on group customers
as loop-detection:no-self-as is corrected in the configuration editor with:
top
deactivate bgp group customers filter export filters loop-detection:no-self-as
commit now
Deactivation keeps that member as a deliberate no-check decision; it does not
remove other filters or change the final. Removing the reference at its original
location is also an option. Automatic import references never populate export.
A dynamic group's export reference that names the instance through a config
variable (loop:AUTO-$remote_as) is known only when a peer connects, so it is
refused then: that peer rejects every route it would send, and the log names
the peer and the reference to remove or deactivate.
A reload compares the whole effective policy. Changing only the export final
therefore reconciles advertisements on the existing session without a source
UPDATE. Rejecting withdraws prior advertisements. Returning to acceptance
regenerates configured static, default and plugin routes and replays retained
received routes through the configured replay
owner. Ordinary received-route restoration requires the receive store and that
owner's existing send permission. FlowSpec instead restores the selecting RIB's
currently authorized paths through the same owner. A destination negotiating only
FlowSpec does not require the optional receive store; negotiated ordinary families
still require their retained source.
Removing the last explicit export policy rejects on EBGP. On IBGP, removing an
accepting direction needs no replay or static-route reset. Routes removed in the
same reload are still withdrawn.
If required restoration fails, reload returns the error and rolls back the policy
instead of committing an accepting configuration with stale rejected state.
One-shot API announcements have no retained desired source. They are withdrawn
on rejection, but their producer must reannounce them after acceptance returns.
This preserves the existing API ownership contract rather than introducing a
second route store. Explicit withdrawals remain effective under final reject.
Reloading a filter definition without changing the final is a separate operation.
A chain that names a plugin filter
A chain member written <plugin>:<filter> names a filter that plugin declares
when it starts. The qualifier also controls execution: a local policy instance
with the same filter name cannot replace a reference qualified by another
plugin. Ze checks the reference against that declaration: the plugin must
declare a filter of that name (or a name pattern it matches). Its declared
direction must allow the attachment: an import-only filter cannot run on
export, an export-only filter cannot run on import, and both allows either.
The fields the filter declares it reads and sets must be ones the attachment
carries and lets a filter set. Ze checks the direction of a plugin's declared
auto-insertions too. When the check fails, the config is not applied:
- At startup, ze does not start. The plugin is refused at its first stage, whatever its failure policy, and ze exits with the reason and the fix.
- On a reload, the reload is refused and the running config stays in force. Nothing of the new config is applied.
The message names the chain and what the plugin declares:
peer upstream import filters: chain names "acme:clean", and plugin "acme" declares no filter of that name; it declares filter scrub
or the field the attachment refuses:
peer upstream import filters: bgp import filter "acme:clean" reads <field>, which bgp import routes do not carry; remove it from this chain or use a filter that reads only <fields>
peer upstream import filters: bgp import filter "acme:clean" sets <field>, which a filter at bgp import may not set; remove it from this chain
At startup, ze adds ; ze does not start with a config whose filter chain names a filter its plugin refuses: correct the chain reference in the config, or the plugin's filter declaration, then start ze again. On a reload that
starts the plugin, it adds ; the reload is refused and the running config stays in force: correct the chain reference in the config, or the plugin's filter declaration, then reload again. Fix the chain reference, or the
plugin's declaration, and start or reload again.
A dynamic group may name an external filter through $remote_as, $local_as
or $remote_ip, for example bgp-filter-irr:$remote_as. At config load and
Stage 1, Ze requires a declaration whose direction, reads and sets fit the
attachment. An exactly declared name must match the template; a declared name
pattern is checked against the concrete name after the peer's variables are
resolved. Ze does not compare the literal $remote_as token with an ASN pattern.
Each peer's resolved name is checked again against the actual declaration,
with an exact name taking precedence over a pattern. Its direction, reads
and sets must still fit. A resolved name the plugin does not serve fails
closed: that peer's chain rejects every route in that direction. Static peers
cannot use these variables, and an unknown variable is refused at load.
Filter outcomes
A filter can:
- accept the update unchanged;
- reject it and stop the chain;
- modify selected attributes and pass the changed update onward.
A filter's accept means continue, not bypass the remaining policy. After the
last active reference, Ze applies final. An empty policy, or one whose
references are all inactive, still applies it. A raw full-UPDATE rewrite stops
later filters, but still receives the policy final. An earlier reject,
fail-closed error, or teardown cannot be turned into acceptance by final accept.
A match instance naming a prefix-list judges each prefix of the UPDATE,
announced and withdrawn, as the prefix-list filter does: an UPDATE with no
prefix, or none the list denies, passes; one whose every prefix is denied is
rejected; otherwise the denied prefixes are dropped and the rest passes on. A
FlowSpec rule is judged by its destination prefix, and a denied or absent
destination rejects the whole UPDATE.
policy {
prefix-list CUSTOMERS { entry 10.0.0.0/8 { ge 16; le 24; action accept; } }
match customers-only { prefix-list CUSTOMERS; }
}
bgp { peer p1 { filter { import { filters [ customers-only ]; final accept; } } } }
Each plugin declares whether an internal error fails open or closed. Security filters should normally reject on failure. Operational policy should make that choice explicit rather than depending on an unavailable external service.
Conditional defaults and stale readvertisement
default-originate-filter is a condition, not an attribute policy for the
default route. It judges the encoded default route through the named filter
and the export policy's final. Valid attribute sets participate in that
evaluation but do not change the emitted default. An eligible default then
runs the full export policy separately. A rejected condition, a fail-closed
evaluation error or an unsupported raw condition withholds the default; use
a filter that reads declared route fields rather than raw bytes.
A stale readvertisement runs only export members whose declarations opt into
readvertise. Its result goes to the already-filtered writer: ordinary export
members do not run again, and a non-idempotent set such as AS-path prepend is
not doubled. A withdrawal decision remains a withdrawal. Writer ownership,
message-size limits and origination admission still apply.
The exception is a route sent before the peer's export policy last changed, whether by a reload that changed it or by the peer being restarted, and a route whose earlier send cannot be identified. It runs the whole export policy and its final, because the policy that passed it is no longer the one in force, the members that opted in running last. A reload that leaves the export policy as it was does not trigger this. A rejection withdraws the route from the peer, since leaving it would keep a copy with no LLGR_STALE mark until the purge. A route whose earlier send cannot be identified is withdrawn only while the prefix holds a route this router originated: a fresher route another source put under the same prefix stays.
Known defects, owned by
spec-bgp-refresh-reapplies-export-policy:
this run goes over the bytes already sent, so a non-idempotent set such as AS-path
prepend applies a second time to that route, and a change inside an external
plugin's own data is not seen as an export policy change and does not trigger it.
When bgp-gr runs, its required llgr-egress member answers again on a route
RFC 9494 Section 4.3 binds, one Ze advertised the LLGR Capability for or attached
LLGR_STALE to: it runs over a body the export chain rewrote, and puts the community
back if a member took it off. That holds against an ordinary member. A plugin filter
that declares judges-final runs in the same pass, and one behind llgr-egress can
take the community off again. A route from a neighbor Ze sent no capability
to is not bound, so an export member may remove the 65535:6 such a neighbor sent. An
import member runs ahead of it and can still take the community off first.
Common policy building blocks
Ze ships filters for:
- AS path matching and length;
- rejection of a path through listed ASNs, by position (
reject-asn); - prefix lists;
- standard, large, and extended communities;
- route attribute modification;
- private AS removal;
- address-family filtering;
- RPKI and IRR validation;
- RFC 4271 AS loop and RFC 4456 cluster-list loop detection.
The plugin guide documents the registered filter types and their current configuration. The generated plugin catalogue shows which plugin owns each filter.
Removing an address family
A family-filter instance with action remove checks every reachability
section of the UPDATE: the legacy IPv4 announcements and withdrawals, and the
families named by MP_REACH_NLRI and MP_UNREACH_NLRI. A mixed UPDATE loses only
the configured family's sections; announcements and withdrawals of other
families remain. If no other family remains, the whole UPDATE is suppressed.
An UPDATE without the configured family passes unchanged.
With action tear-down, a match in any of those sections closes the session
on import. This action is forbidden in export chains.
Rejecting a path through a transit provider
A reject-asn list names the ASNs that must not appear in a path exchanged with
a peer, and states WHERE in the AS_PATH each one is unacceptable. A peer that
leaks its transit sends paths that run through its upstream, and this list drops
those routes while the session stays up.
policy {
reject-asn NO-TRANSIT {
indirect [ 174 701 3356 ];
}
match reject-asn-NO-TRANSIT {
reject-asn NO-TRANSIT;
}
}
bgp {
router-id 192.0.2.1
session {
asn {
local 65000
}
}
peer ix-member {
role { import peer; }
filter {
import { filters [ reject-asn-NO-TRANSIT ]; final accept; }
export { filters [ reject-asn-NO-TRANSIT ]; final accept; }
}
}
}
Seven keywords say where: direct, indirect, transit, origin, anywhere,
nth <n> and regex. indirect is the one most operators want, because it
excludes the sending peer's own leading run and catches the ASN everywhere else.
The configuration reference carries the whole table.
A peer that declares an RFC 9234 role needs no list for its upstream
providers: bgp-role inserts bgp-role:upstream-asn in the chains that role
binds and rejects a path through the remote ASN of every role import customer peer, plus any role transit-asns set. A reject-asn list is for
the ASNs you choose beyond that. See BGP roles, "The Upstream
Check a Role Inserts".
show bgp reject-asn prints every list with the effective position set per ASN.
show bgp reject-asn known transit-free prints a pasteable block of well-known
transit ASNs; Ze suggests them and never applies them on its own.
IRR and RPKI
IRR filters build allowed prefix sets from routing registry data. RPKI validates route origin against ROAs. They answer different questions and can be used together:
- IRR: is this prefix documented for this network or AS-SET?
- RPKI: is the origin AS authorised by a cryptographically validated ROA?
Use the IRR filtering and RPKI guides for cache configuration, refresh, failure behaviour, and operator commands.
Attribute changes
Attribute modification belongs in an explicit export or import chain. Keep each named modifier narrow, then compose it with other filters. Typical operations include setting local preference or MED, changing next hop, and adding or removing communities.
Inspect the live plugin documentation before using increment or decrement operations. Attribute ranges and missing-attribute behaviour are validated by the owning plugin.
Well-known communities (RFC 1997)
Ze honors three community values on egress with no configuration, for every peer and every deployment:
| Community | Value | Ze sends the route to |
|---|---|---|
NO_EXPORT |
0xFFFFFF01 | internal peers only |
NO_ADVERTISE |
0xFFFFFF02 | ✕ |
NO_EXPORT_SUBCONFED |
0xFFFFFF03 | internal peers only |
The rule applies to a route ze RECEIVED from a peer. A route ze originates and tags itself is still advertised, because tagging your own route is how the community is meant to be used.
Two properties are worth knowing before you write policy around this.
The check reads the received route, so an egress policy that strips these values does not restore advertisement. The value ze reads is the one the route arrived with. Removing NO_EXPORT in an export chain changes the bytes on the wire. It does not change what the peer asked for, and RFC 1997 states the prohibition as a MUST NOT. FRR and BIRD apply the route-map first, so a strip there does restore advertisement. Ze diverges from both, deliberately: an operator policy cannot grant what the RFC refuses. If a route must leave the AS, ask the peer to stop tagging it.
Withdrawals are not affected. All three clauses forbid ADVERTISING the route. One UPDATE can carry withdrawn routes and an announcement together. A peer refused the announcement still receives the withdrawals, so it never keeps a prefix ze can no longer take back.
A refused announcement produces a withdrawal of its destinations as well. The forwarding rails do not retain a per-destination advertised inventory, so they cannot prove that the peer never held an earlier generation. Withdrawing it prevents a newly restricted route from remaining usable. This is not an advertisement: wire assertions must distinguish reachable NLRI from Withdrawn Routes and MP_UNREACH_NLRI, rather than reject a prefix anywhere in an UPDATE.
Each suppression increments ze_bgp_wellknown_community_suppressed_total with the community as its label. Nothing else reports it: there is no per-route log line and no configuration switch, because a switch here would be a switch to violate the RFC.
Ingress community rules
The bgp-filter-community plugin adds three RFC-derived rules to the ingress
direction, beside the named tag and strip sets. Each one is a leaf under
filter { ingress { community { } } }, and the container is available at the
bgp, group, group-peer, and standalone-peer levels.
The settings run only where the peer's filter chain names the member that
runs them: bgp-filter-community:ingress in the import chain for the
ingress settings, bgp-filter-community:relation for relation-tag, and
bgp-filter-community:egress in the export chain for the egress settings.
A member named at the bgp or group level runs for every peer below it. Ze
refuses a peer whose settings no member runs, and the refusal names the line
to add. The protocol procedures other plugins insert (LLGR, the RFC 9234
roles) always run before these members, so a strip or tag cannot hide a
route from them. Toward every eBGP destination that is not a route-server
client, the plugin itself inserts the RFC 7999 Section 3.1 BLACKHOLE
agreement check; it runs whether or not the operator names any member.
| Leaf | Type | Default | Meaning |
|---|---|---|---|
relation-tag |
boolean | false |
Write the RFC 8195 Section 3.2 relation-to-origin large community on each route this peer sends. |
relation-function |
uint32 | 3 |
Function number of that large community. RFC 8195 leaves the number to each AS and gives 3 as its example. |
scrub-own-ga |
boolean | false |
Remove inbound communities whose Global Administrator is the local AS. RFC 7454 Section 11. |
scrub-keep-function |
leaf-list (uint32) | empty | Function numbers a peer is allowed to send with the local AS as the Global Administrator. |
blackhole-propagation |
enum | none |
Add no-export or no-advertise to a route that carries BLACKHOLE. RFC 7999 Section 3.2. |
bgp {
router-id 192.0.2.1;
session {
asn {
local 65000;
}
}
group customers {
filter {
import {
filters [ bgp-filter-community:ingress bgp-filter-community:relation ];
final accept;
}
ingress {
community {
scrub-own-ga true;
scrub-keep-function [ 100 200 ];
relation-tag true;
blackhole-propagation no-export;
}
}
}
}
}
The four steps run in one fixed order on each received route: the named strip
sets, then the scrub, then the blackhole guard, then the named tag sets. The
order is load-bearing. The guard adds a well-known community, so a scrub running
after it would delete what it just added.
The scrub is a keep-list, not a denylist. RFC 7454 Section 11 asks an
operator to scrub inbound communities carrying their own AS number and to allow
only the ones customers and peers use for signaling. An empty
scrub-keep-function list therefore keeps nothing. It does not mean "keep
everything". The scrub covers standard and large communities, and it runs on
eBGP sessions only: on an iBGP session an own-AS value is this network's own
signal to itself. Well-known communities are never reached, so NO_EXPORT,
NO_ADVERTISE and BLACKHOLE always survive. On a session with rs-client true, the scrub keeps the route-server control communities the client sends
to the route server: RS:X and RS:0 in the standard form, and
RS:101:X to RS:103:X in the large form (see "Route-server control
communities" below). They are the signalling Section 11 tells you to allow, and
the route server reads them after the ingress filters, so scrubbing them would
silently cancel every announce, do-not-announce and prepend request. The route
server removes them before any client receives the route. RS is the route
server's AS: the router's global session asn local, never a per-peer
local-as override, because that is the AS the route server reads and removes
them by. On a client session with a local-as override the scrub's own AS is the
override, so a value under it shaped like a control is no request the route
server reads, and it is scrubbed. The real controls carry the global AS and are
outside the scrub's reach. Every other own-AS value from that client is still
scrubbed. The relation-function number is
never kept, whatever the list says, because a kept relation function would let a
peer state its own relation to this AS.
The relation tag reads the resolved peer role. The parameter says what the
peer IS to this AS: 2 for a customer, 3 for a peer, 4 for a provider. It comes
from the role the bgp-role plugin resolved, which prefers a Role capability the
peer announced over the local configuration. A session whose role does not
resolve gets no tag. An iBGP session gets none, because its sender is inside the
local AS. A route-server or route-server-client session gets none, because RFC
7947 requires transparency there. The value is a large community
<local-AS>:<function>:<parameter>. Any own-AS large community already carrying
that function number is removed first, so a peer cannot state its own relation to
you.
The blackhole guard adds a community. It does not discard traffic. RFC 7999
Section 3.2 asks a receiver to stop a BLACKHOLE-tagged prefix propagating outside
the local AS, and leaves the choice between NO_EXPORT and NO_ADVERTISE to the
operator. Discarding the traffic is a different feature: see blackhole
honoring. RFC 7999 Section 3.1
makes ignoring the community conformant, so none is a supported state.
A received BLACKHOLE route reaches an eBGP peer only if that peer agreed.
RFC 7999 Section 3.1: "In a bilateral peering relationship, use of the BLACKHOLE
community MUST be agreed upon by the two networks before advertising it." The
agreement is the peer's blackhole container listing blackhole (65535:666).
On egress, a route carrying BLACKHOLE is withheld from an eBGP peer whose
container does not list it, and when the peer held an earlier generation of the
route it is withdrawn. iBGP sessions (an RFC 7705 migration session included)
and route-server clients still receive it: an iBGP session is one network, and
Section 3.1 hands the multilateral case to the operator's policy. A reload that
changes a blackhole container takes effect on the next UPDATE of the route;
it does not re-judge what a peer already holds.
Suppressing communities on egress
session { community { send ... } } selects which community attribute types
leave on a session. The list takes standard, large, extended, all, or
none. Unset is all.
bgp {
router-id 192.0.2.1
session {
asn {
local 65000
}
}
peer transit-a {
session { community { send [ standard ]; } }
}
}
A type that is not selected is removed from every UPDATE sent to that peer, on
both forward rails. Two attributes are the exception and they are refused out
loud rather than silently: OTC (RFC 9234 Section 5) and ORIGINATOR_ID (RFC
4456 Section 8) must be preserved unchanged once set, so a suppression of either
is logged and not applied.
Route-server control communities
When ze runs as a route server, a client can steer its own routes by tagging them with communities the route server reads and then removes. A peer becomes a route-server client with rs-client true under its session block; the communities below are only interpreted for such peers.
| Community | Meaning |
|---|---|
0:<asn> |
Do not advertise this route to <asn>. |
<rs-asn>:<asn> |
Advertise this route ONLY to the listed ASNs. |
<rs-asn>:0 |
Do not advertise this route to any client. |
<rs-asn>:101:<asn> |
Large community. Prepend the route server's ASN once to the AS_PATH sent to <asn>. |
<rs-asn>:102:<asn>, <rs-asn>:103:<asn> |
Large community. The same, two or three times. |
A whitelist wins over a blacklist: if a route carries any <rs-asn>:<asn> tag, only the listed ASNs receive it and 0:<asn> tags on the same route are not consulted.
A prepend request whose <asn> is 0 applies to every client. When a route carries a request for a client and one for every client, the client's own wins; when it carries two for the same client, the larger count wins.
Without a prepend request a client receives the AS_PATH exactly as the route server received it, as RFC 7947 Section 2.2.2.1 recommends. That section makes the rule a SHOULD NOT rather than a MUST NOT only to stay compatible with older clients that still reject a route whose first AS is not the route server's. A route that carries the request is its sender asking for the change, so the prepend is applied only to such a route, and only toward the client it names.
These are control tags, not attributes to pass on. The route server strips every one of them from the route before forwarding it, and with them every large community whose first field (the Global Administrator) is its own ASN, whatever the other two fields hold, so a client never sees another client's steering instructions or the route server's own. A route carrying several control communities has all of them removed, not the first one. Communities the route server does not recognise are forwarded untouched and in their original order, so a client's own tagging survives.
65535:666 is NOT one of these. RFC 7999 BLACKHOLE steers no route-server forwarding and is never stripped, so a client's blackhole request reaches the other clients as the client wrote it. Ze's own answer to a received BLACKHOLE is the per-session blackhole container and the ingress blackhole-propagation leaf, both above.
# Client tags a route: keep it away from AS 64998, and let AS 65002 have it.
# The route server removes both tags; 65001:100 reaches AS 65002 unchanged.
community [ 0:64998 65000:65002 65001:100 ]
A control community decides about a ROUTE, not about a MESSAGE. One UPDATE can carry withdrawn routes and an announcement together. The withdrawn routes carry no attribute and were tagged by nobody, so a client the announcement excludes still receives the withdrawals in that UPDATE. Without that, an excluded client would keep a prefix an earlier UPDATE did advertise to it, and ze could not take it back until the session reset.
Two limits are worth knowing:
- A standard community's high half is 16 bits (RFC 1997), so a route server with a 4-octet ASN matches
<rs-asn>:<asn>on the low 16 bits of its ASN only. Large communities match the full ASN, but only the prepend requests have a large form today: there is no large-community spelling of0:<asn>,<rs-asn>:<asn>or<rs-asn>:0. - Stripping is ze's own forwarding behaviour. RFC 7947 expects per-client import and export policy but prescribes no mechanism for it (Section 2.3.2.1 offers per-client RIBs as "the most portable method"), so a different route-server implementation may leave these tags in place.
Behaviour change: earlier versions of ze read the prepend requests and then ignored them, and forwarded the route server's large communities to every client. A route that carries a prepend request now has the prepend applied, which changes path selection at the client it names, and a client policy that matched the route server's large communities no longer sees them.
ze_bgp_attr_mod_remove_buffer_refused_total{attribute} counts removal buffers a
handler refused because they were not a whole number of wire values. The refusal
is silent on the wire, so a non-zero value is the one signal that a producer is
violating the arity contract and that an attribute went out unchanged.
Redistribution
The top-level redistribute block moves selected routes between protocol RIBs. Redistribution is separate from ordinary per-peer BGP filtering, but the resulting routes still pass through the destination protocol's policy and loop-prevention rules.
Use named destinations and specify the source protocols deliberately. Avoid broad two-way redistribution unless the topology and loop controls have been proven. Connected, static, kernel, OSPF, IS-IS, and BGP route sources have different ownership and withdrawal behaviour.
See Route filters and redistribution for the current chain rules and configuration syntax.
Verify policy
show policy chain peer <selector> [import|export] reports each effective direction as an object containing
filters and final, including a configured direction with no filters.
Peer detail reports the same policy under import-policy and export-policy,
and show policy test reports it under policy. The final is the one the
session applies when the chain ends:
| Policy and session | final |
final-source |
|---|---|---|
| Configured policy | the configured accept or reject |
omitted |
| ✕ | reject |
rfc8212 |
| ✕ | omitted; the direction is omitted when it has no automatic filters | omitted |
| ✕ | undetermined |
omitted |
final-source: rfc8212 marks the reject RFC 8212 Section 3 applies to an EBGP
direction nobody configured, so it never reads as a reject you wrote. Add
final accept (or a filter chain) to that direction to let routes through.
A dynamic peer's session type is known only once its OPEN arrives, so its
absent direction stays undetermined until then.
When an EBGP session reaches Established, Ze logs one warning for each direction RFC 8212 closes on it. The warning names the peer, the direction, and the editor command that adds an explicit policy at the level where the peer is configured:
level=WARN msg="RFC 8212: this EBGP peer has no import policy, so Ze uses none of the routes it receives from it" subsystem=bgp.reactor.peer peer=transit-a address=192.0.2.1 direction=import fix="set bgp peer transit-a filter import final accept" then="commit now"
level=WARN msg="RFC 8212: this EBGP peer has no export policy, so Ze sends it no routes" subsystem=bgp.reactor.peer peer=transit-a address=192.0.2.1 direction=export fix="set bgp peer transit-a filter export final accept" then="commit now"
A peer in a group gets set bgp group <group> peer <name> .... A dynamic peer
gets set bgp group <group> ..., because it exists only through its group.
final accept passes every route: write the filters you want in front of it,
or use final reject when that direction must stay closed, which also stops
the warning. Every new session warns again while the direction stays absent.
An IBGP session and a configured direction never warn.
ze config validate reports the same directions before the daemon starts,
as warnings with the same words and the same fix command, so a config whose
EBGP sessions would carry nothing is visible without bringing one up
(ze config validate).
Policy dry-run applies the same final: absence rejects on EBGP and
accepts on IBGP. With a rejecting final, a pure withdrawal remains accept with unchanged resulting
text. A mixed announcement and withdrawal reports modify, with only its explicit
withdrawals in the resulting text. A filter execution failure or teardown still
reports reject without resulting text; neither is a successful withdrawal.
A chain that names a library filter instance runs in the dry-run exactly as on
the session, without counting or logging a failure: a member's trace entry
shows what it set in delta (for example local-preference 200), and why it
failed in error. A single-filter override on such a chain runs that one
filter the same way, followed by the policy's final. A filter reading a
session fact (peer-name, peer-as, rs-client, ...) sees the peer you
named, on import as the sender and on export as the destination. The pasted
UPDATE came from no peer, so on export the source-* facts are absent, and
a metadata set on import lasts only for the test.
The dry-run covers the per-peer external-policy stage, not the full ingress
protocol pipeline. An active named in-process check appears in trace with
action: not-evaluated and empty text-after; it is not an accepting filter
invocation. The overall action describes the external-policy stage and its
final only, not whether that unevaluated guard would pass on a live session.
A single-filter override selecting an in-process check is refused with an
explanation; exercise it with an UPDATE on the peer session instead. Inactive
references do not execute and have no trace entry.
When the remote AS is unresolved, the overall action is undetermined and
reason tells you to wait for establishment and repeat show policy test.
policy still reports the direction, with undetermined for an absent final.
No filter executes, including a single-filter override. Trace and text are empty.
Use the same route at each boundary:
ze cli -c "show bgp rib peer transit-a"
ze cli -c "show bgp rib best"
ze cli -c "show bgp irr check peer transit-a prefix 192.0.2.0/24"
ze cli -c "show bgp peer transit-b rib"
Confirm:
- The route is present or absent at the expected import boundary.
- The best-path result carries the intended local attributes.
- Exported attributes match the destination peer's policy.
- A rejected route does not reappear through redistribution.
- A policy reload completes without warnings or partial application.