Config Lab: CLI Passwords 1

 In 200-301 V1 Ch06: Switch Management, 200-301 V1 Part 2: Ethernet, 200-301 V1 Parts, Config Lab, Config Lab CCNA Vol 1 Part 2, Hands-on

Protecting access to the CLI of Cisco routers and switches starts with basic password security. From there, you can move on to use per-user login security that requires both a username and password, whether using locally-configured username/password pairs or whether taking advantage of the authentication servers already used by users inside the company. For the CCNA exam, though, you start with simple passwords. This lab gives you some practice configuring basic passwords (with no usernames) to protect CLI access.

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

Lab Requirements

Configure switch SW1 with password security for console, telnet, and privileged-mode access. Configure the passwords so that all users use the same password to reach user mode from the console, with no per-user username required. Likewise, use one password for all users who Telnet into the switch to reach user mode.

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. Use password “joy” to protect console access for all users to switch SW1.
  2. Use password “peace” to protect Telnet access for all users to switch SW1.
  3. Use password “kindness” to protect access to privileged mode for all users, using the more secure configuration option.

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.

hostname SW1
ip default-gateway 10.1.1.1
!
interface vlan1
 ip address 10.1.1.20 255.255.255.0

Example 1: SW1 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 Here

 

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)

Lab Answers

enable secret kindness
!
line con 0
 password joy
 login
!
line vty 0 4
 password peace
 login
!
line vty 5 15
 password peace
 login

Example: SW1 Config

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

Lab Commentary

Cisco routers and switches allow a simple security method for both the console and for Telnet access. Basically, all you have to do is tell the device to use that method by supplying a prompt for the password (the login subcommand), and then define the password’s value (the password subcommand).

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.

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 None No known issues related to this lab.

 

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.

    1. Connect to the console, and try to login with the configured password.
    2. Using the PC connected to a LAN interface, Telnet into the switch, and try the Telnet password.
    3. From either, use the enable command to then test the enable password.

More Labs with Related Content!

Free Play Labs - CCNA Vol 2, Chapter 10
Config Lab: CLI Passwords 2
Subscribe
Notify of
guest

6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ahmed

Hi, i configured the password for console access in Packet Tracer but when i try to connect from PC0 it doesn’t ask me for any password. Here’s an example of the code that i put

SW1#configure terminbal
SW1(config)#enable secret kindness

certskills

Ahmed,
The “enable secret kindness” command tells IOS to ask for a password when any user in user mode uses the enable EXEC command. The “enable” EXEC command tells IOS that the user wants to move to privileged mode, with “enable secret kindness” configured, the user should be prompted at that point, and IOS require “kindness”.
For a user to be prompted for a password before gaining access to user mode from the console, then configure:
line con 0
login
password whatever

I think that’s what you were expecting, right? A password prompt before gaining access at the console?

Or, for Telnet:
line vty 0 15
login
password whatever

Wendell

azzacam

Hello Mr. Wendell,

I extended this lab exercise to test if I could ping the switch from PC0 (and PC1) or if I could telnet to the switch from PC0.
I configured the switch as follows:
(config)# interface vlan 1
(config-if)# no shutdown
(config)# line vty 0 4
(config-line)# transport input telnet.

Result:
I cannot ping not telnet the switch.

What am I not doing right?

Azza

certskills

Hi Azza,
Wonderful! Some suggestions:
1) The vty’s need the subcommand that cause the switch to (a) prompt for a password, and (b) to define the password that is to be used. So, add “login” and “password azza” to the vty’s. I’m assuming you already configured the commands per the normal part of the lab.
Hope this helps…

Gordon

Hi Wendell,

I am making a slightly change for your configuration as below:

enable secret kindness
!
line con 0
password joy
login
!
line vty 0 4
password peace
login
Transport input Telnet

This is working as well. But I have a question is the command default Cisco transport input none, why does the pc have telnet access by your configuration.

Many Thanks,
Gordon

certskills

Hey Gordon,
Oddly enough, for reasons I don’t know, Cisco IOS switches have a default of “transport input all” and routers have a default of “transport input none”.
I just checked Packet Tracer, and it looks like it defaults to “transport input all” on both the switches and routers. I didn’t do a long test. Anyway, short version:
Real switch – default (all) allows Telnet. Real router – default (none) does not.
Packet Tracer appears to allow Telnet on both.

Wendell

Angel

Hello, isn’t there a missing line at the end of the answer?

13: login

Or is the 9th line with the login subcommand for vty lines 0 to 4 sufficient to make it work for vty lines 5 to 15?

6
0
Would love your thoughts, please comment.x
()
x