CN-Lab-6-Basic-Router-Configuration Mubashir Hussain 4979
CN-Lab-6-Basic-Router-Configuration Mubashir Hussain 4979
CN-Lab-6-Basic-Router-Configuration Mubashir Hussain 4979
LAB NO. 06
BASIC CONFIGURATIONS OF ROUTER
Following are the lab objectives:
Objectives
Lab
Sir_Asad_Ha
nif
Lab Instructor
1
CS 306 – Computer Network Lab Manual
CLOs
Lab Objectives
a B C
1
2
Instructions
This is individual Lab work/task.
Complete this lab work within lab timing.
Discussion with peers is not allowed.
You can consult any book, notes & Internet.
Copy paste from Internet will give you negative marks.
Lab work is divided into small tasks, complete all tasks sequentially.
Show solution of each lab task to your Lab Instructor.
In-Lab Exercises/Tasks
Write your code at provided space after each question
You need to upload code for all tasks at Google Class.
2
CS 306 – Computer Network Lab Manual
3
CS 306 – Computer Network Lab Manual
CPU
The CPU executes operating system instructions, such as system initialization,
routing functions, and switching functions.
RAM
RAM stores the instructions and data needed to be executed by the CPU. RAM is
used to store these components:
Operating System: The Cisco IOS (Internetwork Operating System) is copied
into RAM during bootup.
Running Configuration File: This is the configuration file that stores the
configuration commands that the router IOS is currently using. With few
exceptions, all commands configured on the router are stored in the running
configuration file, known as running-config.
IP Routing Table: This file stores information about directly connected and
remote networks. It is used to determine the best path to forward the packet.
ARP Cache: This cache contains the IPv4 address to MAC address mappings,
similar to the ARP cache on a PC. The ARP cache is used on routers that have
LAN interfaces such as Ethernet interfaces.
Packet Buffer: Packets are temporarily stored in a buffer when received on an
interface or before they exit an interface.
RAM is volatile memory and loses its content when the router is powered down or
restarted. However, the router also contains permanent storage areas, such as ROM,
flash and NVRAM.
ROM
ROM is a form of permanent storage. ROM uses firmware, which is software that is
embedded inside the integrated circuit. Firmware includes the software that does not
normally need to be modified or upgraded, such as the bootup instructions. Many of
these features, including ROM monitor software, will be discussed in a later course.
ROM does not lose its contents when the router loses power or is restarted.
4
CS 306 – Computer Network Lab Manual
Common Commands
As a security feature, Cisco IOS provides separate commands into two different
access level modes; user EXEC level and privileged EXEC level.
User EXEC level: allows a person to access only a limited number of basic
monitoring commands. In this mode, the router or switch prompt is displayed as:
hostname>
The right arrow (>) in the prompt indicates that the router or switch is at the user
EXEC mode.
Privileged EXEC level: allows a person to access all router commands (including
configuration and management) and can be password protected to allow only
authorized people to access the router. In this mode the symbol “# “is displayed as the
prompt.
hostname#
There is also a sublevel of the Privileged Exec level, the configuration level.
From privileged mode, you can monitor devices, view the status of interfaces, or run
debugging. However, if you want to change the configuration of the router, you must
enter configuration mode.
5
CS 306 – Computer Network Lab Manual
In this section you will be introduced to basic router commands that will run either in
the user exec or privileged level. You are required to familiarize yourself by using the
commands as instructed and looking at the outputs.
Open Packet Tracer.
Select existing topology or create new simple topology with Cisco 2621XM
series router connected with 2 generic end devices.
Click on router, in config tab Erase NVRAM and go to CLI tab
Now you should be prompted with Router > which shows that you are
working in the user exec level. Use the Help command? to see the list of
available commands in the user exec level.
Router > ?
When the word “more” appears, press the space bar to display the next page of
information.
Practice the frequently used user exec commands from table 1 by typing the
commands and pressing Enter.
Press the up arrow to see or reuse the last entered command. Press it again to
go to the command before that. Press the down arrow to go back through the
list.
Enter the Privileged EXEC level.
Router # ?
6
CS 306 – Computer Network Lab Manual
Router# configure terminal [Enter]
Practice the frequently used configuration commands from table 3. Use also the help
command “?” to see available commands.
7
CS 306 – Computer Network Lab Manual
8
CS 306 – Computer Network Lab Manual
To check the connection between your computer and the router, ping the ip address of
the router Type ping from the PC DOS window and from the router privileged EXEC
login window.
Hostnames
This administrative function is used to name or rename the cisco router. Here's an
example:
Router#configure terminal
Router(config)#hostname Murtaza
Murtaza(config)#hostname auic
auic(config)#
Setting Router Passwords
So far we have been working on a router with no access restrictions enabled. In the
real world, this is not the case. The most basic form of access restriction would be by
the use of passwords. Passwords can be set for console access, telnet access and
privileged EXEC access. Table 4 below illustrates the various password commands
on a Cisco router. The commands have to be typed out in privileged EXEC mode.
9
CS 306 – Computer Network Lab Manual
10
CS 306 – Computer Network Lab Manual
This method by default will keep your password unencrypted. However, you can
make it encrypted as you will see later. But you can use another method to assign an
encrypted password with one command as the following:
Router(config)#enable secret ccna
Auxiliary Password
To configure the auxiliary password, go into global configuration mode and type line
aux ?. You can see here that you only get a choice of 0-0 (that's because there's only
one port):
Router#config t
Router(config)#line aux ?
<0-0> First Line number
Router(config)#line aux 0
Router(config-line)#login
Router(config-line)#password ccna1
Console Password
To set the console password, use the line console 0 command.
Here's the example:
Router(config)#line console ?
<0-0> First Line number
Router(config)#line console 0
Router(config-line)# password ccna2
Router(config-line)# login
Telnet Password
Telnet, part of the TCP/IP protocol suite, is a virtual terminal protocol that allows you
to make connections to remote devices, gather information, and run programs.
After your routers and switches are configured, you can use the Telnet program to
reconfigure and/or check up on your routers and switches without using a console
11
CS 306 – Computer Network Lab Manual
cable. You run the Telnet program by typing telnet from any command prompt (DOS
or Cisco). You need to have VTY passwords set on the routers for this to work.
You can issue the telnet command from any router prompt like this:
Murtaza2509#telnet 172.16.10.2
Trying 172.16.10.2 ... Open
Password required, but none set
[Connection to 172.16.10.2 closed by foreign host]
Murtaza2509#
To set the user-mode password for Telnet access into the router, use the line vty
command. Routers that aren't running the Enterprise edition of the Cisco IOS default
to five VTY lines, 0 through 4.
Router(config-line)#line vty 0 4
Router(config-line)# password ccna2
Router(config-line)# login
Encrypting Your Passwords
Because only the enable secret password is encrypted by default, you'll need to
manually configure the user-mode and enable passwords for encryption.
Notice that you can see all the passwords except the enable secret when performing a
show unning-config on a router. TRY IT
To manually encrypt your passwords, use the service password-encryption command.
Here's an example of how to do it:
Router#config t
Router(config)#service password-encryption
Router(config)#^Z
Router#sh run
Router#config t
If you want to remove the encryption, use the following command:
Router(config)#no service password-encryption
12
CS 306 – Computer Network Lab Manual
Router(config)#^Z
Task: Solution
13
CS 306 – Computer Network Lab Manual
14
CS 306 – Computer Network Lab Manual
15
CS 306 – Computer Network Lab Manual
16
CS 306 – Computer Network Lab Manual
17
CS 306 – Computer Network Lab Manual
18
CS 306 – Computer Network Lab Manual
.)
19
CS 306 – Computer Network Lab Manual
Router(config)#int fastethernet 0
% Incomplete command.
Router(config)#int fastethernet 0?
Router(config)#int fastethernet 0/?
Bringing up an Interface
You can turn an interface off with the interface command shutdown, and turn it on
with the no Shutdown command.
If an interface is shut down, it'll display administratively down when using the show
interfaces (sh
Int for short) command:
Router#sh int fasteathernet 0/0
fasteathernet 0/0 is administratively down, line protocol is down
Another way to check an interface's status is via the show running-configcommand.
All interfaces are shut down by default.
You can bring up the interface with the no shutdown command (no shut for short):
Router#config t
Router(config)#int Fa 0/0
Router(config-if)#no shutdown
Router(config-if)#^Z
Router#sh int fa 0/0
20
CS 306 – Computer Network Lab Manual
Even though you don't have to use IP on your routers, it's most often what people
actually do use. To configure IP addresses on an interface, use the ip address
command from interface configuration mode:
Router(config)#int fa 0/0
Router(config-if)#ip address 172.16.10.2 255.255.255.0
Router(config-if)#no shut
The next command is show interface fastethernet 0/0. It reveals to us the hardware
address, logical address, and encapsulation method, as well as statistics on collisions,
as seen here:
Router#sh int fastethernet 0/0
The most important statistic of the show interface command is the output of the line
and data-link protocol status.
If the output reveals that FastEthernet 0/0 is up and the line protocol is up, then the
interface is up and running
21
CS 306 – Computer Network Lab Manual
Task: Solution
22
CS 306 – Computer Network Lab Manual
23
CS 306 – Computer Network Lab Manual
24
CS 306 – Computer Network Lab Manual
25
CS 306 – Computer Network Lab Manual
The End
26