show vlan prints VLAN 1 twice and puts every trunk in VLAN 1 #1261

Closed
opened 2026-11-09 19:53:32 +00:00 by jaylouisw · 0 comments
Owner

What happens

show vlan prints two tables under one header:

VLAN Name                             Status    Ports
1       VLAN0001                         active    Fa0/2(n), Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8
20      VLAN0020                         active    Fa0/1
1       default                          active    Fa0/2(trunk)

VLAN 1 twice, with different names and different port lists. The cause is a pseudo-key all: a trunk whose
allowed list is all was pushed into VLAN 1 under the key all, and that key was then rendered as VLAN 1.
So a trunk carrying every VLAN is reported as a member of VLAN 1 and of nothing else.

The rest of the table disagrees with the data plane too: a trunk appears in VLAN 1 whether or not its allowed
list includes VLAN 1, and the (n)/(t)/(trunk) decorations describe an intent rather than what
classifyEgress() would actually forward.

show spanning-tree also answers the wrong question: with no simulation run it says
No bridged ports: this device is not part of any L2 loop. — a claim about the lab, printed when the truth
is that nothing has computed the tree yet. Same defect class as show interfaces counters (#1252).

Expected

  • one row per VLAN, in VLAN order, no pseudo-rows and no decorations;
  • membership decided by classifyEgress() — the rule the data plane forwards by — so an access port appears
    in its access VLAN only, a trunk in exactly the VLANs its allowed list carries (not VLAN 1 merely for
    being a trunk), and an all trunk in every row;
  • a configured VLAN nothing carries prints an empty Ports column rather than an invented port;
  • show vlan brief is the same table;
  • show spanning-tree says Not measured (no simulation run) when nothing has run, and "no ports are
    bridging" only when something has.

Scope

The existing show vlan and show spanning-tree output. No new commands.

## What happens `show vlan` prints two tables under one header: ``` VLAN Name Status Ports 1 VLAN0001 active Fa0/2(n), Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8 20 VLAN0020 active Fa0/1 1 default active Fa0/2(trunk) ``` VLAN 1 twice, with different names and different port lists. The cause is a pseudo-key `all`: a trunk whose allowed list is `all` was pushed into VLAN 1 under the key `all`, and that key was then rendered as *VLAN 1*. So a trunk carrying every VLAN is reported as a member of VLAN 1 and of nothing else. The rest of the table disagrees with the data plane too: a trunk appears in VLAN 1 whether or not its allowed list includes VLAN 1, and the `(n)`/`(t)`/`(trunk)` decorations describe an intent rather than what `classifyEgress()` would actually forward. `show spanning-tree` also answers the wrong question: with no simulation run it says `No bridged ports: this device is not part of any L2 loop.` — a claim about the lab, printed when the truth is that nothing has computed the tree yet. Same defect class as `show interfaces` counters (#1252). ## Expected * one row per VLAN, in VLAN order, no pseudo-rows and no decorations; * membership decided by `classifyEgress()` — the rule the data plane forwards by — so an access port appears in its access VLAN only, a trunk in exactly the VLANs its allowed list carries (**not** VLAN 1 merely for being a trunk), and an `all` trunk in every row; * a configured VLAN nothing carries prints an empty Ports column rather than an invented port; * `show vlan brief` is the same table; * `show spanning-tree` says `Not measured (no simulation run)` when nothing has run, and "no ports are bridging" only when something has. ## Scope The existing `show vlan` and `show spanning-tree` output. No new commands.
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#1261
No description provided.