CCNA Deep Dive #1:
Cisco CLI and Packet Tracer Basics

Lab 2: Exploring and Navigating Cisco IOS CLI Modes

Lab 2 Introduction

Lab 2 helps you learn about the Cisco CLI by experiencing User, Enable, and Config modes, navigating between all these modes. In particular:

Part A: CLI Modes and Command Prompts – Focused on first-time CLI learners, Part A walks you through the different modes of the CLI as identified by different command prompts. This part focuses on navigation between the modes.

Part B: User and Enable EXEC Modes – Part B asks you to re-examine the two EXEC modes, where you type commands and get some kind of response that shows information about the device.

Part C: Experiencing Commands in Different Config Modes – Part C asks you to experiment with a few configuration mode commands – commands chosen to show you how the different submodes of configuration mode work.

Bonus: Command Help, History, and Popular Commands – If you finish the lab, and would like more to learn, use the Bonus section to learn about command help, command history, and try some of the most common commands on both routers and switches.

Lab 2 Introduction

Part A of this lab guides you through the navigation between the different modes of the CLI. For reference, Figure 2A-1 shows the topology used throughout this lab.

In this Lab Part, you will take these steps:

A.1 Open PT File Used for this Lab

A.2 Navigate User and Enable (Privileged) Mode

A.3 Navigate In and Out of Configuration Mode

Figure 2A-1 – Topology Used for Lab 2

 

A.1 Open the PT File Used for this Lab

Open the .pkt file for this lab to get ready to perform the lab.

  1. First, remember the directory where you are keeping all your PT files for the course – a directory that should now have subdirectories /original and /working. ________________
  2. Download the .pkt file for this lab and put a copy in both the /original and /working subfolders. Note the file name for future reference: ____________
  3. Start the Packet Tracer app and login as needed.
  4. Once PT has finished starting, open this lab’s .pkt file.
  5. Open the detail window for router R1 by clicking the R1 icon and moving to the CLI tab in that window.

 

A.2 Navigate User and Enable (Privileged) Mode

Navigate into both user and enable (privileged) EXEC modes of router R1, paying close attention to the command prompts. (You could use any router or switch in the topology to do these steps; the instructions refer to R1.) Note that the switches and routers all have been pre-configured with a console password and enable mode password.

  1. From the router R1 CLI, click inside the window and press enter. (You should now see a password prompt.)
  2. Type the console password (cisco) and press enter.
  3. What command prompt appears on the final line? What mode have you reached? _______________________
  4. Attempt the show running-config command. Does the command show any output? Why? __________________
  5. Type the enable command and then supply the enable password (cisco).
  6. What command prompt appears on the final line? What mode have you reached? _______________________
  7. Attempt the show running-config command. Does the command show any output? Why? __________________

 

 

A.3 Navigate In and Out of Configuration Mode

Next, move from enable mode into configuration mode to experience the different prompts seen in configuration mode.

  1. You should be in enable mode at this point. If not, navigate back to enable mode.
  2. Use the configure terminal command to enter global configuration mode.
  3. What command prompt appears on the final line? What mode have you reached? _______________________
  4. Pay close attention to the command prompt, which should show “R1(config)#”. The “(config)#” identifies global configuration mode. Some configuration mode commands move you to a submode. So, move to interface configuration submode for interface G0/0 using the interface gigabitethernet0/0 command.
  5. What command prompt appears on the final line? How is it different from the previous prompt? What mode have you reached? _______________________
  6. Use the exit command to move back to configuration mode, noting the change in the command prompt.
  7. The CLI allows for commands to be abbreviated so long as each term is a unique abbreviation. You can experiment with abbreviations throughout the lab, but you should attempt at least one abbreviated command. To do so, repeat the interface gigabitethernet0/0 command, but instead of typing the whole command, use the int g0/0 command.
  8. Does it appear that you reached interface configuration mode again? What is the command prompt? _______________________
  9. Use the end command, or CNTL-Z, to exit back to enable mode.

Lab 2 Part B: Experiencing Differences between User and Enable Mode

Part B of this lab focuses on the kinds of commands you can use in user and privileged EXEC modes, introducing a number of the most common IOS commands.

In this Lab Part, you will take these steps:

B.1 Using Command Help (?) in EXEC Modes

B.2 Understanding IOS Config Files

 

B.1 Using Command Help (?) in EXEC Modes

Use help (the ?) to list the EXEC commands available in both user and enable mode.

  1. You should be in user EXEC mode on router R1 to take the next steps. If not, navigate to user mode. If unsure how to do so, keep using the exit command until you logout of the router; then login again, and you will be in user mode, with a prompt of “R1>”.
  2. Type a question mark to get command help. Approximately how many commands does PT list? _______________
  3. Move to privileged mode using the concepts learned earlier in this lab. Your prompt should be “R1#” once in that mode.
  4. Again type a question mark to get command help. Approximately how many commands does PT list? _______________

 

B.2 Understanding IOS Config Files

IOS stores the currently-used configuration in the “running-config” file, and the configuration loaded at the next reload of the device in the “startup-config” file. Access to those files requires privileged mode. This section uses that fact to explore the differences between user and privileged mode.

  1. You should be in privileged (enable) mode at this point. If not, navigate back to privileged mode.
  2. Use the show running-config and show startup-config commands to display the contents of the two configuration files.
  3. Use the disable command to move back to user mode, and again display the two configuration files. How do the results differ? _____________________
  4. Type a question mark to get command help. Do you see either the show running-config and show startup-config commands? _______________
  5. While still in user mode, use the reload command to attempt to reload (reboot) the router. If prompted, respond so that the device reloads. What happens? _____________________
  6. Move back to privileged mode and attempt the reload command again. If prompted, respond so that the device reloads. What happens? _____________________

Lab 2 Part C: Experiencing Commands Supported in Config Mode(s)

User mode and privileged mode (enable mode) are both EXEC modes. As such, they support EXEC commands, but not configuration commands. The difference is simple and obvious once you understand it, but it also causes new users some problems. Also, learning which commands are EXEC and which are config commands just takes time and experience. Part C gives you a chance to experience some of these features and learn some of the common configuration commands.

In this Lab Part, you will take these steps:

C.1 Config Mode Commands from EXEC Mode

C.2 Config Mode Commands from Config Mode

C.3 EXEC Mode Commands from Config Mode

 

C.1 Config Mode Commands from EXEC Mode

First, experience how you cannot issue config commands from an EXEC mode following these steps that use the hostname and description config commands.

  1. Move back to privileged (enable) mode on router R1 by using the enable command (with password “cisco.”) Your prompt should read “R1#” before you proceed with the next steps.
  2. Use the hostname R1-yourname config command to attempt to set the router’s hostname. (You can put your name into the hostname instead of “yourname”.) How does the router respond? _____________________
  3. Try to get help for the hostname command while still in enable mode. Do you find the command? ____________________
  4. Repeat the last two steps while instead attempting the description this interface connects to switch SW1 command. (The command, when used correctly, would add the text description to an interface’s configuration.) _____________________
  5. Try to get help for the description command while still in enable mode. Do you find the command? ____________________

 

C.2 Config Mode Commands from Config Mode

The next few steps examine the commands listed by the ? command in enable mode versus global configuration mode.

  1. If not there, move back to privileged (enable) mode by using the enable command (with password “cisco”.) Your prompt should read “R1#” before you proceed with the next steps.
  2. Use the ? command to list all commands supported in privileged mode. Approximately how many commands do you see? Do you see the hostname or description config commands listed? _____________________
  3. Use the configure terminal command (or any valid abbreviation) to move into global configuration mode. For review: what part of the command prompt confirms you are now in global config mode, and not in some configuration submode? ____________
  4. Use the hostname R1-yourname command to attempt to set the router’s hostname. (You can put your name into the hostname instead of “yourname”.) How does the router respond? _____________________
  5. Record the current command prompt. How does it differ from the previous command prompt? ___________________
  6. Use the ? command while still in global config mode. Do you find the hostname command listed? ____________________
  7. Use the description this interface connects to switch SW1 command to attempt to set some descriptive text to an interface. How does the router respond? _____________________
  8. Use the ? command while still in global config mode. Do you find the description command listed? ____________________
  9. Move into interface configuration mode for interface G0/0 using the interface gigabitethernet0/0 global command (or use any valid abbreviation).
  10. Again attempt the description this interface connects to switch SW1 command to attempt to set some descriptive text to an interface. How does the router respond? _____________________
  11. Use the ? command while still in global config mode. Do you find the description command listed? How about the hostname command? ____________________
  12. Record the current command prompt. What mode or submode are you in? ____________________________
  13. Use the end command, or CNTL-Z, to exit back to enable mode.

Note that the description command, like the vast majority of IOS configuration commands, happens to be a configuration subcommand rather than global configuration command. That means that IOS only accepts the description command in the correct submode (interface mode in this case). Subcommands have no meaning in global configuration mode or other configuration submodes other than the correct submode.

 

C.3 EXEC Mode Commands from Config Mode

Configuration commands must be issued in configuration mode, including the fact that configuration subcommands can only be used from the correct configuration submode. However, you can issue EXEC commands from configuration mode – as long as you use the do command as detailed in the next labs steps.

  1. If not there yet based on the previous lab steps, move back to privileged (enable) mode by using the enable command (with password “cisco”.)
  2. Use the configure terminal command (or any valid abbreviation) to move into global configuration mode.
  3. Issue the show ip interface brief command – a popular EXEC command – to list all interfaces and interface IP addresses. What info does IOS display in return? ______________________________________
  4. Issue the same command again, but with the word do in front. For example, use the do show ip interface brief What info does IOS display in return? ______________________________________
  5. Use the ? command and show ? command to get command help. Can you find help for the show ip interface brief command while in configuration mode? What kind of help is listed? _____________________
  6. Use the end command, or CNTL-Z, to exit back to enable mode.
  7. Use the ? command and show ? commands while in privileged mode to get command help. Can you find help for the show ip interface brief command while in configuration mode? What kind of help is listed? _____________________

Lab 2 Bonus: Command Help, History, and Popular Commands

For those of you who finish the earlier parts of the lab before we reconvene class, consider doing the following activities to learn a little more:

  1. Experiment using the reload command while in user, enable, and global config modes.
  2. Experiment with the Top N commands as listed in class (repeated below in Table 2D-1) on both routers and switches.
  3. Try the ? command to get command help in user, enable, and global config mode, as well as in all configuration submodes you can remember/find. Reference Figure 2D-1 to find some reminders.
  4. After issuing some commands on a device, experiment with the command recall and command edits keyboard shortcuts. You can use these steps:
    1. Begin in enable mode.
    2. Use the up arrow (or CNTL-p) to list the previous command in the command history list.
    3. Use the down arrow (or CNTL-f) to move forward in the command history.
    4. Use the show history command to list the command history on the device.
    5. Retrieve a command from the command history and use the left-arrow and backspace keys to change the command. Once changed, press enter to run the command.
    6. Type a possible abbreviation and use the right-tab key to complete the spelling of the word.
    7. Type a possible abbreviation and then a ?, with no space, to find out if the abbreviated word is unique or not.
Reference Switch Router
1 show interfaces show interfaces
2 show interfaces status show ip interface brief
3 show mac address-table show ip route
4 show spanning-tree show ip route ospf
5 show interfaces switchport show ip route connected
6 show interfaces trunk show ip arp
7 show vlan show ip protocols
8 show vlan brief show ip ospf
9 show vlan id 1 show ip ospf neighbors
10 show running-config show running-config
11 show startup-config show startup-config
12 ping ping
13 traceroute traceroute
14 telnet telnet
15 ssh ssh
16 reload reload
17 configure terminal configure terminal
18 enable enable

Table 2D-1 – Common EXEC Commands on Cisco Routers and Switches

 

Figure 2D-1 – Some IOS Configuration Modes w/ Navigation