Hone

Lessons · Network switches · looking without leaving

do: one command somewhere else, and back

Every mode has its own vocabulary, so a show command inside a port is not a wrong command -- it is a command from another room. `do` runs it there and puts you back.

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 single most common moment of confusion for anybody new to IOS, and it looks like the switch being awkward. It is not; it is one word.

How to think about it

When something you are sure of is refused, read the prompt. If it says (config) or (config-if), the fix is usually three letters.

Worked example

enable
In.
configure terminal
Configuring.
interface gi0/2
Inside a port. The prompt says so.
switchport mode access
This belongs here.
show vlan brief
And this does not. The command is right; the room is wrong.
do show vlan brief
Same command, run next door, and you are still inside the port.
description Front desk
Which the next line proves, because this only works in here.
end
Done.

Your turn

Check the VLANs without leaving interface configuration.

 show vlan brief

The trap

Typing exit to run one show command. It works, and then you are somewhere else and have to find your way back.

Practise looking without leaving on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.