cli: show access-lists numbers each line from 10, four columns in #1717

Merged
jaylouisw merged 1 commit from rev/1116-1900 into main 2026-11-16 19:46:35 +00:00
Owner

What a box prints down the left of show access-lists

The table printed 1, 2, 3 — an array index, two spaces in from the margin. A box prints the
entry's sequence number, four columns in:

Extended IP access list 101
    10 deny icmp any any (5 matches)
    20 permit ip any any

Evidence

Source Says
Cisco IOS XE, IP Access List Entry Sequence Numbering "the first entry is assigned a sequence number of 10, and successive entries are incremented by 10"
Cisco, Configure IP Access Lists (23602) a list typed without numbers displays 10 permit tcp any any / 20 permit udp any any
Catalyst 3560 guide 12.2(25)SEA legacy access-list 2 deny host … still displays 10 / 20
ntc-templates real captures: show_access-list.raw, show_access-list3.raw four columns of indent; tens by default; hand-typed 16, 17, 9999 kept

What changed

  • engine/acl.js — numberedEntries(acl): the lines in evaluation order, each with the sequence a box would
    show (its own, else 10/20/30 by the position it was typed at). sortAcl() is now that helper with the
    numbers dropped, so display order and first-match order cannot drift apart.
  • engine/cli.js — prints ' ' + seq + ' ' + body; a sequence typed inside the line (10 permit ip any any) is printed once; the match counter is still keyed by the text as typed.
  • docs/CLI.md — the sample and the rule, with the citation.
  • test/show-access-lists-numbering.test.js — 16 checks, including that a line numbered 5 is printed and
    tested
    before one numbered 10.
  • research/show-access-lists-numbering.md — the evidence, and the one thing left unresolved.

Left unresolved (deliberately, not guessed)

Whether deny is padded to align with permit. The captures disagree: a real standard list prints
20 deny any log (three spaces) while the same capture's extended lists print 30 deny ip … (one space);
the 3560 guide's standard list shows one space; one fixture has no indent at all. Nothing was changed there.

Gates

node scripts/syntax-check.js — 357 files, all OK. Full suite, serial: 286 suites, 10,276 assertions, 0
failed
. Related suites individually: show-access-lists 23, show-access-lists-numbering 16, acl-data 21,
show-ip-spellings 70, help-completeness 8, show-argument-refusal 77, config-undo 47, interface-drops 39,
interface-counters 29 — all passing.

## What a box prints down the left of `show access-lists` The table printed ` 1`, ` 2`, ` 3` — an array index, two spaces in from the margin. A box prints the entry's **sequence number**, four columns in: ``` Extended IP access list 101 10 deny icmp any any (5 matches) 20 permit ip any any ``` ## Evidence | Source | Says | | --- | --- | | [Cisco IOS XE, *IP Access List Entry Sequence Numbering*](https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/sec_data_acl/configuration/xe-16-11/sec-data-acl-xe-16-11-book/sec-acl-seq-num.pdf) | "the first entry is assigned a sequence number of 10, and successive entries are incremented by 10" | | [Cisco, *Configure IP Access Lists* (23602)](https://www.cisco.com/c/en/us/support/docs/security/ios-firewall/23602-confaccesslists.html) | a list typed without numbers displays ` 10 permit tcp any any` / ` 20 permit udp any any` | | [Catalyst 3560 guide 12.2(25)SEA](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3560/software/release/12-2_25_sea/configuration/guide/3560scg/swacl.pdf) | legacy `access-list 2 deny host …` still displays `10` / `20` | | ntc-templates real captures: [`show_access-list.raw`](https://raw.githubusercontent.com/networktocode/ntc-templates/master/tests/cisco_ios/show_access-list/cisco_ios_show_access-list.raw), [`show_access-list3.raw`](https://raw.githubusercontent.com/networktocode/ntc-templates/master/tests/cisco_ios/show_access-list/cisco_ios_show_access-list3.raw) | four columns of indent; tens by default; hand-typed `16`, `17`, `9999` kept | ## What changed * `engine/acl.js` — `numberedEntries(acl)`: the lines in evaluation order, each with the sequence a box would show (its own, else 10/20/30 by the position it was *typed* at). `sortAcl()` is now that helper with the numbers dropped, so display order and first-match order cannot drift apart. * `engine/cli.js` — prints `' ' + seq + ' ' + body`; a sequence typed inside the line (`10 permit ip any any`) is printed once; the match counter is still keyed by the text as typed. * `docs/CLI.md` — the sample and the rule, with the citation. * `test/show-access-lists-numbering.test.js` — 16 checks, including that a line numbered 5 is printed **and tested** before one numbered 10. * `research/show-access-lists-numbering.md` — the evidence, and the one thing left unresolved. ## Left unresolved (deliberately, not guessed) Whether `deny` is padded to align with `permit`. The captures disagree: a real standard list prints `20 deny any log` (three spaces) while the same capture's extended lists print `30 deny ip …` (one space); the 3560 guide's standard list shows one space; one fixture has no indent at all. Nothing was changed there. ## Gates `node scripts/syntax-check.js` — 357 files, all OK. Full suite, serial: **286 suites, 10,276 assertions, 0 failed**. Related suites individually: show-access-lists 23, show-access-lists-numbering 16, acl-data 21, show-ip-spellings 70, help-completeness 8, show-argument-refusal 77, config-undo 47, interface-drops 39, interface-counters 29 — all passing.
cli: show access-lists numbers each line from 10, four columns in
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 21s
CI / Server smoke test (pull_request) Successful in 19s
CI / Test (Node 20) (pull_request) Successful in 52s
CI / Test (Node 18) (pull_request) Successful in 57s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Docker build (pull_request) Successful in 49s
bd67c40eb6
The table printed "  1", "  2", "  3" - an array index, two spaces in from the margin. A box prints the
entry's sequence number four columns in: "if entries with no sequence numbers are applied, the first entry
is assigned a sequence number of 10, and successive entries are incremented by 10" (Cisco IOS XE, IP Access
List Entry Sequence Numbering). A reader comparing the simulator with a real box found a column of numbers
no box can produce, and could not name the line to change.

numberedEntries() in engine/acl.js now yields the lines in evaluation order, each with the sequence a box
would show - the entry's own where it was given one, otherwise 10/20/30 by the position it was typed at -
and sortAcl() is that helper with the numbers dropped, so the display order and the match order cannot
drift. A sequence typed inside the line ("10 permit ip any any") is printed once, and the match counter is
still keyed by the text as typed.

Evidence, and the padding question left unresolved: research/show-access-lists-numbering.md.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-16 19:46:22 +00:00
jaylouisw force-pushed rev/1116-1900 from bd67c40eb6
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 21s
CI / Server smoke test (pull_request) Successful in 19s
CI / Test (Node 20) (pull_request) Successful in 52s
CI / Test (Node 18) (pull_request) Successful in 57s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Docker build (pull_request) Successful in 49s
to e787c61e57
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 15s
CI / Test (Node 18) (pull_request) Has been skipped
CI / Test (Node 20) (pull_request) Has been skipped
CI / Test (Node 22) (pull_request) Has been skipped
CI / Server smoke test (pull_request) Has been skipped
CI / Docker build (pull_request) Has been skipped
2026-11-16 19:46:25 +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!1717
No description provided.