Hone

Lessons · Network switches · the VLAN that made itself

The VLAN that made itself

Putting a port into a VLAN that does not exist creates it, with a default name, and the switch tells you it did.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

It is the reason a typo does not fail loudly. `switchport access vlan 200` when you meant 20 does not error; it quietly builds VLAN 200 and moves the desk into an empty network.

How to think about it

Read the line the switch prints. '% Access VLAN does not exist. Creating vlan 200' is not information, it is a warning that you have just typed a number nobody planned.

Worked example

enable
The # prompt.
configure terminal
Into configuration mode.
interface gi0/3
A port.
switchport mode access
Access mode.
switchport access vlan 200
% Access VLAN does not exist. Creating vlan 200. The command succeeded, and that is the problem.
end
Out.
show vlan brief
200 VLAN0200 active Gi0/3. A VLAN nobody asked for, with a machine-generated name, and one desk stranded in it.

Your turn

Look at the VLAN table to find the one that appeared by accident.

show  brief

The trap

Reading the message as a confirmation. It is the switch telling you the number you typed was new to it, which on a planned network almost always means it was wrong.

Practise the VLAN that made itself on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.