You are on page 1of 26

CS 306 – Computer Network Lab Manual

LAB NO. 06
BASIC CONFIGURATIONS OF ROUTER
Following are the lab objectives:
Objectives
Lab

1. Understand the importance of Router

2. Implement basic configurations on router

Roll No. 4979 Name Mubashir Hussain


Obtained
Marks Comments
Marks
Task 1 20
Task 2 20
Total
40
Marks

Sir_Asad_Ha
nif
Lab Instructor

1
CS 306 – Computer Network Lab Manual

Lab Objectives and CLOs Mapping

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

BASIC ROUTER CONFIGURATIONS


Routers are computers and include many of the same hardware and software
components found in a typical PC, such as CPU, RAM, ROM, and an operating
system.
The main purpose of a router is to connect multiple networks and forward packets
from one network to the next. This means that a router typically has multiple
interfaces. Each interface is a member or host on a different IP network.
The router has a routing table, which is a list of networks known by the router. The
routing table includes network addresses for its own interfaces, which are the directly
connected networks, as well as network addresses for remote networks. A remote
network is a network that can only be reached by forwarding the packet to another
router.
Remote networks are added to the routing table in two ways: either by the network
administrator manually configuring static routes or by implementing a dynamic
routing protocol. Static routes do not have as much overhead as dynamic routing
protocols; however, static routes can require more maintenance if the topology is
constantly changing or is unstable.
Dynamic routing protocols automatically adjust to changes without any intervention
from the network administrator. Dynamic routing protocols require more CPU
processing and also use a certain amount of link capacity for routing updates and
messages. In many cases, a routing table will contain both static and dynamic routes.
Routers make their primary forwarding decision at Layer 3, the Network layer.
However, router interfaces participate in Layers 1, 2, and 3. Layer 3 IP packets are
encapsulated into a Layer 2 data link frame and encoded into bits at Layer 1. Router
interfaces participate in Layer 2 processes associated with their encapsulation. For
example, an Ethernet interface on a router participates in the ARP process like other
hosts on that LAN.

Router Components and their Functions


Like a PC, a router also includes:
• Central Processing Unit (CPU)
• Random-Access Memory (RAM)
• Read-Only Memory (ROM)

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 > enable [Enter]


Enter the password given to you by the lab administrator when prompted.
 Use the Help command? to see the list of available commands in the
privileged level.

Router # ?

6
CS 306 – Computer Network Lab Manual

Table2. Few frequently used commands in the privileged level.

 Enter the Configuration level.

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

 In the Privileged EXEC level use the show command to see detailed


information about the network interfaces of the router.
Router # show interfaces [Enter]
 Now enter the Configuration level to assign an IP address to the router.
Router# configure terminal [Enter]
Use an IP address given by the tutor (e.g. 10.128.20.254) and subnet mask
255.255.0.0 for the values. Then do the following:
Router (config)# interface fa 0/0 [Enter]
This will ensure that you are configuring the 0/0 interface since there could be
multiple interfaces with names 0/0, 0/1 …etc.
Router (config‐if )# ip address (given ip address) (given subnet mask)
[Enter]
Router (config‐if )#no shutdown [Enter]
This will ensure that the ip address configuration is administratively up i.e. The ip
address is being used for routing purpose.
Using 255.255.0.0 for the IP address specifies the subnet and the workstation and the
router should be in the same subnet mask for them to be able to communicate.
Connect the router to the PC using the Crossover cable. Change the IP address of
your computer with following values:
 IP address (of your computer): 10.128.20.1
 Subnet mask: 255.255.0.0
 Default gateway: 10.128.20.254

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.

TASK 01: CISCO R OUTER – BASIC CONFIGURATION


Router Administrative Functions
Even though this section isn't critical to making a router or switch work on a network,
it's still really important.
The administrative functions that you can configure on a router are:
• Hostnames
• Password
• Interface descriptions

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

There are five passwords used to secure your Cisco routers:


 Console
 Auxiliary
 Telnet (VTY)
 Enable password
 Enable secret.

Let's take a look at each of these now.


Enable Passwords
You set the enable passwords from global configuration mode like this:
Router(config)#enable password ccna

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

.)

TASK 02: ROUTER INTERFACES


Interface configuration is one of the most important router configurations, because
without interfaces, a router is pretty much a completely useless object. Plus, interface
configurations must be totally precise to enable communication with other devices.
Some of the configurations used to configure an interface are Network layer
addresses, media type, bandwidth, and other administrator commands.
A cisco router has two types of communication interfaces; Ethernet or fastethernet
(depending on the router specifications) to communicate with a LAN and serial
interface to communicate with WAN or with other router.
Now it's time to choose the interface you want to configure. Once you do that, you
will be in interface configuration for that specific interface.
On a 2600 cisco router series, the configuration would be interface type slot/port, as
seen here:
Router(config)#int fastethernet ?
<0-1> FastEthernet interface number

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

Configuring an IP Address on an Interface

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

Copying the Current Configuration to NVRAM


By copying running-config to NVRAM as a backup, you're assured that your
running-config will always be reloaded if the router gets rebooted.
Router#copy run start
Destination filename [startup-config]?[Enter]
Warning: Attempting to overwrite an NVRAM configuration
previously written by a different version of the system
Overwrite the previous NVRAM configuration?
[confirm][Enter]
Building configuration...
[OK]

21
CS 306 – Computer Network Lab Manual

Erasing the Configuration


To delete the startup-config file on a Cisco router, use the command erase startup-
config, like this:
Router#erase startup-config

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

You might also like