Status page: routes in order of selection, lookup by origin AS

Received routes are listed from the best down: the RIB gains ranked_routes,
which runs selection again without the winners, so the second route is the
one that would be installed were the best withdrawn. The API gives each
route its rank, and the page shows it as a numbered badge after the star.

The lookup box moves to the received-routes table, which is what it filters,
and takes an AS number: a new `origin` query parameter finds every route
whose path ends in that AS, with an empty path counting as the local AS.

Long cells are clamped to a few lines with a control to open them, and an
AS repeated along a path (prepending) is shown once with a ×N badge. Peer
names are bold and dark, not underlined links, so a row can be found by
its name among the addresses and numbers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Rayhaan JaufeerallyandClaude Fable 5.1 committed 2026-10-07 22:09:07 +02:00
1 parent 1ce7eef27e
commit 35ce2e2e57
9 files changed
+370 -66

No files matched your search

+13 -6
View File
@@ -35,7 +35,6 @@ the RPKI state.
Below the status line, the page displays the following information:
- A lookup of received routes, by prefix, address, or neighbor name.
- The configuration that was read at startup.
- Each neighbor, with its session state, time established, next hop,
session properties, number of accepted routes, rejected announcements,
@@ -47,7 +46,9 @@ Below the status line, the page displays the following information:
- Kernel route installation: the number of installed routes, the number of
routes not installed and the reason, the last error reported by the
kernel, and the interfaces.
- The received routes that match the lookup, best path first.
- The received routes, in order of path selection, with a lookup by prefix, address,
origin AS, or neighbor name. The lookup is above the table that it
filters.
- Rejected routes, by neighbor, with the number of rejections for each
reason, and the most recent rejected routes. Rejections of the same
prefix for the same reason by the same AS path are displayed as one row
@@ -72,10 +73,15 @@ them. Point to a glyph to display its meaning.
| `AP↓`, `AP↑` | ADD-PATH: several paths per prefix are received, or sent. |
| `2B` | The neighbor supports two-octet AS numbers only. |
| `↑`, `↓`, `↔`, `RS`, `RSC`, `iBGP` | The role of the neighbor: provider, customer, peer, route server, route server client, or a router of the local AS. |
| `★` | The best path for the prefix. |
| `★`, `2`, `3`, … | The position of the route in path selection: the best path, the path that would be selected if the best path were withdrawn, and so on. |
| `×N` | After an AS number in an AS path: the AS appears N times in a row (prepending). |
| `OTC`, `AA`, `AGG`, `AS4`, `OID`, `CL`, `EXT` | Path attributes without a column of their own: Only to Customer, ATOMIC_AGGREGATE, AGGREGATOR, AS4_PATH, ORIGINATOR_ID, CLUSTER_LIST, and extended communities. |
| `✓`, `✗`, `–` | RPKI or ASPA validation state: valid, invalid, or not found. |
An AS path or a list of communities that runs to more than a few lines is
displayed shortened, with a **more** control. Click the control, or
double-click the cell, to display the whole value.
Communities for which `community_names` specifies a name are displayed as
a badge with that name; the community itself is displayed when you point
to the badge. Communities of the local AS that are control communities
@@ -95,10 +101,11 @@ parameters.
| Parameter | Result |
|---|---|
| `prefix=193.0.0.0/21` | All routes for the prefix, best path first |
| `prefix=193.0.0.0/21` | All routes for the prefix, in order of path selection |
| `address=193.0.0.1` | All prefixes that contain the address, most specific first |
| `within=193.0.0.0/16` | The prefix and all more specific prefixes |
| `peer=NAME` | Only routes from the neighbor, identified by name or address |
| `origin=AS64496` | Only routes originated by the AS, the last AS of the AS path. Routes with an empty AS path are originated by the local AS. |
| `best=true` | Only the best path for each prefix |
| `limit=N` | At most N routes. Default: 1000. Maximum: 100000. |
@@ -110,8 +117,8 @@ curl -s '127.0.0.1:8080/api/routes/received?address=193.0.0.1&best=true' | jq
```
> [!NOTE]
> The `within`, `peer`, and `best` parameters, when used without `prefix`
> or `address`, scan the entire routing table. With a full routing table,
> The `within`, `peer`, `origin`, and `best` parameters, when used without
> `prefix` or `address`, scan the entire routing table. With a full routing table,
> such a query takes noticeably longer.
## Rejected Routes
+4 -1
View File
@@ -97,10 +97,11 @@ lists the query parameters.
| Parameter | Description |
|---|---|
| `prefix` | Returns all routes for the prefix, best path first. Example: `prefix=193.0.0.0/21`. |
| `prefix` | Returns all routes for the prefix, in order of path selection. Example: `prefix=193.0.0.0/21`. |
| `address` | Returns all routes for the prefixes that contain the address, most specific first. Example: `address=193.0.0.1`. |
| `within` | Returns the routes for the prefix and all more specific prefixes. Example: `within=193.0.0.0/16`. |
| `peer` | Returns only routes from the neighbor, identified by name or address. |
| `origin` | Returns only routes originated by the AS: the last AS of the AS path. The value is a number, with or without the prefix `AS`. Routes with an empty AS path are originated by the local AS. Example: `origin=AS64496`. |
| `best` | If `true`, returns only the best path for each prefix. |
| `limit` | Specifies the approximate number of routes in a page. Default: 1000. Maximum: 100000. |
| `after` | Returns the page after the specified prefix. Use the `next_after` value of the previous page. |
@@ -119,6 +120,7 @@ Prefixes are sorted by address, with IPv4 prefixes first.
"prefix": "203.0.113.0/24",
"path_id": 0,
"best": true,
"rank": 1,
"stale": false,
"rpki": null,
"aspa": null,
@@ -143,6 +145,7 @@ Prefixes are sorted by address, with IPv4 prefixes first.
|---|---|
| `path_id` | ADD-PATH path identifier, or 0. |
| `best` | Whether the route is the best path for the prefix. |
| `rank` | The position of the route in path selection for the prefix: 1 for the best path, 2 for the path that would be selected if the best path were withdrawn, and so on. |
| `stale` | Whether the route is retained from a previous session of the neighbor and has not been advertised again (graceful restart). |
| `rpki`, `aspa` | Route origin validation and ASPA verification state, if RPKI validation is configured. |
| `summary` | The path attributes as text. `other` lists, in received order, the attributes that have no field of their own: atomic aggregate, aggregator, extended communities, AS4_PATH, only to customer, originator ID, cluster list, and unrecognized attributes. |