Namal University Mianwali: Department of Computer Science
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.
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.
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)#.
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.
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.
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.
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.
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
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
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.
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.
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.
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.