Lukej2680 Tech Blog

Cisco IOS Basics

This lab walks through the basic modes and commands available in Cisco IOS.

In this lab:

  • User Exec Mode
  • Privileged Exec Mode
  • Global Config Mode
  • IOS Configuration Management

User Exec Mode:
User exec mode is denoted by the ‘>’ character when using the command line.

This mode gives users access to basic commands that can be seen with the ? command.
In order to access additional commands you must elevate your privilege to additional modes.
user_exec

Privileged Exec Mode:
Privileged exec mode is denoted by ‘#’ character when using the command line.

Privileged exec mode is entered by using the enable command at user exec mode. You can also downgrade privileges by using disable command.
en_disable

Cisco IOS supports shortened commands, allowing us to use en as the same command as enable. Cisco IOS will infer the command when the characters can possibly only match on command. In order to view all possible matches use the ‘?’ character at the end of your command.
en_?

Using the ‘?’ character after using a space will show additional parameters for that command. When a command gives you more output then the screen can hold, you can cycle through by using the enter key to scroll one line at a time or the space key to scroll one page at a time.
en_space_?

Cisco IOS supports tab auto-completion.

Global Config Mode:
Global configuration mode is denoted by the ‘config’ characters when using the command line.

Here you can enter configuration commands that affect the device as a whole.

All valid commands entered in global config mode will be stored in the devices ‘running-config’. This file is viewed by using the command show running-config however surprisingly cannot be run from global config mode. This is a command only valid in privileged exec mode. In order to run a command from privileged exec mode (this works at any modes beside global config as well) we use the do keyword.
global_do

Cisco IOS supports piping commands, which is useful when crawling through logs. Some useful commands are;

  • do show run | begin hostname : Shows the running config, starting from first occurrence of ‘hostname’
  • do show run | include interface : Shows only the lines including ‘interface’
  • do show run | exclude interface: Shows only lines not including ‘interface’

Global config mode also allows us to enter interface configuration mode for the device interfaces. From there we can enter commands specifically for that interface.
To leave interface configuration mode use the exit command.
To downgrade to privileged exec mode use the end command.
global_int

IOS Configuration Management:
It is common practice to give the device a hostname in order to more easily keep track of devices. Here we will name this device ‘Router1’ using the hostname <hostname command.
copy_run_start

Here we see that our hostname was saved to the startup config and will now be persistent after a reboot.

Two other important commands are;

  • copy run flash : Copies the running config to flash memory
  • copy run tftp : Copies running config to external tftp server

This lab is a lab taken from Niel Andersons CCNA Udemy course. All work is mine however the lab itself is not my property.
All Labs were done using Cisco Packet Tracer.