University of Education
Jauharabad Campus
Laboratory Exercises
For
Network Design & Management
Lab
Lab Instructor Hafiz Muhammad Shafiq
Course Instructor Hafiz Muhammad Shafiq
Course code ITEC4117
Semester 8
Department of Information and Technology
Lab : 06
Learning Objectives
• Accessing the Router Remotely & WAN
WAN:
wideareanetwork(WAN)isatelecommunicationsnetworkorcomputernetworkthatextends
A
over a large geographical distance. Wide area networks often are established with leased
telecommunication circuits.
Business, education and government entities usewideareanetworkstorelaydataamongstaff,
students, clients, buyers, and suppliers from various geographical locations.
VTYstands for Virtual Teletype. I’m sure you alreadyknow the virtual interfaces, so the “vty”
is a kind of virtual interface that is used to get CLI access to a Cisco Router or Switch over
Telnet/SSH. All the connections are remotely over the network, so there is no hardware
associated with it.
he command, line vty 0 4, will open 5 virtual interfaces, i.e. (0,1,2,3,4) for remote access. That
T
means, 5 different administrators/connections can access the Cisco Router/Switch
simultaneously using Telnet or SSH. Cisco hardware supports a maximum of 16 line virtual
interfaces, i.e. (0,1,2,3,…,15).
Telnet:
elnet is a user command and an underlyingTCP/IPprotocolforaccessingremotecomputers,
T
routersorswitches.ThroughTelnet,anadministratororanotherusercanaccesssomeoneelse's
computer, router or switch remotely.With Telnet, you log on as a regular user with whatever
privileges you may have been granted to the specific application and data on that computer,
router or switch. Telnet uses VTY lines on Cisco IOS. Telnet is less secure and not encrypted.
SSH:
ecureShell(SSH),isaprotocolforsecurelygettingaccesstoaremoterouter.Itiswidelyused
S
bynetworkadministratorstocontrolroutersremotely.SSHcommandsareencryptedandsecure
in several ways. Both ends of the client/server connection are authenticated using a digital
certificate, and passwords are protected by being encrypted.
Enable Telnet and SSH on Cisco Router:
Go to the router console and configure telnet with the “line vty” command.
Router>enable
Router#config t
outer(config)#line vty 0
R //The“linevty”vty(virtualterminal)command
enable the telnet and the “0 ″ is just let a singlelineorsessiontotherouter.Ifyouneedmore
sessions simultaneously, you must type “line vty 010“.
outer(config-line)#passwordPass123
R //The“password”commandsetthe“P
ass123”as
password for telnet. You can set your own password.
outer(config-line)#login
R //The“login”commandauthenticateandaskyou
the password of telnet. If you type “n
o login” command,thetelnetneverauthenticatesforthe
password which is not a good practice in a real network environment.
outer(config-line)#loggingsynchronous //The“loggingsynchronous”commandstopsany
R
message output from splitting your typing.
Router(config-line)#exec-timeout 40 //The “exec-timeout” command just sets the
time-out limit on the line from the default to “40″minutes.
outer(config-line)#motd-banner
R //Themotd-bannerforcesabannermessageto
appear when logging in.
outer(config-line)#exit
R
OK, the Telnet services enabled successfully. But you must set the enable password for the
router in order to control it remotely.
Router(config)#enable password Pass123
Router(config)#exit
Testing Telnet Connectivity:
Co
nnect the PC to the router using an Ethernet cableand assign IP address 192.168.10.1 to the
PC.
Assign IP address to router interface using the following commands:
Router>enable
Router#config t
Router(config-if)#interface GigabitEthernet 0/0/0
Router(config-if)# ip address 192.168.10.3 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)#exit
Router(config)#exit
Ensure that the PC and router are on the same network.
Open Command Prompt on the PC.
ype the Telnet command followed by the IP address of the router (e.g., 192.168.10.3) to test
T
connectivity,then enter the telnet password. Nexttype enable command and press enter, then
type the router password
SSH Configuration:
ecure Shell or SSH is a secure protocol and the replacement for Telnet and other insecure
S
remote shell protocols. So for secure communication between network devices, I strongly
recommend using SSH instead of Telnet.
efore configuring SSH, firstly, we willconfigureIPaddressesoftherouterinterfaceandthe
B
PC. We will use the below IP addresses:
Router Interface
IP : 192.168.10.3
Subnet : 255.255.255.0
PC
IP : 192.168.10.2
Subnet : 255.255.255.0
Router #configure terminal
Router (config) #interface GigabitEthernet
Router (config-if) #ip address 192.168.10.3 255.255.255.0
Router (config-if) #no shutdown
Router(config-if)#exit
e need to change the default router name to generate an rsa key. Here, the default
W
name is Router, let’s change this name toAdmin.
Router(config)#hostname Admin
Domain Name and Data Encryption:
I nthisstep,wewillsetthedomainname.OurdomainnamewillbeSSHabc.Andafterthat,we
will encrypt the data in it with the “crypto key generatersa” command.
Admin (config) #ip domain-name SSHabc
dmin (config)#cryptokeygeneratersa //Type“cryptokeygeneratersa”command
A
and press enter, when ask you “How many bits in the modulus[512]:”justtype“1024″
and press enter. Thesystemwillgenerate1024bitskeystosecuresessionlines.Youcan
choose modulus in the range of 360 to 2048
Set an enable password.
dmin(config)#enable password admin //here password is admin you can use any
A
password of your choice
Set username and password for local login.
Admin(config)#username Admin password admin
Specify the SSH version to use.
Admin(config)#ip ssh version 2
Now connect to the VTY lines of the switch and configure SSH on the lines.
Admin(config)#line vty 0 15 //configure SSH for16 usersfrom0 to 15
Admin(config-line)#transport input ssh
Admin(config-line)#login local
hat’s all for SSH configuration on the switch. Move on andtrytoaccesstherouterremotely
T
from the PC.
So then:
nthecommandpromptoftheAdminPC,openaSSHsessiontotheswitchusingthecommand
O
ssh -l Admin 192.168.10.3
ote that: admin is the username defined in step5while192.168.10.3istheIPaddressofthe
N
VLAN interface of then switch
Activity 1:Build and test below topology using Telnet
Activity 2:Build and test below topology using SSH
References:
1. h ttps://computernetworking747640215.wordpress.com/2018/07/05/configuring-telnet-on-a-swi
tch-and-a-router-in-packet-tracer/
2. https://ipcisco.com/lesson/ssh-configuration-on-packet-tracer/
3. https://linuxtiwary.com/2017/03/05/ssh-configuration-on-cisco-router-ccna-lab/
4. https://www.gns3network.com/cisco-line-vty-0-4/