Hone

Lessons · Network switches · VLANs live outside the config

The VLAN database is not part of the configuration

In the default VTP mode a switch keeps its VLANs in vlan.dat on flash -- not in the running configuration, and not in NVRAM.

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

One fact explains three surprises: a config backup does not carry the VLANs, `erase startup-config` does not remove them, and a reload does not undo deleting one.

How to think about it

Treat the VLAN list as a separate thing to record and a separate thing to wipe. `show vlan brief` is where it lives; the configuration is not.

Worked example

enable
In.
configure terminal
Make a VLAN with a name.
vlan 40
Created.
name PACKING
Named. This name is the part that will not travel.
exit
Out of the VLAN.
exit
And out of config mode.
show vlan brief
There it is, with its name. This reads the database.
show running-config | include PACKING
And nothing comes back. The name is not in the configuration.
dir flash:
vlan.dat, on the disk, which is where it actually is.

Your turn

List the VLANs on this switch with their names.

show vlan 

The trap

Handing a switch on after `erase startup-config` and a reload. It comes back with no configuration and every VLAN somebody made on it.

Practise VLANs live outside the config on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.