-
Notifications
You must be signed in to change notification settings - Fork 3
bgp role
Pre-Alpha. This page describes behavior that may change.
RFC 9234 BGP Role enforcement. Stamps the OTC attribute on eligible egress updates and rejects routes that arrive carrying OTC from a non-customer direction.
Policy.
The plugin activates per peer when a role { import <role> } declaration is present.
bgp {
peer upstream {
role {
import customer;
strict true;
}
}
}
Full configuration reference on the BGP Role configuration page.
The plugin is registered as a mandatory filter that runs on both ingress and egress for peers with a declared role. On ingress, it checks the OTC attribute against the peer's role and marks the route as a leak if OTC is present when the peer is a customer or route-server-client. On egress, it stamps OTC with the local ASN when the destination peer is a customer, route-server-client, or peer AND the UPDATE advertises a route.
The RFC 9234 Section 5 procedures act on what the PEER is to Ze. That value comes from the Role capability in the peer's OPEN when the peer sent one, and from the complement of the local import role when it did not. RFC 9234 Section 4.2 prescribes the second: "The locally configured BGP Role is used for the procedures described in Section 5." An empty capability value used to select the permissive branch of every Section 5 gate, so a capability-less peer skipped all three ingress rules and both egress rules.
OTC processing is bounded to IPv4 and IPv6 unicast, and to an UPDATE that advertises a route. A withdraw-only UPDATE, an MP_UNREACH-only UPDATE and an End-of-RIB marker are forwarded untouched, because adding an attribute to one produces a message RFC 4271 Section 4.3 forbids.
A peer created from a dynamic group resolves its role through its group, so the Section 5 gates, the Section 4.2 OPEN pair check, strict mode and the advertised Role capability all reach a member.
With strict true, the plugin requires the remote peer to advertise the Role capability in its OPEN. A peer that does not advertise Role gets a Role Mismatch NOTIFICATION (code 2, subcode 11) and the session is rejected. With strict false (the default), the session proceeds and OTC filtering is applied based on the locally configured role.
Every drop is counted, and the first drop of each reason raises a warning naming the peer. Later drops are counted only, with per-route detail at debug level.
| Metric | Reason labels |
|---|---|
ze_role_route_rejects_total |
leak, malformed-otc
|
ze_role_route_suppressions_total |
otc-present, source-role, export-set, role-unrecorded
|
Six series per metric, bounded. Peer identity is in the log line, never in a label.
- Runs as a filter in the redistribution chain. Mandatory: cannot be overridden.
- Reads and writes the OTC attribute (type 35) through the egress
ModAccumulator.
main/internal/component/bgp/plugins/role/
Unreviewed draft. This wiki was authored in bulk and has not been reviewed. File corrections on the issue tracker.
- Overview
- YANG Model
- Editor Workflow
- Archive and Rollback
- System
- Interfaces
- VRRP
- BFD
- FIB
- OSPF
- IS-IS
- MPLS / LDP / RSVP-TE
- RSVP-TE
- SRv6
- Static Routes
- Policy Routing
- Firewall
- Traffic Control
- Class of Service
- L2TP/PPP
- PPPoE
- VPP Data Plane
- RPKI
- IPsec VPN
- TACACS+ AAA
- RADIUS AAA
- AS112 DNS
- DNS
- Authorization
- Fleet
- BGP
- Starting and Stopping
- Show Commands
- Monitoring
- Flow Export
- DDoS Mitigation
- Anomaly Detection
- Health Checks
- Audit Trail
- Production Diagnostics
- Logging
- Operational Reports
- Healthcheck
- Self-Update
- Zero-Touch Provisioning
- MRT Analysis
- Upgrade and Restart
- Storage
- Policy
- Core
- Resilience
- Validation
- Capabilities
- Address Families
- Protocol
- Subsystems
- Infrastructure
- Route Server at an IXP
- Transit Edge with RPKI
- Public Looking Glass
- ExaBGP Migration Walkthrough
- FlowSpec Injection
- Chaos-Tested Peering
- AS Path Topology