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
enableThe # prompt.
configure terminalSomething to erase.
hostname OLDSITEA name.
endOut.
write memorySaved, so there is really something in NVRAM now.
erase startup-configNVRAM is empty. The switch is still running exactly as before.
show running-configStill OLDSITE. This is the moment people conclude it did not work.
reloadNow it takes effect: nothing to load, so it comes up as a factory switch.
enableAnd back to the # prompt, because the reboot logged you out.
show running-configSwitch, no VLANs beyond the default, nothing. That is a switch ready to hand on.
Your turn
Empty the saved configuration.
erase
Console into a switch
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.