switchport trunk allowed vlan add 30 refuses a token nobody typed #1455

Closed
opened 2026-11-12 01:42:24 +00:00 by jaylouisw · 0 comments
Owner
s1(config-if)# switchport trunk allowed vlan add 30
% cannot parse VLAN token "add30"

The branch glued the tokens after switchport trunk allowed vlan together with no separator — deliberate, so that 10, 20 and 40 - 42 typed with spaces still parsed — and the join also ate the verbs IOS puts in front of a list to edit the one already there. The refusal quotes a token nobody typed, and the only way to add a VLAN is to retype the whole list from memory: exactly the mistake add/remove exist to prevent.

Editing a trunk's allowed list is an existing mechanism with an existing command; add and remove are that command's other two forms.

What should be true

  1. add <list> is the union with what the trunk already allows, and says what it added;
  2. remove <list> is the difference, and says what it took out;
  3. an edit that changes nothing says so — add 10 when 10 is allowed prints the list unchanged; remove 99 when 99 was never allowed is refused with the list it left alone;
  4. the two footguns are refused, not committed: removing the last VLAN (a trunk carrying nothing), and removing from a trunk that allows all (which would store 4,093 ids as a line nobody would type);
  5. a word where a list belongs is named as a word — % Unrecognized "except" with the accepted forms, never the glued except20;
  6. everything that already worked is untouched: 10, 20 with spaces, 40 - 42 ranges, all, no switchport trunk allowed vlan, the bare command's % Incomplete command;
  7. after every edit the engine state, show running-config, show interfaces <port> and show vlan brief agree, and the line the config prints can be typed back as a no-op.

Evidence: test/trunk-allowed-add-remove.test.js, 42 checks. Reverting engine/cli.js fails 19. Neighbours green: vlan 59, voice-vlan 30, show-vlan 29, show-argument-refusal 77, switchport-mismatch 26, interface-door-atomicity 12, config-roundtrip 46.

``` s1(config-if)# switchport trunk allowed vlan add 30 % cannot parse VLAN token "add30" ``` The branch glued the tokens after `switchport trunk allowed vlan` together with no separator — deliberate, so that `10, 20` and `40 - 42` typed with spaces still parsed — and the join also ate the verbs IOS puts in front of a list to edit the one already there. The refusal quotes a token nobody typed, and the only way to add a VLAN is to retype the whole list from memory: exactly the mistake `add`/`remove` exist to prevent. Editing a trunk's allowed list is an existing mechanism with an existing command; `add` and `remove` are that command's other two forms. ### What should be true 1. `add <list>` is the union with what the trunk already allows, and says what it added; 2. `remove <list>` is the difference, and says what it took out; 3. an edit that changes nothing says so — `add 10` when 10 is allowed prints the list unchanged; `remove 99` when 99 was never allowed is refused with the list it left alone; 4. the two footguns are refused, not committed: removing the last VLAN (a trunk carrying nothing), and removing from a trunk that allows **all** (which would store 4,093 ids as a line nobody would type); 5. a word where a list belongs is named as a word — `% Unrecognized "except"` with the accepted forms, never the glued `except20`; 6. everything that already worked is untouched: `10, 20` with spaces, `40 - 42` ranges, `all`, `no switchport trunk allowed vlan`, the bare command's `% Incomplete command`; 7. after every edit the engine state, `show running-config`, `show interfaces <port>` and `show vlan brief` agree, and the line the config prints can be typed back as a no-op. Evidence: `test/trunk-allowed-add-remove.test.js`, 42 checks. Reverting `engine/cli.js` fails 19. Neighbours green: `vlan` 59, `voice-vlan` 30, `show-vlan` 29, `show-argument-refusal` 77, `switchport-mismatch` 26, `interface-door-atomicity` 12, `config-roundtrip` 46.
Sign in to join this conversation.
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#1455
No description provided.