0% found this document useful (0 votes)
15 views6 pages

Namal University Mianwali: Department of Computer Science

no

Uploaded by

Muhammad Shahbaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views6 pages

Namal University Mianwali: Department of Computer Science

no

Uploaded by

Muhammad Shahbaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Namal University Mianwali

Department of Computer Science

Lab Manual
Course CSC-251L- Computer Networks - Lab
Instructor Muzamil Ahmed Session / Semester 2022-2026 (5th)

Lecture # 07
Topic Introduction to Routers and IOS Basic Commands
Objectives The objective of this lab to learn the introduction to router and learn
basic router commands.

Router

A router is a networking device that forwards data packets between computer networks.
Routers perform the "traffic directing" functions on the Internet. A data packet is typically
forwarded from one router to another through the networks that constitute an internetwork
(e.g., the Internet) until it reaches its destination node. Unlike switches, which operate at
Layer 2 (Data Link Layer), routers work at Layer 3 (Network Layer) of the OSI model,
making them crucial in determining the path for packet delivery based on IP addresses.
Routers are located at gateways, the places where two or more networks connect. A router is
connected to at least two networks, commonly two LANs or WANs or a LAN and its ISP's
network. Routers use headers and forwarding tables to determine the best path for forwarding
the packets, and they use protocols such as ICMP to communicate with each other and
configure the best route between any two hosts.

Applications of Routers

 Data Transmission Optimization: Routers analyse network traffic to find the most
efficient path for data.
 Security: Routers can be configured to filter traffic based on IP addresses, creating a
layer of network security.
 Traffic Control: Routers can control data flow between networks, helping reduce
network congestion.
 Network Segmentation: Routers connect multiple networks, separating network traffic.

Internetwork Operating System (IOS)

IOS (Internetwork Operating System) is the software used on most Cisco networking devices,
providing the necessary interface for network operations. Cisco IOS has various command-
line interface (CLI) commands to configure routers and other networking devices, manage
network protocols, set security protocols, and monitor device statuses.

CSC-251L- Computer Networks - Lab


Cisco IOS commands are hierarchical and follow a specific syntax. There are mainly three
command modes:

1. User EXEC Mode: This is the default mode, with limited command access. The
prompt looks like Router>.
2. Privileged EXEC Mode: Allows access to all router commands and settings. The
prompt changes to Router#.
3. Global Configuration Mode: Used for configuring the device. Commands here
affect the router’s operation and its interface configuration. The prompt changes to
Router(config)#.

Router implementation in CISCO Packet Tracer

Configure a network with two PCs and one router. Click on router and then go to tab CLI for
IOS Command Line Interface as shown in figure 1 and 2.

Figure 1. Physical Network

Figure 2. CISCO CLI Interface

CSC-251L- Computer Networks - Lab


When we first open the command-line interface (CLI), we start in User EXEC mode. To
switch to Privileged EXEC mode, we use the command enable. From Privileged EXEC
mode, we can return to User EXEC mode by entering the command exit.

To enter Global Configuration mode from Privileged EXEC mode, we use the command
config t (short for configure terminal). This allows us to make global configuration changes
to the router.

Setup Login and Password

To set a password and enable login on a router in Global Configuration mode, start by
entering Privileged EXEC mode with the enable command, then enter Global
Configuration mode using config t. To set a password for console access, use the
command line console 0, then specify a password with password
[your_password] and enable login by entering login.

Figure 3. To set password and login router in global mode

Interface Mode

To move from Global Configuration mode to Interface Configuration mode, use the
interface command followed by the interface identifier (e.g., interface
fastEthernet0/0). This command allows you to configure specific settings for the
chosen interface, such as IP address, subnet mask, and other interface-related parameters.

Configure the Second Interface for PC 0

To configure the interface that connects to PC 0, use the interface command followed by the
interface identifier (e.g., FastEthernet0/0):

Router# config t

CSC-251L- Computer Networks - Lab


Router(config)# interface FastEthernet0/0

This command takes you to Interface Configuration mode for the interface
FastEthernet0/0.

In Interface Configuration mode, assign an IP address to the interface (this IP address will be used by
PC 0 to communicate with the router):
Router(config-if)# ip address 192.168.1.1 255.255.255.0

By default, the router's interface might be in a shutdown state. To activate the interface, use
the following command:
Router(config-if)# no shutdown

Figure 4. Set the subnet mask and ip for pc 0:

Configure the Second Interface for PC 1:


Similarly, configure the second interface connected to PC 1, enter the following commands
for FastEthernet0/1 (or the appropriate interface):

Router(config)# interface FastEthernet0/1

Router(config-if)# ip address 192.168.2.1 255.255.255.0

Router(config-if)# no shutdown

This assigns the IP address 192.168.2.1 with a subnet mask of 255.255.255.0 to the
FastEthernet0/1 interface.

CSC-251L- Computer Networks - Lab


Configure the PCs:

 PC 0 should be configured with the IP address 192.168.1.2 (or another IP in the same
subnet) and a subnet mask of 255.255.255.0. The default gateway for PC 0 should be
192.168.1.1 (the router’s interface IP).
 PC 1 should be configured with the IP address 192.168.2.2 and a subnet mask of
255.255.255.0. The default gateway for PC 1 should be 192.168.2.1 (the router’s
interface IP).

Figure 5. Configuration of PC 0

After the configuration, you can test the connectivity between the PCs and the router by using
the ping command from the PCs to the router’s interface IPs. For example, from PC 0:

ping 192.168.2.2

From PC 1:

ping 192.168.1.2

If the pings are successful, it means the PCs are properly connected to the router.

Figure 6. Text Connectivity

CSC-251L- Computer Networks - Lab


Lab Tasks

Task 1: Design and implement the specified network following the instructions in the
manual. Use the provided steps to configure each router and connect two PCs to each router
as outlined. Ensure proper IP addressing and routing to enable full connectivity across the
network.

Task 2: Design a network using router IOS which contains four PCs and two routers. Ensure
the communication between two routers.

 Connect Router 1 to Router 2 using FastEthernet0/1 interfaces on each router.


 Connect PC 1 and PC 2 to Router 1 on separate FastEthernet interfaces (e.g.,
FastEthernet0/0 and FastEthernet0/2).
 Connect PC 3 and PC 4 to Router 2 on separate FastEthernet interfaces (e.g.,
FastEthernet0/0 and FastEthernet0/2).
 Assign IP addresses to all router interfaces and configure subnetting as needed.
 Assign IP addresses, subnet masks, and default gateways to each PC, pointing to their
respective router interfaces.
 Enable routing on both routers to allow inter-router communication.
 Verify connectivity by pinging between PCs on different routers.

Submission Guidelines

1. Create a folder named with your name + registration number with two subdirectories
i.e., Simulation File and Report
2. The Report subdirectory should contain a detailed explanation of each task, logical
observations and screenshot with proper referencing and detail.
3. Academic Integrity: Any instances of plagiarism will result in a zero score for the
last two lab submissions.
4. Adhere to the submission deadlines. Late submissions will receive zero marks.

CSC-251L- Computer Networks - Lab

You might also like