16.4.7 Lab - Configure Network Devices With SSH - ILM
16.4.7 Lab - Configure Network Devices With SSH - ILM
Instructor Note: Red font color or gray highlights indicate text that appears in the instructor copy only.
Topology
Addressing Table
Device Interface IP Address Subnet Mask Default Gateway
Objectives
Part 1: Configure Basic Device Settings
Part 2: Configure the Router for SSH Access
Part 3: Configure the Switch for SSH Access
Part 4: SSH from the CLI on the Switch
Background / Scenario
In the past, Telnet was the most common network protocol used to remotely configure network devices.
Telnet does not encrypt the information between the client and server. This allows a network sniffer to
intercept passwords and configuration information.
Secure Shell (SSH) is a network protocol that establishes a secure terminal emulation connection to a router
or other networking device. SSH encrypts all information that passes over the network link and provides
authentication of the remote computer. SSH is rapidly replacing Telnet as the remote login tool of choice for
network professionals. SSH is most often used to log in to a remote device and execute commands.
However, it can also transfer files using the associated Secure FTP (SFTP) or Secure Copy (SCP) protocols.
The network devices that are communicating must be configured to support SSH in order for SSH to function.
In this lab, you will enable the SSH server on a router and then connect to that router using a PC with an SSH
client installed. On a local network, the connection is normally made using Ethernet and IP.
Note: The routers used with CCNA hands-on labs are Cisco 4221 with Cisco IOS XE Release 16.9.4
(universalk9 image). The switches used in the labs are Cisco Catalyst 2960s with Cisco IOS Release 15.2(2)
(lanbasek9 image). Other routers, switches, and Cisco IOS versions can be used. Depending on the model
and Cisco IOS version, the commands available and the output produced might vary from what is shown in
the labs. Refer to the Router Interface Summary Table at the end of the lab for the correct interface identifiers.
Note: Make sure that the routers and switches have been erased and have no startup configurations. If you
are unsure, contact your instructor.
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
Instructor Note: Refer to the Instructor Lab Manual for the procedures to initialize and reload devices.
Required Resources
1 Router (Cisco 4221 with Cisco IOS XE Release 16.9.4 universal image or comparable)
1 Switch (Cisco 2960 with Cisco IOS Release 15.2(2) lanbasek9 image or comparable)
1 PC (Windows with a terminal emulation program, such as Tera Term)
Console cables to configure the Cisco IOS devices via the console ports
Ethernet cables as shown in the topology
Instructions
Part 1: Configure Basic Device Settings
In Part 1, you will set up the network topology and configure basic settings, such as the interface IP
addresses, device access, and passwords on the router.
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
i. Configure and activate the G0/0/1 interface on the router using the information contained in the
Addressing Table.
router(config)# interface g0/0/1
router(config-if)# ip address 192.168.1.1 255.255.255.0
router(config-if)# no shutdown
j. Save the running configuration to the startup configuration file.
router# copy running-config startup-config
R1(config)#
*Jan 28 21:09:29.867: %SSH-5-ENABLED: SSH 1.99 has been enabled
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
Step 1: View the parameters available for the Cisco IOS SSH client.
Open configuration window
Use the question mark (?) to display the parameter options available with the ssh command.
S1# ssh ?
-c Select encryption algorithm
-l Log in using this user name
-m Select HMAC algorithm
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
-o Specify options
-p Connect to this port
-v Specify SSH Protocol Version
-vrf Specify vrf name
WORD IP address or hostname of a remote system
b. You can return to S1 without closing the SSH session to R1 by pressing Ctrl+Shift+6. Release the
Ctrl+Shift+6 keys and press x. The switch privileged EXEC prompt displays.
R1>
S1#
c. To return to the SSH session on R1, press Enter on a blank CLI line. You may need to press Enter a
second time to see the router CLI prompt.
S1#
[Resuming connection 1 to 192.168.1.1 ... ]
R1>
d. To end the SSH session on R1, type exit at the router prompt.
R1# exit
Reflection Question
How would you provide multiple users, each with their own username, access to a network device?
Type your answers here.
Answers may vary. You would add each user’s username and password to the local database using the
username command. It is also possible to use a RADIUS or TACACS server, but this has not been covered
yet.
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how many
interfaces the router has. There is no way to effectively list all the combinations of configurations for each router
class. This table includes identifiers for the possible combinations of Ethernet and Serial interfaces in the device.
The table does not include any other type of interface, even though a specific router may contain one. An example
of this might be an ISDN BRI interface. The string in parenthesis is the legal abbreviation that can be used in
Cisco IOS commands to represent the interface.
End of document
Router R1
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
platform qfp utilization monitor load 80
no platform punt-keepalive disable-kernel-core
!
hostname R1
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$GCE/$FYYjEAZLjxgbowhYaGm430
!
no aaa new-model
!
no ip domain lookup
ip domain name ccna-lab.com
!
login on-success log
!
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
subscriber templating
!
multilink bundle-name authenticated
!
no license smart enable
diagnostic bootup level minimal
!
spanning-tree extend system-id
!
username admin secret 5 $1$jamS$qnpkPO7Cr9pSdQxO7nSuQ.
!
redundancy
mode none
!
interface GigabitEthernet0/0/0
no ip address
negotiation auto
!
interface GigabitEthernet0/0/1
ip address 192.168.1.1 255.255.255.0
negotiation auto
!
interface Serial0/1/0
no ip address
!
interface Serial0/1/1
no ip address
!
ip forward-protocol nd
no ip http server
ip http secure-server
!
control-plane
!
banner motd ^C Authorized Users Only ^C
!
line con 0
password 7 094F471A1A0A
logging synchronous
login
transport input none
stopbits 1
line aux 0
stopbits 1
line vty 0 4
password 7 01100F175804
login local
transport input telnet ssh
!
end
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
Switch S1
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname S1
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$qwAh$PG.EaIxZQgvrgZtc40Xka0
!
username admin secret 5 $1$vE96$6FO83f1rHurSYktgg2l720
!
no aaa new-model
system mtu routing 1500
no ip domain-lookup
ip domain-name ccna-lab.com
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
interface FastEthernet0/1
!
interface FastEthernet0/2
shutdown
!
interface FastEthernet0/3
shutdown
!
interface FastEthernet0/4
shutdown
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
shutdown
!
interface FastEthernet0/8
shutdown
!
interface FastEthernet0/9
shutdown
!
interface FastEthernet0/10
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
shutdown
!
interface FastEthernet0/11
shutdown
!
interface FastEthernet0/12
shutdown
!
interface FastEthernet0/13
shutdown
!
interface FastEthernet0/14
shutdown
!
interface FastEthernet0/15
shutdown
!
interface FastEthernet0/16
shutdown
!
interface FastEthernet0/17
shutdown
!
interface FastEthernet0/18
shutdown
!
interface FastEthernet0/19
shutdown
!
interface FastEthernet0/20
shutdown
!
interface FastEthernet0/21
shutdown
!
interface FastEthernet0/22
shutdown
!
interface FastEthernet0/23
shutdown
!
interface FastEthernet0/24
shutdown
!
interface GigabitEthernet0/1
shutdown
!
interface GigabitEthernet0/2
shutdown
!
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 11 www.netacad.com
Lab - Configure Network Devices with SSH
interface Vlan1
ip address 192.168.1.11 255.255.255.0
!
ip classless
ip http server
ip http secure-server
!
banner motd ^C Authorized Users Only ^C
!
line con 0
password 7 00071A150754
logging synchronous
login
line vty 0 4
password 7 00071A150754
login local
transport input telnet ssh
line vty 5 15
login
!
end
2013 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 11 www.netacad.com