no vlan 22 deletes the VLAN and leaves its access ports inactive #1568
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1568
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "rev/1115-2331"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 22goes through for access ports and names them as they drop.Device.inactiveVlan()answers whether an access port is waiting for a VLAN;ifaceStatus()reports itdown/downwith reasoninactive, soshow interfacessaysstatus: down (inactive)andshow ip interface briefsaysdown 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 briefno longer rebuilds the deleted VLAN row from the port still assigned to it, and does not list the port under another VLAN.vlan 22restores it with no interface command, which is what the device does.The old refusal existed so the config and
show vlancould 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.mdrecords 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-portandl2updated 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 onorigin/main(verified in a clean worktree).no vlan 22deletes the VLAN and leaves its access ports inactiveOne 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.3a7970d1b813c559412dshow interfaces status inactiveis not a command - the port's own status line is whereinactiveis reported #1597