Hone

Lessons · Network switches · putting the VLAN names back

Putting the VLAN names back

After a restore in the default mode the VLANs exist as numbers with default names, because a port assignment creates them and the name was never in the file.

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

VLAN0010 forwards exactly as STAFF did, so nothing is broken and nothing is labelled. The cost lands six months later on whoever has to work out what VLAN0010 was for.

How to think about it

Take `show vlan brief` off the old box before it goes, and retype the names on the new one. It is thirty seconds against an afternoon.

Worked example

enable
In.
configure terminal
A port assignment on its own.
interface gi0/2
One port.
switchport access vlan 10
The switch makes VLAN 10 because a port asked for it, and says so.
exit
Out.
exit
And out.
show vlan brief
VLAN0010: the default name, which is what a restore leaves you.
configure terminal
Now put the name back.
vlan 10
The same VLAN.
name STAFF
Named properly.
exit
Out.
exit
And out.
show vlan brief
STAFF. This is the step nobody writes down.

Your turn

Give VLAN 10 the name STAFF.

 STAFF

The trap

Assuming the restore brought them because the ports are in the right VLANs. The numbers travelled; the names did not.

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