docs(cli): the NAT static rule takes udp as well as tcp - six spellings, not five #2191

Merged
jaylouisw merged 1 commit from docs/1119-1817 into main 2026-11-19 18:39:06 +00:00
Owner

What was untrue

docs/CLI.md (section Which side of the translation a port is on) said "Five spellings create a rule" and gave one port-forwarding row, ip nat inside source static <local> <global> tcp <port>. The console accepts udp <port> as well, which makes six.

Evidence from the code

  • engine/cli.js:5472 - the usage string is static <local> <global> [tcp|udp <port>].
  • engine/cli.js:5487 - the refusal prints the same [tcp|udp <port>] shape.
  • engine/cli.js:5489 - only a word that is neither tcp nor udp is rejected.

Measured at a console (generic router):

Router-R1(config)#ip nat inside source static 10.0.0.5 203.0.113.5 udp 53
NAT rule added: ip nat inside source static 10.0.0.5 203.0.113.5 udp 53
Router-R1(config)#ip nat inside source static 10.0.0.7 203.0.113.7 icmp 8
% A port forwarding rule needs tcp or udp, not "icmp"

The same rule is printed by show ip nat rules and by show running-config.

docs/SIMULATION.md (section 5.2 table) already documented ip nat inside source static ... [tcp|udp <port>]; only the CLI page was behind. The code's own usage line is the truth here, so the doc moves to it - no code change in this PR.

Change

  • "Five spellings" -> "Six spellings".
  • Added the udp <port> row; both port-forwarding rows now say which protocol they carry.

Guards

  • node scripts/syntax-check.js - 461 files, all OK.
  • test/docs-cli-transcript.test.js - 9 passed / 0 failed (before and after).
  • test/docs-show-commands.test.js - 7 passed / 0 failed (before and after).
  • test/help-completeness.test.js - 8 passed / 0 failed (before and after).
  • test/no-form-help-key.test.js - 81, test/help-key-is-not-a-value.test.js - 40, test/help-key-works-in-every-prompt.test.js - all pass (before and after).

No documented transcript changed, so none needed re-typing.

## What was untrue `docs/CLI.md` (section *Which side of the translation a port is on*) said **"Five spellings create a rule"** and gave one port-forwarding row, `ip nat inside source static <local> <global> tcp <port>`. The console accepts `udp <port>` as well, which makes six. ## Evidence from the code - `engine/cli.js:5472` - the usage string is `static <local> <global> [tcp|udp <port>]`. - `engine/cli.js:5487` - the refusal prints the same `[tcp|udp <port>]` shape. - `engine/cli.js:5489` - only a word that is *neither* `tcp` nor `udp` is rejected. Measured at a console (generic router): ``` Router-R1(config)#ip nat inside source static 10.0.0.5 203.0.113.5 udp 53 NAT rule added: ip nat inside source static 10.0.0.5 203.0.113.5 udp 53 Router-R1(config)#ip nat inside source static 10.0.0.7 203.0.113.7 icmp 8 % A port forwarding rule needs tcp or udp, not "icmp" ``` The same rule is printed by `show ip nat rules` and by `show running-config`. `docs/SIMULATION.md` (section 5.2 table) already documented `ip nat inside source static ... [tcp|udp <port>]`; only the CLI page was behind. The code's own usage line is the truth here, so the doc moves to it - no code change in this PR. ## Change - "Five spellings" -> "Six spellings". - Added the `udp <port>` row; both port-forwarding rows now say which protocol they carry. ## Guards - `node scripts/syntax-check.js` - 461 files, all OK. - `test/docs-cli-transcript.test.js` - 9 passed / 0 failed (before and after). - `test/docs-show-commands.test.js` - 7 passed / 0 failed (before and after). - `test/help-completeness.test.js` - 8 passed / 0 failed (before and after). - `test/no-form-help-key.test.js` - 81, `test/help-key-is-not-a-value.test.js` - 40, `test/help-key-works-in-every-prompt.test.js` - all pass (before and after). No documented transcript changed, so none needed re-typing.
docs(cli): the NAT static rule takes udp as well as tcp - six spellings, not five
All checks were successful
CI / Classify the change (pull_request) Successful in 13s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 10s
CI / Server smoke test (pull_request) Has been skipped
CI / Docker build (pull_request) Has been skipped
CI / Test (Node 20) (pull_request) Successful in 56s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Test (Node 18) (pull_request) Successful in 1m0s
CI / Arm auto-merge (pull_request) Successful in 3s
718de9c399
The table of the rule spellings showed only the TCP port-forwarding form and
counted five. The console accepts both: engine/cli.js:5472 prints the usage as
'static <local> <global> [tcp|udp <port>]' and :5489 rejects only a word that
is neither. Verified at a console - 'ip nat inside source static 10.0.0.5
203.0.113.5 udp 53' answers 'NAT rule added' and is printed by 'show ip nat
rules' and 'show running-config', while 'icmp 8' is refused with 'needs tcp or
udp'. docs/SIMULATION.md already documented [tcp|udp <port>]; this page did not.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-19 18:23:20 +00:00
jaylouisw deleted branch docs/1119-1817 2026-11-19 18:39:07 +00:00
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!2191
No description provided.