Course contents

Chapter 1: Cisco IOSLesson 1 of 10

CLI modes and navigation

Console and SSH access, user and privileged EXEC, configuration modes, help, shortcuts and reading error messages.

Beginner · 10 min read

Technical definition

Cisco IOS CLI (command-line interface) modes are the separate command levels of the IOS command line, mainly user EXEC, privileged EXEC, global configuration and sub-configuration modes such as interface mode. Each mode allows a different set of commands, and the prompt shows which mode is active.

Two ways in: console and remote access

Cisco IOS (Internetwork Operating System) is the software on Cisco routers and switches. Newer devices run IOS XE, which feels the same at the command line. You reach its CLI (command-line interface) in one of two ways:

  • Console port: a direct cable from your laptop to the device (an RJ-45 "rollover" cable with a USB-to-serial adapter, or a USB console cable). It works even when the device has no IP address at all. The usual terminal settings are 9600 baud, 8 data bits, no parity, 1 stop bit, no flow control.
  • Remote access over the network with SSH (encrypted, use this) or Telnet (plain text, avoid it). The device needs an IP address, and its VTY lines (virtual terminal lines, the "ports" that remote sessions land on) must be set up. See SSH and Telnet for how the protocols work.
Diagram
Console access first, SSH once the device has an address
Console access first, SSH once the device has an address
consoleGi0/1Gi1/0/24Gi1/0/1Gi0/0Admin laptopconsole cableR1Gi0/1 192.168.10.1SW1Vlan1 192.168.10.2Admin PCIP 192.168.10.10ISPIP 198.51.100.1

Device key: R1 (router) · SW1 (switch) · Admin PC (computer) · ISP (network / service)

Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • Admin laptop: console cable
  • R1: Gi0/1 192.168.10.1
  • SW1: Vlan1 192.168.10.2
  • Admin PC: IP 192.168.10.10
  • ISP: IP 198.51.100.1
  1. 1. Day one: the console cable. A direct serial connection. No IP address or network needed, so it works even before anything is configured.
  2. 2. Later: SSH over the LAN. Once R1 has an address and its VTY lines allow SSH, the admin PC connects across SW1.
  3. 3. Switches too. SW1 is managed through its own IP address on a VLAN interface (an SVI).

The modes and their prompts

The CLI is split into modes. Each mode allows a different set of commands, and the prompt always tells you which mode you are in. That is the most useful habit to build: read the prompt before you type.

R1 · CLI practiceSimulation
R1>
User EXEC

Basic checks. Use enable to request privileged EXEC.

Try reaching interface mode, then compare exit with end. This practice skips authentication and does not connect to a device.
Mode and prompt reference
ModePromptEnter withUsed for
User EXECR1>Log inBasic checks: ping, traceroute, some show commands
Privileged EXECR1#enableVerification and administration: show, copy, reload
Global configurationR1(config)#configure terminalSettings that apply to the whole device
Interface configurationR1(config-if)#interface g0/1Settings for one interface
Line configurationR1(config-line)#line console 0 / line vty 0 4Console and remote login settings
Router configurationR1(config-router)#router ospf 1A routing protocol

These examples use the default privilege levels: user EXEC at level 1 and privileged EXEC at level 15. Login policies can place a user directly in privileged EXEC, and command authorization can restrict which commands that user may run. Read the prompt before typing.

From login to interface mode and back

Diagram
Read the prompt as you enter and leave configuration
Read the prompt as you enter and leave configuration
Read the prompt as you enter and leave configurationThe default lab login starts at R1 greater-than, user EXEC. enable reaches R1 hash, privileged EXEC. configure terminal reaches R1 config hash. interface GigabitEthernet0/1 reaches R1 config-if hash. From interface mode, exit returns one level to global configuration; end or Ctrl+Z returns to privileged EXEC.R1>User EXECR1#Privileged EXECR1(config)#Global configurationR1(config-if)#Interface configurationenableconfigure terminalinterface GigabitEthernet0/1exitendCtrl+Zexit: one level back · end: return to privileged EXEC
Default privilege-level lab with successful authentication. Some login policies start directly in privileged EXEC. Most configuration changes affect the running device immediately.

Typing a global command while in a sub-mode usually works: IOS drops you back to global configuration and runs it. That is handy, but it also means a mistyped interface command can quietly land in the wrong place. Keep an eye on the prompt.

Getting around the CLI quickly

Moving between modes

enable configure terminal interface GigabitEthernet0/1 description LAN to SW1 Gi1/0/24 exit line console 0 logging synchronous end

A full walk down and back up: from user EXEC to interface mode, back to global config, into line mode, then straight back to privileged EXEC.

Getting help

Diagram
The position of ? changes the question
The position of ? changes the question
The position of ? changes the questionAt a privileged EXEC prompt, cl? lists matching command words. show ip ? lists possible next keywords. Tab completes a unique word, such as configure from conf. Available commands depend on the platform and current mode.Find a commandR1# cl?No space before ?Lists words starting with clExample: clear, clockFind the next wordR1# show ip ?Space before ?Lists valid next keywordsExample: interface, routeComplete a wordR1# conf + TabOne matching keywordCompletes to configureAmbiguous? Type more letters.
Read the prompt first. Command help depends on mode, privilege and software features; these are illustrative examples.

Shortcuts worth knowing

Key or commandDoes
Up arrow / Ctrl+PPrevious command in the history buffer
Down arrow / Ctrl+NNext command in the history buffer
Ctrl+A / Ctrl+EJump to the start / end of the line
Ctrl+ZLeave configuration mode (same as end)
Ctrl+Shift+6Break out of a running ping, traceroute or DNS lookup
Space / Enter at --More--Next page / next line of long output; use Q to stop
do <command>Run an EXEC command (such as do show ip interface brief) from any config mode
terminal length 0Turn off --More-- paging for this session

You can also shorten any word to the fewest letters that make it unique: conf t, sh ip int br, int g0/1. You will see these abbreviations everywhere, including in exam questions.

Two settings that make life easier

configure terminal no ip domain-lookup line console 0 logging synchronous exec-timeout 15 0 end

no ip domain-lookup stops the DNS lookup after a typo. logging synchronous reprints your half-typed line after a log message interrupts it. exec-timeout logs an idle session out after 15 minutes.

On lab devices, many engineers type these lines out of habit before anything else. On production devices, check first whether something relies on DNS lookups from the CLI.

How to verify where you are

The prompt is the first check. When in doubt, two commands confirm your level and what you have typed recently.

Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show privilege
Current privilege level is 15
Level 15 is privileged EXEC. In user EXEC the same command reports level 1.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show history
  enable
  configure terminal
  show ip interface brief
  show privilege
  show history
The last commands typed in this session (10 by default). Change the size with terminal history size.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ip ?
  access-lists     List IP access lists
  arp              IP ARP table
  dhcp             Show items in the DHCP database
  interface        IP interface status and configuration
  ospf             OSPF information
  protocols        IP routing protocol process parameters and statistics
  route            IP routing table
  ...
Context help: the words that can follow show ip, each with a one-line description. The real list is much longer.

Reading error messages

These common parser errors help distinguish a typo, an abbreviation and missing arguments.

Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ip interface brif
                     ^
% Invalid input detected at '^' marker.
The caret ^ points at the first character IOS could not accept. Here "brif" is a typo. You also get this error when the command is fine but you are in the wrong mode, for example configure terminal typed at the R1> prompt.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#co
% Ambiguous command:  "co"
Too few letters: "co" could be configure, connect or copy. Type more letters, or co? to see the choices.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ip
% Incomplete command.
The command needs more words. Add a space and ? to see what can come next.
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#shwo
Translating "shwo"...domain server (255.255.255.255)
% Unknown command or computer name, or unable to find computer address
With name lookup and the default preferred transport enabled, an unknown word can trigger a hostname lookup for an implicit connection. The destination depends on the DNS configuration. Press Ctrl+Shift+6 to cancel, and configure no ip domain-lookup so it doesn't happen again.

A blank console, garbage text and refused commands

  • Nothing appears on the console. Check the terminal settings (9600 8N1, no flow control), the COM port your adapter uses, and that the cable is in the console port, not the AUX or an Ethernet port. Press Enter a few times.
  • Garbage characters on the console. Check for a serial speed or framing mismatch. Use the console settings specified for the device; 9600 8N1 is common.
  • A command is rejected that you know is correct. Look at the prompt. You are probably in the wrong mode, such as trying show running-config from user EXEC or ip address in global configuration.
  • Log messages keep breaking your typing. Add logging synchronous under the line you use.
  • SSH or Telnet is refused. The VTY lines may not have a password or login method, or SSH isn't set up. The Initial switch and router setup lesson covers the line settings.

Test yourself on IOS modes

Predict · scenario 1

The prompt shows R1(config-if)#. You type end. What prompt do you see next?

Predict · scenario 2

At the R1> prompt you type configure terminal and get '% Invalid input detected'. Why?

Predict · scenario 3

You type 'co' and press Enter. IOS replies '% Ambiguous command'. What does that mean?

Predict · scenario 4

You are in interface configuration mode and want to check the interface status without leaving. What do you type?

Predict · scenario 5

You mistype a single word in privileged EXEC and the router hangs for several seconds with 'Translating...'. What prevents this?

Cisco reference

Cisco DevNet: command modes and context-sensitive help