Hone

Lessons · Network switches · the switch will tell you

Ask the box

`?` works at every prompt and after any half-typed command, and it answers for the switch in front of you rather than for the one somebody wrote a cheat sheet about.

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

This is the actual answer to how anyone remembers all of this. Mostly they do not: they type a question mark.

How to think about it

Type as much as you are sure of, then `?`. Tab completes a word you have started, which is also a check -- if it will not complete, it is not the word you think.

Worked example

enable
In.
?
Everything this prompt accepts. Eleven commands, not a thousand.
show ?
And everything that can follow show.
configure terminal
Configuring.
interface gi0/1
Inside a port, where the vocabulary is different again.
switchport ?
Five words. One of them is the one you were trying to remember.
switchport mode ?
And now the two ways a port can behave.
switchport mode access
Which you have just been told, rather than recalled.
end
Done.

Your turn

Find out what words are allowed after switchport.

switchport 

The trap

Trusting a printed sheet on an unfamiliar switch. Platforms and versions differ in what they accept, and the sheet describes a different box.

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