no vlan 22 deletes the VLAN and leaves its access ports inactive #1568

Merged
jaylouisw merged 1 commit from rev/1115-2331 into main 2026-11-16 01:31:43 +00:00
Owner

One behavioural question. What does a real switch do when a VLAN is deleted while access ports are assigned to it?

The console refused it (% VLAN 22 is still carried by 1 port(s): Gi1/0/1 - move them off it first), which no Cisco device does. The caution under Deleting a VLAN is the same sentence in the Catalyst 9200 16.11, 6500 15.4SY, IE3500 17.17, ESS3300 and micro-switch 15.2(7)E configuration guides: "When you delete a VLAN, any ports assigned to that VLAN become inactive. They remain associated with the VLAN (and thus inactive) until you assign them to a new VLAN."

Now:

  • no vlan 22 goes through for access ports and names them as they drop.
  • Device.inactiveVlan() answers whether an access port is waiting for a VLAN; ifaceStatus() reports it down/down with reason inactive, so show interfaces says status: down (inactive) and show ip interface brief says down down. It is asked before the cable tests, because a cable cannot fix a port with nothing to forward in (Cisco TAC 12027: "the port or interface becomes inactive", Access Mode VLAN: 11 ((Inactive))).
  • show vlan brief no longer rebuilds the deleted VLAN row from the port still assigned to it, and does not list the port under another VLAN.
  • The data path drops in and out of such a port, and the MACs learned in the deleted VLAN are forgotten.
  • vlan 22 restores it with no interface command, which is what the device does.

The old refusal existed so the config and show vlan could not describe different switches. The device keeps them agreeing the other way, and the table now does too.

Still refused, deliberately: a trunk that carries the VLAN. Deleting a VLAN does rewrite a trunk's allowed list on the device, but the evidence for exactly how is thin, so that half is unchanged. research/vlan-deleted-ports-inactive.md records the sources, the reasoning, and the two known gaps (the trunk, and the canvas, which still paints such a port up because the published state payload carries no VLAN database).

Tests: test/vlan-delete-leaves-port-inactive.test.js (19 assertions: control plane, data plane, restore). config-undo, show-interfaces-port and l2 updated where they pinned the refusal or put a port into a VLAN that was never created.

Full suite: 258 suites, 9390 assertions passed, 1 failed - spec-vs-description (Edgecore AS4610 20G QSFP+), which fails identically on origin/main (verified in a clean worktree).

**One behavioural question.** What does a real switch do when a VLAN is deleted while access ports are assigned to it? The console refused it (`% VLAN 22 is still carried by 1 port(s): Gi1/0/1 - move them off it first`), which no Cisco device does. The caution under *Deleting a VLAN* is the same sentence in the Catalyst 9200 16.11, 6500 15.4SY, IE3500 17.17, ESS3300 and micro-switch 15.2(7)E configuration guides: "When you delete a VLAN, any ports assigned to that VLAN become inactive. They remain associated with the VLAN (and thus inactive) until you assign them to a new VLAN." Now: * `no vlan 22` goes through for access ports and names them as they drop. * `Device.inactiveVlan()` answers whether an access port is waiting for a VLAN; `ifaceStatus()` reports it `down`/`down` with reason `inactive`, so `show interfaces` says `status: down (inactive)` and `show ip interface brief` says `down down`. It is asked before the cable tests, because a cable cannot fix a port with nothing to forward in (Cisco TAC 12027: "the port or interface becomes inactive", `Access Mode VLAN: 11 ((Inactive))`). * `show vlan brief` no longer rebuilds the deleted VLAN row from the port still assigned to it, and does not list the port under another VLAN. * The data path drops in and out of such a port, and the MACs learned in the deleted VLAN are forgotten. * `vlan 22` restores it with no interface command, which is what the device does. The old refusal existed so the config and `show vlan` could not describe different switches. The device keeps them agreeing the other way, and the table now does too. **Still refused, deliberately:** a trunk that carries the VLAN. Deleting a VLAN does rewrite a trunk's allowed list on the device, but the evidence for exactly how is thin, so that half is unchanged. `research/vlan-deleted-ports-inactive.md` records the sources, the reasoning, and the two known gaps (the trunk, and the canvas, which still paints such a port up because the published state payload carries no VLAN database). **Tests:** `test/vlan-delete-leaves-port-inactive.test.js` (19 assertions: control plane, data plane, restore). `config-undo`, `show-interfaces-port` and `l2` updated where they pinned the refusal or put a port into a VLAN that was never created. Full suite: 258 suites, 9390 assertions passed, 1 failed - `spec-vs-description` (Edgecore AS4610 20G QSFP+), which fails identically on `origin/main` (verified in a clean worktree).
no vlan 22 deletes the VLAN and leaves its access ports inactive
Some checks failed
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 28s
CI / Classify the change (pull_request) Failing after 13m38s
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Server smoke test (pull_request) Has been cancelled
CI / Docker build (pull_request) Has been cancelled
3a7970d1b8
One behavioural question: what does a real switch do when a VLAN is deleted while
access ports are assigned to it? The console refused the command ("% VLAN 22 is
still carried by 1 port(s): Fa0/1 - move them off it first"), which no Cisco device
does. The caution under "Deleting a VLAN" is the same sentence in the Catalyst 9200
16.11, 6500 15.4SY, IE3500 17.17, ESS3300 and micro-switch 15.2(7)E configuration
guides: "When you delete a VLAN, any ports assigned to that VLAN become inactive.
They remain associated with the VLAN (and thus inactive) until you assign them to a
new VLAN."

So now:
  * `no vlan 22` goes through for access ports and names them as they drop;
  * `Device.inactiveVlan()` answers whether an access port is waiting for a VLAN, and
    `ifaceStatus()` reports it down/down with reason `inactive` - `show interfaces`
    says `status: down (inactive)`, `show ip interface brief` says `down down`, ahead
    of the cable tests, because a cable cannot fix a port with nothing to forward in
    (Cisco TAC 12027: "the port or interface becomes inactive", `Access Mode VLAN: 11
    ((Inactive))`);
  * `show vlan brief` no longer rebuilds the deleted VLAN's row from the port that is
    still assigned to it, and does not list the port under another VLAN either;
  * the data path drops in and out of such a port and forgets the MACs learned in the
    deleted VLAN;
  * `vlan 22` restores it with no interface command, which is what the device does.

The old refusal existed to stop the config and `show vlan` describing different
switches. The device keeps them agreeing the other way, and the table now does too,
so the refusal was the wrong fix for a real disagreement.

A trunk that carries the VLAN still refuses: deleting a VLAN does rewrite a trunk's
allowed list on the device, and the evidence for exactly how is thin, so nothing is
changed there and research/vlan-deleted-ports-inactive.md records what would settle
it (plus the canvas, which still paints such a port up because the published state
payload carries no VLAN database).

Tests: test/vlan-delete-leaves-port-inactive.test.js (19 assertions, control plane,
data plane and restore); config-undo, show-interfaces-port and l2 updated where they
pinned the refusal or set a port into a VLAN that was never created.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-16 01:31:22 +00:00
jaylouisw force-pushed rev/1115-2331 from 3a7970d1b8
Some checks failed
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 28s
CI / Classify the change (pull_request) Failing after 13m38s
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Server smoke test (pull_request) Has been cancelled
CI / Docker build (pull_request) Has been cancelled
to 13c559412d
Some checks failed
CI / Classify the change (pull_request) Successful in 17s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 2m21s
CI / Docker build (pull_request) Successful in 28s
CI / Server smoke test (pull_request) Failing after 13m36s
CI / Test (Node 22) (pull_request) Failing after 13m39s
CI / Test (Node 20) (pull_request) Failing after 13m45s
CI / Test (Node 18) (pull_request) Failing after 13m48s
2026-11-16 01:31:23 +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!1568
No description provided.