Lessons · Network switches · the four questions at any console
Four questions answer almost everything
Where am I. What has this box got. What did I change. Did I save it. Nearly every moment of confusion at a console is one of those four, unasked.
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
Most commands that get refused are the right command in the wrong mode, and the prompt was telling you the whole time.
How to think about it
The prompt answers the first for free. The other three are one command each, and none of them changes anything.
Worked example
enableWhere am I: the prompt goes from > to #, so this is privileged mode.
show versionWhat has it got: model, serial, ports, and the image it booted.
configure terminalNow the prompt says (config), which is the answer to the first question again.
hostname CLOSET-3A change.
endBack out.
show running-config | include hostnameWhat did I change: this is the live one.
show startup-configDid I save it: no, and the refusal says so plainly.
copy running-config startup-configNow yes.
Your turn
Ask the box what hardware and software it is.
show
Console into a switch
The trap
Answering 'did I save it' by reloading to see. That answers the question by destroying the evidence.
Practise the four questions at any console on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.