Overview

5 The Cisco IOS CLI

This chapter shifts from networking theory to hands-on skills by introducing how to work with Cisco devices through their operating system interface. It contrasts graphical and command-line shells, noting that while the wireless LAN controller has a GUI, the CCNA largely relies on Cisco IOS’s CLI. You learn how to reach the CLI primarily via a local console connection (USB Mini-B or RJ45 using a rollover cable) with a terminal emulator and typical serial settings (9600 baud, 8 data bits, 1 stop bit, no parity, no flow control), while remote access methods like Telnet and SSH are deferred to later study. The console is for local configuration only and supports a single active session.

The chapter then explains the IOS command hierarchy and how to move through it: user EXEC mode (limited, hostname>), privileged EXEC mode (full operational access, hostname# via the enable command), and global configuration mode (hostname(config)# via configure terminal) for making changes. It covers returning between modes (exit, end, Ctrl-Z), using do to run EXEC commands from configuration modes, and productivity helpers such as cursor-movement and history shortcuts, plus context-sensitive help. The question mark lists available commands and keywords or completes partial entries, while Tab and unique prefixes speed up typing and reduce errors.

Finally, it details IOS configuration files and security basics. The running-config in RAM controls current operation and is lost on reload, while the startup-config in NVRAM is loaded at boot; you view them with show commands, save changes with write/write memory/copy running-config startup-config, and restore factory defaults by erasing the startup-config and reloading. To protect privileged EXEC mode, you can set an enable password (stored in plaintext unless weak type 7 encryption is enabled) but should prefer the enable secret, which stores a hash (type 9 scrypt on newer systems or type 5 MD5 on older ones) and overrides the legacy password. Mastering these fundamentals prepares you to configure and verify the protocols covered throughout the CCNA.

The GUI of a Cisco wireless LAN controller, accessed via a web browser.
The Command Prompt CLI of a Windows PC, accessed from within the Windows shell GUI.
Two console ports on a Cisco switch: USB Mini-B (left) and RJ45 (right).
The wiring of a rollover cable, used to connect a PC to the RJ45 console port of a network device. Pin 1 on one end connects to pin 8 on the other end, pin 2 to pin 7, pin 3 to pin 6, pin 4 to pin 5, pin 5 to pin 4, pin 6 to pin 3, pin 7 to pin 2, pin 8 to pin 1.
How to use PuTTy to access a Cisco device’s CLI via the console port. From the Serial tab, configure the following settings and then click Open: 1) Speed (baud): 9600 bits per second, 2) Data bits: 8, 3) Stop bits: 1, 4) Parity: None, 5) Flow control: None
How to navigate between user EXEC mode, privileged EXEC mode, and global configuration mode in the Cisco IOS command hierarchy

 Summary

  • A shell is a computer program that allows a user to interact with the computer. A graphical user interface (GUI) is a shell with a graphical interface, and a command-line interface (CLI) is a shell with a text-based interface.
  • For the CCNA exam, you must be able to use the Cisco IOS CLI to configure the protocols and features listed in the exam topics list.
  • The CLI of a network device can be accessed by connecting a PC to the device’s console port with a console, or crossover, cable or by connecting over the network infrastructure using Telnet or Secure Shell (SSH).
  • After physically connecting a PC to the device’s console port, a terminal emulator application (such as PuTTy) is required to access the CLI.
  • To give commands to a network device, you type commands in the CLI and press Enter.
  • After connecting to a device’s CLI, you will be in user EXEC mode, which only allows you to view basic information about the device, but not perform anything intrusive. The format of the prompt is hostname>.
  • To access more powerful commands, use the enable command to access privileged EXEC mode, which provides unlimited access to EXEC mode commands. For example, you can view information about the device, restart it, save the configuration, move and delete files, etc. The format of the prompt is hostname#.
  • Use the disable command to return to user EXEC mode from privileged EXEC mode.
  • Use the reload command in privileged EXEC mode to restart the device.
  • To make configuration changes to the device, use the configure terminal command in privileged EXEC mode to access global configuration mode. The prompt is hostname(config)#.
  • Global configuration mode allows you to make configuration changes to the device. It also allows you to access other configuration modes for specific features.
  • To change the hostname of the device, use the hostname command in global configuration mode.
  • To undo a command, use no in front of the command. For example, no hostname R1.
  • Use the end command, the exit command, or the Ctrl-Z shortcut to return to privileged EXEC mode from global configuration mode.
  • When in a configuration mode, you can use do in front of a command to execute EXEC mode commands.
  • Keyboard shortcuts can be used to move the cursor and scroll through previously executed commands.
  • Context-sensitive help can be used for guidance within the CLI. It can list available commands and possible completions for partially-written words.
  • Cisco IOS devices use two configuration files: the running-config and the startup-config.
  • The running-config is stored in RAM and determines the current operations of the device. Configuration commands change the running-config and immediately take effect. The running-config file is lost when the device is powered off or restarted.
  • The startup-config is stored in nonvolatile RAM (NVRAM) and does not determine the current operations of the device. The contents of the startup-config are copied to the running-config when the device boots up.
  • To save the running-config file to the startup-config file, use write, write memory, or copy running-config startup-config in privileged EXEC mode.
  • To return the device to the factory-default configuration, delete the startup-config with write erase, erase nvram:, or erase startup-config and restart the device with reload.
  • Privileged EXEC mode can be password-protected with an enable password or enable secret. If both the enable password and enable secret commands are configured, only the enable secret can be used to access privileged EXEC mode.
  • The enable password can be configured with the enable password command in global configuration mode. It is stored in the configuration as plaintext by default, but can be encrypted with the service password-encryption command (type 7).
  • The enable password remains in Cisco IOS as a legacy feature, but on modern devices the enable secret should be used instead.
  • The enable secret can be configured with the enable secret command in global configuration mode. It is stored in the configuration as a hash, using one of multiple hashing algorithms. The hashing algorithms available vary depending on the IOS version.
  • Media Digest 5 (MD5) is type 5 encryption, and script is type 9. script is more secure and should be used instead of MD5 if supported by the device.

FAQ

What is a shell, and how do GUI and CLI differ in Cisco networking?A shell is the program you use to interact with a device. A GUI uses windows/buttons, while a CLI uses text commands. For CCNA and day‑to‑day router/switch work, you primarily use the Cisco IOS CLI. One notable GUI you should recognize for CCNA is the Wireless LAN Controller (WLC) web interface.
How can I access the Cisco IOS CLI?Two methods: - Local console: Connect a PC to the device’s console port with a console cable. This does not use the network and is ideal for initial setup or recovery. - Remote network access: Use Telnet or, preferably, SSH over the network (covered later). This requires IP connectivity and device/VTY configuration. Only one console session (USB or RJ45) is active at a time.
Which console ports and cables are common on Cisco devices?Common console ports are USB Mini‑B and RJ45. You can use either, but only one at a time. For RJ45 console, use a rollover cable (pins are reversed: 1↔8, 2↔7, 3↔6, 4↔5). Console ports are for management only; they do not carry normal network traffic.
What terminal emulator settings should I use for a console connection?Typical Cisco console defaults: - Speed (baud): 9600 - Data bits: 8 - Stop bits: 1 - Parity: None - Flow control: None Configure these in your terminal emulator (for example, PuTTY Serial). You won’t be tested on the emulator itself, but these settings are essential for lab gear.
What is the System Configuration Dialog, and should I use it?It’s a step‑by‑step setup wizard shown on first boot. For CCNA practice and real operations, you typically skip it by typing “no” and configure the device directly with IOS commands.
What are the main IOS CLI modes and how do I move between them?- User EXEC (prompt: hostname>): basic view commands. - Privileged EXEC (prompt: hostname#): full show/operational control. Enter with enable; leave with disable. - Global configuration (prompt: hostname(config)#): change device configuration. Enter with configure terminal. Navigation tips: end or Ctrl+Z returns to privileged EXEC from any config mode; exit moves up one level. Use do in config mode to run EXEC commands (for example, do show clock).
How does context‑sensitive help and auto‑completion work in IOS?- ? lists available commands in the current mode. - command ? shows keywords/options for that command. - partial? (no space) shows possible completions for the typed prefix. - Tab auto‑completes if the prefix is unique. - You can execute unique partial commands with Enter (for example, en for enable). Many subcommands support the same behavior (for example, conf t for configure terminal). You can also use output modifiers like the pipe (|) with include to filter show output.
Which keyboard shortcuts speed up CLI work?- Cursor/editing: Left/Right arrows, Backspace, Ctrl‑A (start of line), Ctrl‑E (end of line), Ctrl‑U (delete to start). - Command history: Up/Down arrows. - Mode control: Ctrl‑Z (to privileged EXEC from config modes). These help fix typos and repeat/modify previous commands quickly.
What’s the difference between running‑config and startup‑config, and how do I save or erase configs?- running‑config: the active configuration in RAM; changes apply immediately but are lost on reload/power‑off. - startup‑config: the boot configuration stored in NVRAM; it’s loaded into running‑config at startup. Key commands: - View: show running-config, show startup-config (use Space/Enter at --More--; filter with | include). - Save: write, write memory, or copy running-config startup-config. - Factory reset path: erase startup-config (or write erase / erase nvram:) and then reload.
How do I secure privileged EXEC mode? What’s the difference between enable password and enable secret?- enable password: set with enable password in global config; stored in plaintext unless you enable service password-encryption (type 7), which is weak and easily reversible. - enable secret: set with enable secret; stored as a non‑reversible hash (for example, type 9 scrypt on newer IOS, type 5 MD5 on older). If both are configured, enable secret is used. Passwords are case‑sensitive. Best practice: always use enable secret; avoid relying on type 7 encryption.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Acing the CCNA Exam, Volume 1 ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Acing the CCNA Exam, Volume 1 ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Acing the CCNA Exam, Volume 1 ebook for free