Passive peers: configured, and left to connect

A session could only be configured for a peer we would then dial, every
few seconds to two minutes, for as long as it was not up. A new peer
whose side was not ready yet filled the log with failed attempts, and a
peer that opens its sessions itself was dialled for nothing.

A peer with `passive: true` is not dialled. A connection from its address
is taken as for any configured peer, and the session comes up with all
that is configured for it: role, import policy, export limits,
hold-downs. Until then the status page and /api/peers show it as
`Passive`, waiting for the peer to connect; after a session, with how
that session ended, which nothing else would say since nobody dials it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Rayhaan JaufeerallyandClaude Opus 5.5 committed 2026-10-06 00:05:54 +02:00
1 parent 910dd258fb
commit c9751883c4
22 files changed
+178 -8

No files matched your search

+23
View File
@@ -57,6 +57,29 @@ Ferrix rejects a neighbor whose OPEN message contains an AS number other
than `remote_asn`, with the NOTIFICATION message OPEN Message Error / Bad
Peer AS.
### Passive Neighbors
A passive neighbor is a neighbor to which Ferrix does not initiate
connections. Ferrix accepts connections from the neighbor's address and
establishes the session with the configured settings when the neighbor
connects. Use a passive neighbor to configure a session before the
neighbor's side is ready, or when the neighbor initiates the connections:
```textproto
peers {
name: "new-peer"
endpoint { address: "192.0.2.10" }
remote_asn: 64510
role: PEER
passive: true
}
```
Until the neighbor connects, the status page and `/api/peers` show the
state `Passive`. After a session ends, they show the reason in the
neighbor's last error. Ferrix does not log connection attempts to a
passive neighbor, because it makes none.
## Inbound Connection Filtering
Ferrix accepts inbound connections only from the addresses of configured
@@ -75,6 +75,7 @@ Statements for a BGP neighbor.
| `import` <span class="type">[ImportPolicy](#importpolicy)</span> | Default checks | Specifies the import policy for routes received from the neighbor. |
| `role` <span class="type">[Role](#role)</span> | None | Specifies the BGP role of the neighbor (RFC 9234). Not permitted for IBGP neighbors. Required for every EBGP neighbor if any `export` statement enables `learned_routes`. |
| `require_role` <span class="type">bool</span> | `false` | Rejects the session if the neighbor does not advertise a BGP role. Requires `role`. |
| `passive` <span class="type">bool</span> | `false` | Prevents Ferrix from initiating connections to the neighbor. Ferrix accepts connections from the address of `endpoint`; the port of `endpoint` is not used. See [Passive Neighbors](@/docs/guides/peers.md#passive-neighbors). |
| `export` <span class="type">[ExportPolicy](#exportpolicy)</span> | Top-level `export` | Specifies the export policy for the neighbor. Replaces the top-level `export` statement. |
| `graceful_restart` <span class="type">[GracefulRestart](#gracefulrestart)</span> | Top-level `graceful_restart` | Specifies graceful restart for the neighbor. Each statement that is set replaces the corresponding top-level statement. |
| `route_reflector_client` <span class="type">bool</span> | `false` | Makes the IBGP neighbor a route reflector client: Ferrix advertises to it the routes learned from other IBGP neighbors, and advertises its routes to them. Permitted only for IBGP neighbors. See [Route Reflection](@/docs/guides/passing-routes-on.md#route-reflection). |
+1 -1
View File
@@ -72,7 +72,7 @@ neighbor:
| Field | Description |
|---|---|
| `state` | Session state: `Established`, `Connecting`, `Backoff`, or `Idle`. |
| `state` | Session state: `Established`, `Connecting`, `Backoff`, `Idle`, or `Passive` (a passive neighbor that has no session). |
| `direction` | `inbound` if the neighbor initiated the connection, `outbound` otherwise. |
| `routes` | Number of the neighbor's routes in the routing table. |
| `rejected_routes` | Number of the neighbor's routes rejected by its import policy. |