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
enableIn.
configure terminalMake a VLAN with a name.
vlan 40Created.
name PACKINGNamed. This name is the part that will not travel.
exitOut of the VLAN.
exitAnd out of config mode.
show vlan briefThere it is, with its name. This reads the database.
show running-config | include PACKINGAnd 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
Console into a switch
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.