switchport access vlan 22 creates VLAN 22, and says so the way the device does (#1535) #1536
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!1536
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "rev/1115-1930"
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?
Closes #1535.
The question
What does a real IOS-like switch do when an access port is assigned to a VLAN that does not exist?
Evidence
It creates the VLAN, and says so in two lines, then applies the assignment:
switchport access vlancommand forces the creation of a VLAN if it does not already exist on the switch" — https://www.ii.pwr.edu.pl/~kano/course/module3/3.2.1.3/3.2.1.3.htmlSix vendor guides across fourteen years, one for one: the notice is two lines,
%on the first only.The gap
switchport access vlan 22moved the port and said nothing about the VLAN.show vlangrew a row anyway (that table is built from the port list as well as fromconfig.vlans), so the port and the table agreed whileshow running-configprinted novlan 22line. A config saved from the device was not self-contained — paste it into a fresh switch and the VLAN was gone. That is the hole #1232 closed for VLANs somebody typedvlan 22for, still open on the one command that creates a VLAN without anybody typingvlan.Change
engine/cli.js: assigning an access VLAN writes the table entry the port needs, under the same generated namevlan <id>would have given it, and announces the two vendor lines before the console's own confirmation. Said once: not for VLAN 1 (every switch has it), not when the VLAN already exists, and not when somebody created it withvlan 20(their name survives).test/vlan-auto-create.test.js(new, 16 assertions): the two lines in order, the assignment still applied, the three views agreeing (show running-config,show vlan,show vlanafter a copy-paste replay), once-only behaviour, VLAN 1, a pre-existing VLAN keeping its name, and a port staged for a trunk.test/switchport-mode.test.js,test/switchport-negation.test.js: their replay checks treated any%line as a rejection. This notice is information — nothing was refused and the replayed config is still byte-identical — so they now allow exactly% Access VLAN does not exist.and fail on any other%.Gates
node scripts/syntax-check.js: 322 files, all OKskip-audit,canonical-urls,config-roundtrip,config-completeness,replay-identical,vlan,cli,switchport-mode,switchport-negation,vlan-auto-create: all greenNot resolved here
Creating vlan 22on a switch whose VTP mode is server or transparent; a client in a VTP domain learns the VLAN from an advertisement instead and words it differently. The simulator has no VTP, so this stays out.switchport voice vlan 44creates a voice VLAN without the same notice here; whether a real device announces it identically is a separate question.Access VLAN 44 on Fa0/1) is printed after the vendor lines; a real device prints nothing at all after them. Removing it is a wider change to every command's output and was left alone.switchport access vlan 22creates VLAN 22, and says so the way the device does (#1535)081e244d48f6c608ea8a