You are on page 1of 5

Telnet and SSH Configuration:

Topology:
Add 2 PCs, 2 Switches (2960) and Router (1941) to the workplace.

Cabling:
Select copper straight through to connect PC s to the Switches.
Select copper straight through to connect Switches to the Router.

PC’s Interfaces Switch’s Interfaces


PC0 (FastEthernet0) Switch 0 (Fast Ethernet 0/1)
PC1 (FastEthernet0) Switch 1 (Fast Ethernet 0/1)

Switch’s Interfaces Router’s Interfaces


Switch 0 (Fast Ethernet 0/2) Router (GigabyteEthernet0/0)
Switch 1 (Fast Ethernet 0/2) Router (GigabyteEthernet0/1)

IP Address:
PC0: Router (GigabyteEthernet0/0)
IP Address: 192.168.2.2 192.168.2.1
Subnet mask:255.255.255.0 255.255.255.0
Default Gateway: 192.168.2.1
PC1: Router (GigabyteEthernet0/1)
IP Address: 192.168.1.2 192.168.1.1
Subnet mask:255.255.255.0 255.255.255.0
Default Gateway: 192.168.1.1
Step 1: To provide an IP address to a host (PC) just select that PC→
Desktop → IP Configuration → IPv4 Addresses and provide an IP address
then ENTER, the Subnet Mask will be provided by default and add default
gateway as shown in the table above.

Router Configuration:
To provide an IP address to the router interfaces just click on the router and
select CLI

Router>enable
Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface g0/0
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed
state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface
GigabitEthernet0/1, changed state to up
Router(config-if)#exit
Router(config)#interface g0/1
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed
state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface
GigabitEthernet0/1, changed state to up
Router(config-if)#exit

Telnet Configuration:
Router(config)# enable secret cisco
Router(config)#username admin2 password cisco2
Router(config)#line vty 0 4
Router(config-line)# login local
Router(config-line)#end
Telnet Test:

To test Telnet, click on PC1 → Desktop → Command Prompt

Packet Tracer PC Command Line 1.0


C:\>telnet 192.168.1.1 (Then now you can access to the Router
remotely from the PC)
Trying 192.168.1.1 ...Open
User Access Verification
Username: admin2
Password: cisco2
Router>enable
Password: cisco
Router#
Router#

Note:
Then now you can access to the Router remotely from the PC
SSH Configuration:
Router>
Router>enable
Password:
Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#ip domain-name cisco.com
R1(config)#crypto key generate rsa
The name for the keys will be: R1.cisco.com
Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may
take a few minutes.

How many bits in the modulus [512]: 512


% Generating 512bit RSA keys, keys will be non-exportable...[OK]
R1(config)#username admin3 password cisco3
*Mar 1 0:37:58.2: RSA key size needs to be at least 768 bits for
SSH version 2
*Mar 1 0:37:58.2: %SSH-5-ENABLED: SSH 1.5 has been
enabled
R1(config)#line vty 0 4
R1(config-line)#login local
R1(config-line)#transport input ssh
R1(config-line)#exit
R1(config)#line vty 0 4
R1(config-line)#login local
R1(config-line)#transport input ssh
R1(config-line)#exit
R1(config)#ip ssh time-out 90
R1(config)#ip ssh authentication-retries 2
R1(config)#ip ssh version 2
Please create RSA keys (of at least 768 bits size) to enable SSH
v2.
R1(config)#end
SSH Test:

To test SSH click on PC0 → Desktop → Command Prompt

C:\>ssh -l admin3 192.168.2.1

Password: cisco3
R1>enable
Password: cisco
R1#

Note that:
- Now you can access to the Router remotely from the PC.
- But after SSH configuration you cannot access to the Router
remotely from the PC by using Telnet

C:\>telnet 192.168.2.1
Trying 192.168.2.1 ...Open
[Connection to 192.168.2.1 closed by foreign host]
C:\>

You might also like