Hone

Lessons · Network switches · erasing the configuration

Back to how it came out of the box

`erase startup-config` empties NVRAM, and the reload after it brings the switch up with defaults.

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 how a switch is handed on. A box leaving your site with a configuration on it leaves with your addresses, your VLAN numbers and your password hashes.

How to think about it

Erase, then reload. Nothing visible happens until the reload, because the running configuration is still in memory the whole time, which is a good way to talk yourself into thinking it did not work.

Worked example

enable
The # prompt.
configure terminal
Something to erase.
hostname OLDSITE
A name.
end
Out.
write memory
Saved, so there is really something in NVRAM now.
erase startup-config
NVRAM is empty. The switch is still running exactly as before.
show running-config
Still OLDSITE. This is the moment people conclude it did not work.
reload
Now it takes effect: nothing to load, so it comes up as a factory switch.
enable
And back to the # prompt, because the reboot logged you out.
show running-config
Switch, no VLANs beyond the default, nothing. That is a switch ready to hand on.

Your turn

Empty the saved configuration.

erase 

The trap

Erasing and walking away without reloading. The switch keeps running the old configuration until it restarts, so the job looks done and is not.

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