Config Lab: CLI Passwords 2

Wendell Odom
By Wendell Odom August 27, 2021 11:05

The simplest way to protect the CLI uses passwords shared by all, rather than a per-user username and password. Using a per-user login method improves security. The easiest option for using per-user logins in a Cisco lab is configuring the username/password pairs in each Cisco router or switch. Today’s lab asks you to do just that: configure several username/password pairs, and enable their use.

All about Config Labs

The blog has a series of lab exercises called “Config Labs.” Each lab presents a topology with the relevant initial configuration for each device. The lab also lists new requirements, after which you should create the additional configuration to meet those requirements. You can do the lab on paper, in a text editor, or use software tools like Cisco Packet Tracer or Cisco Modeling Labs.

Once you have created your answer, you can click various tabs at the bottom of this post to see the lab answers, comments about the lab, and other helpful information.

The Lab Exercise

Requirements

Configure Switch SW1 with password security with a per-user username required for the three allowed users. The passwords and user names will be stored locally on the switch.

This lab begins with all the interfaces shown in Figure 1 working, with IPv4 addresses configured, and with all hosts able to ping other local hosts and hosts in the rest of the Enterprise.

The specific rules for this lab are as follows:

  1. Enable the use of local usernames for login from the console and when using Telnet.
  2. Create a user: Use password “hope” for user “allison”.
  3. Create a user: Use password “love” for user “danielle”.
  4. Create a user: Use password “faith” for user “tyler”.

Figure 1: Network for this Lab, with Console Access Switch SW1

 

Initial Configuration

Example 1 shows the non-default configuration added to switch SW1 before your work for this lab begins. Basically, the switch has already been configured with an IP address and a default gateway to allow telnet access.

Example 1: SW1 Initial Configuration

* Note that the no shutdown command is likely unnecessary on real gear, but may be on some virtualization platforms, so we include it here in the initial configuration.

Answer Options - Click Tabs to Reveal

You can learn a lot and strengthen real learning of the topics by creating the configuration – even without a router or switch CLI. In fact, these labs were originally built to be used solely as a paper exercise!

To answer, just think about the lab. Refer to your primary learning material for CCNA, your notes, and create the configuration on paper or in a text editor. Then check your answer versus the answer post, which is linked at the bottom of the lab, just above the comments section.

You can also implement the lab using the Cisco Packet Tracer network simulator. With this option, you use Cisco’s free Packet Tracer simulator. You open a file that begins with the initial configuration already loaded. Then you implement your configuration and test to determine if it met the requirements of the lab.

(Use this link for more information about Cisco Packet Tracer.)

Use this workflow to do the labs in Cisco Packet Tracer:

  1. Download the .pkt file linked below.
  2. Open the .pkt file, creating a working lab with the same topology and interfaces as the lab exercise.
  3. Add your planned configuration to the lab.
  4. Test the configuration using some of the suggestions below.

Download Packet Tracer File

You can also implement the lab using Cisco Modeling Labs – Personal (CML-P). CML-P (or simply CML) replaced Cisco Virtual Internet Routing Lab (VIRL) software in 2020, in effect serving as VIRL Version 2.

If you prefer to use CML, use a similar workflow as you would use if using Cisco Packet Tracer, as follows:

  1. Download the CML file (filetype .yaml) linked below.
  2. Import the lab’s CML file into CML and then start the lab.
  3. Compare the lab topology and interface IDs to this lab, as they may differ (more detail below).
  4. Add your planned configuration to the lab.
  5. Test the configuration using some of the suggestions below.

Download CML File

 

Network Device Info:

This table lists the interfaces listed in the lab exercise documentation versus those used in the sample CML file.

Device Lab Port  CML Port
SW1 G0/1 G0/1
SW1 F0/1 G0/2
SW1 F0/2 G0/3

Host device info:

This table lists host information pre-configured in CML, information that might not be required by the lab but may be useful to you.

Device IP Address Mac Address User/password
PC 10.1.1.11 02:00:11:11:11:11 cisco/cisco
S 10.1.1.22 02:00:22:22:22:22 cisco/cisco

Lab Answers Below: Spoiler Alert

Lab Answers: Configuration (Click Tab to Reveal)

Answers

Example: SW1 Config

Commentary, Issues, and Verification Tips (Click Tabs to Reveal)

Commentary

Cisco switches allow for different username and passsword pairs to be used for access to the console, and with Telnet or SSH, instead of a single all-users password.

The global command username name password password creates the username password pairs in one switch. To tell the switch to make use of these local username/password pairs, you must then configure the login local command in vty configuration mode (for Telnet/SSH) or console configuration mode (for console access).

Note that the answer shows the configuration of the VTY password (to support Telnet) with VTYs 0 through 4 as separate from the configuration of VTYs 5 through 15. This quirk of Cisco output has to do with the fact that older IOS versions support only VTYs 0 through 4. You could have used the commands literally shown in the answer example, or you could have used the command line vty 0 15, followed by those same password and login commands.

Finally, if you did happen to use the username name secret password command, that command also meets the requirements of the lab as stated.

Known Issues in this Lab

This section of each Config Lab Answers post hopes to help with those issues by listing any known issues with Packet Tracer related to this lab. In this case, the issues are:

# Summary Detail
1 PT adds extra configuration When you configure the username command in PT, PT adds the privilege 1 parameters (meaning user mode) if you do not configure the privilege keyword. Real gear simply omits the privilege 1.

 

Why Would Cisco Packet Tracer Have Issues?

(Note: The below text is the same in every Config Lab.)

Cisco Packet Tracer (CPT) simulates Cisco routers and switches. However, CPT does not run the same software that runs in real Cisco routers and switches. Instead, developers wrote CPT to predict the output a real router or switch would display given the same topology and configuration – but without performing all the same tasks, an actual device has to do. On a positive note, CPT requires far less CPU and RAM than a lab full of devices so that you can run CPT on your computer as an app. In addition, simulators like CPT help you learn about the Cisco router/switch user interface – the Command Line Interface (CLI) – without having to own real devices.

CPT can have issues compared to real devices because CPT does not run the same software as Cisco devices. CPT does not support all commands or parameters of a command. CPT may supply output from a command that differs in some ways from what an actual device would give. Those differences can be a problem for anyone learning networking technology because you may not have experience with that technology on real gear – so you may not notice the differences. So this section lists differences and issues that we have seen when using CPT to do this lab.

Beyond comparing your answers to this lab’s Answers post, you can test in Cisco Packet Tracer (CPT) or Cisco Modeling Labs (CML). In fact, you can and should explore the lab once configured. For this lab, once you have completed the configuration, try these verification steps. 

  • Connect to the console and try to login with the configured username/password combinations.
  • Telnet into the switch and try the same username/password combinations there as well.

 

More Labs with Related Content!

Config Lab: CLI Passwords 1
Config Lab: Enabling SSH and Disabling Telnet
Wendell Odom
By Wendell Odom August 27, 2021 11:05
Write a comment

2 Comments

  1. Kevin Mx October 18, 17:14

    why you used “0” after the command “password”?

    Reply to this comment
    • certskills October 19, 11:16

      Hey Kevin,
      Well, because I copied the config from the device when I made this post. I’ll remove the 0s to avoid confusion. Here’s the longer version:

      In the command **username allison password 0 hope**, the zero refers to the level of password encryption, with 0 meaning “none”, which is the level used with this command. If you had instead typed **username allison password hope**, IOS would have chosen the encryption level of 0, and added the 0 into the command in the running-config.

      Hope this helps…

      Reply to this comment
View comments

Write a comment

Leave a Reply to certskills Cancel reply

Subscribe

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Search

Categories