Skip to cheat sheet
← Return to Arsenal
CHEAT SHEET / IOS

ARSENAL / COMMAND CHEAT SHEETS

Cisco IOS Basics

Know which mode you are in, and which show command answers the question.

A working reference for the Cisco command line: the CLI modes and their prompts, built-in help, the show commands you will use every day, and the first lines of config on a new switch or router. Practice moving between modes in the prompt simulator, then test yourself with the quiz.

01 / GETTING A PROMPT

Console connection

A brand-new switch or router has no IP address and no remote access, so your first session goes through the console port.

ItemWhat to use
CableRollover (console) cable: RJ-45 on the device end, DB-9 serial on the PC end. Most laptops need a USB-to-serial adapter. Many newer devices also have a USB console port (mini-USB or USB-C) that needs a driver.
SoftwareA terminal emulator such as PuTTY, Tera Term, or SecureCRT, set to the COM port the adapter created.
Settings9600 baud, 8 data bits, no parity, 1 stop bit (9600 8N1), flow control none.
LaterOnce the device has an IP address and VTY lines are configured, manage it remotely with SSH (preferred) or Telnet (plaintext).

Seeing garbage characters? The baud rate does not match. Blank screen? Press Enter, then check the COM port number in Device Manager.

02 / WHERE AM I?

CLI modes and their prompts

The prompt tells you the mode, and the mode decides which commands exist. The examples use a switch named Switch; after you set a hostname, that name replaces it.

Switch>

User EXEC. Where you land after login. Basic tests only: ping, traceroute, a few show commands. No config, no running-config.

Go up: enable

Switch#

Privileged EXEC (enable mode). Every show command, copy, reload, debug, clear. Protected by the enable secret.

Back down: disable · Go into config: configure terminal

Switch(config)#

Global configuration. Settings for the whole device: hostname, enable secret, banners, VLAN creation, routes.

Back one level: exit · Straight to #: end or Ctrl+Z

Switch(config-if)#

Interface configuration. One port: IP address, description, access VLAN, trunking, speed/duplex, shutdown.

Enter from global config: interface g0/1

Switch(config-line)#

Line configuration. The console line and the VTY (remote) lines: passwords, login, transport input.

Enter: line console 0 or line vty 0 15

Switch(config-vlan)#

VLAN configuration. Name a VLAN after creating it. A range of ports shows (config-if-range)# instead.

Enter: vlan 10 · Ports: interface range g0/1 - 12

Run a show command without leaving config mode: put do in front of it, for example do show ip interface brief.

03 / LET IOS HELP YOU

Help, completion, and shortcuts

?any mode

Lists every command available in the current mode. After a space (show ?) it lists the keywords that can come next. Right after letters (sh?) it lists commands that start with them.

When to use it: you know roughly what you want but not the exact keyword.

Tabkey

Completes a partial keyword once it is unambiguous: conf + Tab becomes configure. IOS also accepts the short form without Tab, so sh ip int br runs show ip interface brief.

When to use it: to type faster and confirm you spelled a keyword the way IOS expects.

Up arrow / Ctrl+Pkey

Recalls earlier commands from history. show history lists them.

When to use it: repeating a command on the next interface, or fixing a typo in a long line.

Ctrl+Shift+6key

The break sequence. Stops a running ping or traceroute, and an accidental DNS lookup of a mistyped word.

When to use it: the CLI hangs on Translating "shwo".... Prevent that with no ip domain-lookup in global config.

% Invalid input detected at '^' marker.error

The caret points at the first character IOS did not understand. Often the command is right but you are in the wrong mode.

When to use it: check the prompt first, then the word under the caret.

% Incomplete / % Ambiguous commanderror

Incomplete: a required keyword or value is missing; add ? to see what comes next. Ambiguous: your abbreviation matches more than one command; type a few more letters.

When to use it: reading these correctly saves guessing.

04 / VERIFY BEFORE YOU CHANGE

Show commands

All of these run from privileged EXEC (#). From config mode, prefix them with do.

show running-config

The configuration the device is using right now, held in RAM. Changes you type take effect here immediately and are lost on reload unless saved.

When to use it: confirm what is configured on a port, line, or VLAN. Pipe it to narrow it down.

show running-config
show running-config interface g0/1
show running-config | include hostname

show startup-config

The saved configuration in NVRAM that loads at boot. If it differs from the running-config, someone made changes and has not saved them.

When to use it: before a reload, or to check whether a change was saved.

show startup-config

show ip interface brief

One line per interface: IP address, Status (layer 1), and Protocol (layer 2). up/up is healthy; administratively down means the port is shut down.

When to use it: the first command on almost any connectivity problem.

show ip interface brief

show interfaces

Full detail per interface: line and protocol state, MAC address, MTU, speed and duplex, input/output rates, and error counters such as CRC errors, runts, giants, and collisions.

When to use it: a link is up but slow or flaky, and you suspect a duplex mismatch or a bad cable.

show interfaces g0/1

show interfaces statusswitch

A switch-port table: description, status (connected, notconnect, disabled, err-disabled), VLAN (or trunk), duplex, speed, and media type.

When to use it: a quick health check of every access port, or finding a port in err-disabled.

show interfaces status

show vlan briefswitch

Each VLAN ID, name, status, and the access ports assigned to it. Trunk ports are not listed here.

When to use it: a PC is in the wrong broadcast domain, or you need to confirm a VLAN exists.

show vlan brief

show mac address-tableswitch

MAC addresses the switch has learned, with the VLAN and the port each one was seen on.

When to use it: track down which port a device is plugged into.

show mac address-table
show mac address-table address 00a1.b2c3.d4e5

show cdp neighbors

Directly connected Cisco devices found by Cisco Discovery Protocol: device ID, your local port, platform, and their port ID. Add detail for their IP address and IOS version.

When to use it: map the physical topology or confirm which neighbor a cable reaches. LLDP is the vendor-neutral equivalent (show lldp neighbors).

show cdp neighbors
show cdp neighbors detail

show version

IOS version and image file, uptime, the reason for the last reload, model, memory, and the configuration register.

When to use it: checking software before an upgrade, or finding out whether a device rebooted overnight.

show version

show inventory

Hardware parts list: chassis, modules, power supplies, and installed transceivers, each with a product ID (PID) and serial number.

When to use it: opening a support case or doing an asset audit.

show inventory

show ip routerouter / L3

The routing table. Codes: C connected, L local (the interface's own address), S static, O OSPF, and S* or the "Gateway of last resort" line for the default route.

When to use it: traffic reaches the router but not the remote network.

show ip route

show interfaces trunkswitchbonus

Which ports are trunking, their native VLAN, and which VLANs are allowed and active on each trunk.

When to use it: a VLAN works on one switch but not across the uplink.

show interfaces trunk

05 / FIRST FIVE MINUTES

Basic device configuration

Replace anything in angle brackets with your own values. Never reuse a real password in a lab file.

enable / configure terminal

Move from > to #, then into global config. Short forms en and conf t are standard.

enable
configure terminal

hostname

Names the device. The prompt changes right away, which helps you avoid configuring the wrong box.

hostname SW1

enable secret

Protects privileged EXEC with a hashed password. If both enable secret and the older enable password are set, the secret wins.

enable secret <your-secret>

line console 0

Puts a password on the physical console port. login tells the line to ask for it.

line console 0
 password <console-password>
 login
 exit

line vty 0 15

The virtual terminal lines used for remote SSH or Telnet sessions. Many switches have 0-15; some routers have 0-4. Without a password plus login (or local users), remote access is refused.

line vty 0 15
 password <vty-password>
 login
 transport input ssh
 exit

transport input ssh only works once SSH is set up (domain name, RSA keys, local user). Use transport input all in a quick lab.

service password-encryption

Scrambles plaintext line passwords in the config with weak type 7 encoding. It stops shoulder-surfing, not attackers; type 7 is easy to reverse.

service password-encryption

banner motd

A message shown before login. The character after motd marks the start and end of the text.

banner motd # Authorized access only #

copy running-config startup-config

Saves RAM to NVRAM so your changes survive a reload. copy run start and the older write memory (wr) do the same job. Run it from privileged EXEC.

end
copy running-config startup-config

06 / PORTS AND BROADCAST DOMAINS

Interface and VLAN basics

Port names vary by model: fa0/1 (FastEthernet), g0/1, or gi1/0/1 on stackable switches. Use show ip interface brief to see the real names.

vlan + name

Creates a VLAN and labels it. VLAN 1 is the default VLAN and every access port starts there.

vlan 10
 name SALES
 exit

switchport access vlan

Makes a port an access port for one VLAN, which is where end devices like PCs and printers plug in.

interface g0/5
 description PC-Sales-01
 switchport mode access
 switchport access vlan 10
 no shutdown

switchport mode trunk

Makes a port carry many VLANs using 802.1Q tags, usually between switches or to a router. Some older switches need switchport trunk encapsulation dot1q first.

interface g0/24
 switchport mode trunk
 switchport trunk allowed vlan 10,20,99

interface range

Applies the same settings to many ports at once.

interface range g0/1 - 12
 switchport mode access
 switchport access vlan 20

interface vlan 1 (SVI)

Gives a layer 2 switch a management IP address. Add a default gateway so it can be reached from other subnets.

interface vlan 1
 ip address 192.168.1.2 255.255.255.0
 no shutdown
 exit
ip default-gateway 192.168.1.1

ip address + no shutdownrouter

Router interfaces start administratively down, so an address alone is not enough. Switch ports are usually enabled out of the box.

interface g0/0
 ip address 10.0.0.1 255.255.255.0
 no shutdown

shutdown / no form

shutdown disables a port. Putting no in front of most commands removes or reverses them, such as no description or no ip address.

interface g0/7
 shutdown

07 / PRACTICE

Prompt simulator

Type mode commands and watch the prompt change. It understands enable, disable, configure terminal, interface <name>, interface range, vlan <id>, line console 0, line vty 0 15, hostname <name>, exit, end, ?, plus show and do show. Abbreviations work. This is a mode trainer, not a full IOS emulator.

Try: en, conf t, int g0/1, do sh ip int br, end.

08 / CHECK YOURSELF

Which show command answers this?

Pick one answer per question. The explanation appears after you answer.

Commands reflect current Cisco IOS and IOS XE behavior on Catalyst switches and ISR routers. Exact output and port names vary by model and software version. Cisco, IOS, and CCNA are trademarks of Cisco Systems, Inc.; BB Tech Tools is not affiliated with Cisco.