Repository navigation
loop
Pre-Alpha. This page describes behavior that may change.
Route loop detection ingress filter per RFC 4271 Section 9 and RFC 4456 Section 8. Silently discards incoming UPDATE messages that indicate a routing loop.
Core.
Loop detection always runs on every received UPDATE with sensible defaults (AS-loop rejects on first match, cluster-id equals router-id). No configuration is needed to get RFC-compliant behaviour.
To tune it (for example to allow your own ASN to appear in AS_PATH a few times for AS-confederation members, or to use a cluster-id different from the router-id), define a loop-detection filter instance under the top-level policy root:
policy {
loop-detection no-self-as {
allow-own-as 0;
cluster-id 10.0.0.254;
}
}
The instance name is auto-populated at the front of every peer's import filter chain and can be suppressed on a specific peer with inactive:<name> or the CLI editor deactivate verb. See route filters for the chain mechanics and the loop-detection filter type reference for the leaves.
The plain no-self-as, type-qualified loop-detection:no-self-as, and canonical
loop:no-self-as forms select the same configured instance. Its canonical
reference remains visible in the policy, but runs only through the registered
protocol-stage hook, not through an external plugin named after the instance.
Automatic references do not create an operator final decision or an export
policy. Static peers and dynamic group templates use the same binding.
They do not bypass RFC 8212: without explicit operator policy, EBGP rejects
routes in that direction. IBGP keeps its accepting default.
An active named internal reference on export is refused because no named
export execution is provided. The refusal prints the original configuration
location and an exact deactivate ... filter export filters <reference> command.
In the configuration editor, run the printed top, deactivate, and commit now
commands. They use the reference's original spelling, quoting identifiers when
needed. An inherited global or group reference must be corrected at that layer,
not at the affected peer. Deactivation retains the member and leaves other
filters and the final unchanged; removing the original reference is also valid.
show policy test evaluates the external policy stage, not this protocol hook.
Its trace marks an active loop reference not-evaluated, without claiming that
it passed. A single-filter override selecting the loop check is refused; use an
UPDATE on the peer session to exercise the check.
The filter walks the path attributes of each incoming UPDATE once and performs three checks:
-
AS loop (all sessions, RFC 4271 S9): if the local ASN appears in the AS_PATH attribute (AS_SEQUENCE or AS_SET segments) more than
allow-own-astimes, the route is rejected.allow-own-asdefaults to 0 (reject on the first occurrence). - Originator-ID loop (iBGP only, RFC 4456 S8): if the ORIGINATOR_ID attribute matches the local Router ID, the route is rejected.
-
Cluster-list loop (iBGP only, RFC 4456 S8): if the cluster ID (from
loop-detection/cluster-idorsession/cluster-id, defaulting to the router-id) appears in the CLUSTER_LIST attribute, the route is rejected.
The filter operates directly on the wire-format UPDATE payload with zero-copy attribute iteration. Rejected routes are logged at debug level and silently dropped before reaching the decision process.
session/cluster-id and loop-detection/cluster-id are kept in sync automatically (RFC 4456 egress and ingress must use the same value), so setting either one at any level propagates to the other.
- Runs as a protocol-stage ingress filter inside the BGP reactor. It is part of the filter chain that every received UPDATE passes through before route selection.
- Exposed to config as the built-in
loop-detectionfilter type under the top-levelpolicyroot. See route filters. - No dependencies on other plugins. The filter is self-contained and stateless.
- Works with 2-byte and 4-byte ASN encodings depending on the peer's capability negotiation.
main/internal/component/bgp/reactor/filter/
Unreviewed draft. This wiki was authored in bulk and has not been reviewed. File corrections on the issue tracker.
- Install
- Docker
- netlab
- Appliance
- Quick Start
- Use Ze with an AI agent
- ExaBGP Migration
- CLI Tour
- Web UI Tour
- Overview
- YANG Model
- Editor Workflow
- Archive and Rollback
- Backup and Restore
- 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
- Path MTU
- TACACS+ AAA
- RADIUS AAA
- AS112 DNS
- DNS
- Authorization
- Fleet
- BGP
- Starting and Stopping
- Show Commands
- Monitoring
- Telemetry
- 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
- Link State
- 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