show ip route: the candidate-default asterisk belongs to the prefix, not to one row #1737

Merged
jaylouisw merged 1 commit from rev/1116-2130 into main 2026-11-16 21:46:12 +00:00
Owner

Question. What does the asterisk in show ip route mark - the installed default, the route that lost to it, or every route to 0.0.0.0/0?

Verdict. It marks a candidate default and belongs to the prefix. Cisco doc 16448 prints a typed ip route 0.0.0.0 0.0.0.0 10.108.99.2 as S* 0.0.0.0/0 [1/0] via 10.108.99.2, and the same page prints two starred candidates in one table (S* 0.0.0.0/0 and S* 192.168.1.0/24). Learned defaults carry it too (D*EX 0.0.0.0/0, O*E2 0.0.0.0/0).

PacketForge had it inverted: the star sat on the invented distance-254 gateway row, while a typed static default printed as a plain S.

Changed

  • engine/device.js: row.candidateDefault derived from 0.0.0.0/0; displayCode = code + "*" for those rows. Both defaults keep their distance ([1/0] vs [254/0]), which is what separates two routes.
  • engine/cli.js: legend now ends , * - candidate default - the table had printed S* since #1407 while defining only C, S, O and B.
  • New test/route-candidate-default.test.js (21 checks); show-ip-route, routes-agreement, show-ip-route-host-table, ospf-route-metric updated where they pinned the old inversion.
  • research/show-ip-route-candidate-default.md records the sources and what stays open (the invented badge row; ip default-network; unmodelled E2/EX suffixes).
  • docs/CLI.md states the rule.

Gates. syntax-check 364 files OK; full npm test 293 suites / 10398 assertions / 0 failed.

**Question.** What does the asterisk in `show ip route` mark - the installed default, the route that lost to it, or every route to `0.0.0.0/0`? **Verdict.** It marks a *candidate* default and belongs to the prefix. Cisco doc 16448 prints a typed `ip route 0.0.0.0 0.0.0.0 10.108.99.2` as `S* 0.0.0.0/0 [1/0] via 10.108.99.2`, and the same page prints **two** starred candidates in one table (`S* 0.0.0.0/0` and `S* 192.168.1.0/24`). Learned defaults carry it too (`D*EX 0.0.0.0/0`, `O*E2 0.0.0.0/0`). PacketForge had it inverted: the star sat on the invented distance-254 gateway row, while a typed static default printed as a plain `S`. **Changed** - `engine/device.js`: `row.candidateDefault` derived from `0.0.0.0/0`; `displayCode = code + "*"` for those rows. Both defaults keep their distance (`[1/0]` vs `[254/0]`), which is what separates two routes. - `engine/cli.js`: legend now ends `, * - candidate default` - the table had printed `S*` since #1407 while defining only C, S, O and B. - New `test/route-candidate-default.test.js` (21 checks); `show-ip-route`, `routes-agreement`, `show-ip-route-host-table`, `ospf-route-metric` updated where they pinned the old inversion. - `research/show-ip-route-candidate-default.md` records the sources and what stays open (the invented badge row; `ip default-network`; unmodelled `E2`/`EX` suffixes). - `docs/CLI.md` states the rule. **Gates.** syntax-check 364 files OK; full `npm test` 293 suites / 10398 assertions / 0 failed.
show ip route: the candidate-default asterisk belongs to the prefix, not to one row
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 22s
CI / Server smoke test (pull_request) Successful in 19s
CI / Test (Node 20) (pull_request) Successful in 54s
CI / Docker build (pull_request) Successful in 30s
CI / Test (Node 18) (pull_request) Successful in 57s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Arm auto-merge (pull_request) Successful in 4s
452090cf85
The table printed `S*` on the row this engine invents - the configured gateway at distance 254 - and
printed a default an operator actually types, `ip route 0.0.0.0 0.0.0.0 <next hop>`, as a plain `S`.

That is the reverse of the device. On IOS the asterisk marks a route as a *candidate* default, and it
belongs to the prefix: Cisco's gateway-of-last-resort note prints a typed default as
`S* 0.0.0.0/0 [1/0] via 10.108.99.2`, and the same note prints two starred candidates in one table
(`S* 0.0.0.0/0` and `S* 192.168.1.0/24`), so the star is neither a one-per-box title nor a mark for
the losing route. Learned defaults carry it too (`D*EX 0.0.0.0/0`, `O*E2 0.0.0.0/0`).

`routesTable()` now derives the mark from the prefix (`candidateDefault`), so every 0.0.0.0/0 row is
starred with its own code and nothing else is. Two defaults remain distinguishable by what separates
any two routes: the distance in the brackets ([1/0] against [254/0]).

The legend also defines the mark now: it had been printing `S*` since #1407 while listing only C, S, O
and B, so the one code the table used was the one a reader could not look up.

Evidence and the open ends (the invented distance-254 gateway row; `ip default-network`, which stars a
non-zero network; the unmodelled `E2`/`EX` suffixes) are in research/show-ip-route-candidate-default.md.

Tests: new test/route-candidate-default.test.js (21); show-ip-route, routes-agreement, host-table and
ospf-route-metric updated where they pinned the old inversion. Full suite 293 suites / 10398
assertions / 0 failed; syntax-check 364 files OK.
jaylouisw force-pushed rev/1116-2130 from 452090cf85
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 22s
CI / Server smoke test (pull_request) Successful in 19s
CI / Test (Node 20) (pull_request) Successful in 54s
CI / Docker build (pull_request) Successful in 30s
CI / Test (Node 18) (pull_request) Successful in 57s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Arm auto-merge (pull_request) Successful in 4s
to 77615f58e7
All checks were successful
CI / Classify the change (pull_request) Successful in 15s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 17s
CI / Server smoke test (pull_request) Successful in 24s
CI / Test (Node 20) (pull_request) Successful in 59s
CI / Docker build (pull_request) Successful in 29s
CI / Test (Node 18) (pull_request) Successful in 1m2s
CI / Test (Node 22) (pull_request) Successful in 1m3s
CI / Arm auto-merge (pull_request) Successful in 16s
2026-11-16 21:43:42 +00:00
Compare
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1737
No description provided.