0% found this document useful (0 votes)
28 views51 pages

Computer Networks Practical File

The document is a practical file for a Computer Networks lab course at Sunder Deep Engineering College, detailing various networking commands and programming tasks. It includes sections on commands like IPCONFIG, PING, TRACERT, and more, along with batch programming exercises and client/server architecture. The file serves as a comprehensive guide for students to understand and apply networking concepts and tools.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views51 pages

Computer Networks Practical File

The document is a practical file for a Computer Networks lab course at Sunder Deep Engineering College, detailing various networking commands and programming tasks. It includes sections on commands like IPCONFIG, PING, TRACERT, and more, along with batch programming exercises and client/server architecture. The file serves as a comprehensive guide for students to understand and apply networking concepts and tools.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SUNDER DEEP ENGINEERING COLLEGE

NH-9-(24), DELHI-HAPUR ROAD, DASNA, GHAZIABAD-201015 (U.P.)


TEL: (0120)-2965554
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

PRACTICAL FILE
COMPUTER NETWORKS - LAB
BCS653
(EVEN SEMESTER)

SUBMITTED BY:
Submitted by :
Roll no :
Course :
Brance
Section :
Year :
Semester :

SUBMITTED TO:

Supervisor name : Mr. Kapil dev sharma

Designation : Assistant Professor

Department : CSE

Page 1 of 51
INDEX PAGE

Contents
NETWORKING COMMANDS: ............................................................................................ 5
1. IPCONFIG Commands: ................................................................................................. 5
2. PING Command:............................................................................................................ 6
3. TRACERT Command: ................................................................................................... 7
4. NSLOOKUP Commands: ............................................................................................... 8
5. GETMAC Command:..................................................................................................... 9
6. NETSTAT Command: .................................................................................................. 10
[Link] Command: ............................................................................................... 12
8. ARP Command: ........................................................................................................... 13
9. SYSTEMINFO Command: ........................................................................................... 14
10. ROUTE Command: .................................................................................................... 15
Batch Programming (Windows) ......................................................................................... 17
What is Batch Programming? ..................................................................................... 17
Common Commands .............................................................................................. 17
Variables................................................................................................................. 17
User Input ............................................................................................................... 17
Conditional Statements ........................................................................................... 17
Labels and Goto ...................................................................................................... 18
Loops using for...................................................................................................... 18
Error Handling ......................................................................................................... 18
File Operations........................................................................................................ 18
Useful Tips .............................................................................................................. 18
Saving and Running ................................................................................................. 19
Q1: Write a program in batch to perform all arithmetic operations: .................................. 20
Q2: Write a program in batch to perform all arithmetic operations through function: ........ 21
Q3: Write a program to perform sum and multiplication of series from 1 to N by using
Function: ......................................................................................................................... 22
Q3: Write a program to find factorial of given number? .................................................... 23
Q4: Write a program to print table of given number; ........................................................ 24
Q5: Write a program to print pattern: .............................................................................. 25
Q6: Write a program to print pattern second. ................................................................... 26

Page 2 of 51
Q7: Write a program to print pattern third ....................................................................... 27
CLIENT/SERVER ARCHITECTURE: ................................................................................ 29
Client/Server Socket Connection Diagram: ....................................................................... 30
TCP PROGRAMMING IN JAVA: ................................................................................... 31
UDP Programming Through Java ................................................................................... 32
UDP Communication in Java Requires: ........................................................................ 32
Step-by-Step Example: Java UDP Client-Server ............................................................ 32
1. UDP Server Code ................................................................................................. 32
2. UDP Client Code.................................................................................................. 33
NETWORKING TOOLS: ...................................................................................................... 35
1. CRIMPLING TOOL: ................................................................................................... 35
2. LAN CABLE TESTER: .................................................................................................. 35
3.RJ45 Connector:............................................................................................................ 36
DIFFERENCE BETWEEN STRAIGHT AND CROSSOVER CABLE: ............................. 37
1. Straight Through Cable......................................................................................... 37
2. Crossover Cable .................................................................................................. 37
Summary Table: ...................................................................................................... 38
CISCO PACKET TRACER: ................................................................................................ 40
What is Cisco Packet Tracer? ........................................................................................ 40
1. Download and Install ........................................................................................... 40
2. Interface Overview ............................................................................................... 40
3. Create a Simple Network ..................................................................................... 40
4. Test Connection (Ping) ......................................................................................... 41
5. Add Router and Configure Interfaces .................................................................... 41
6. Basic CLI Commands .......................................................................................... 41
Simulation Mode......................................................................................................... 42
Practice Ideas ............................................................................................................. 42
Steps to Configure and Verify Three Router Connections in Cisco Packet Tracer using RIP
Routing:........................................................................................................................... 43

Page 3 of 51
Page 4 of 51
NETWORKING COMMANDS:

1. IPCONFIG Commands:
The ipconfig command is used in Windows to view and manage the IP configuration of your
computer. Below are some commonly used ipconfig commands:

Command Description

ipconfig Displays basic IP address, subnet mask, and default gateway for all adapters.

Advanced / Useful Options

Command Description

Shows detailed IP configuration (including MAC address, DHCP


ipconfig /all
status, DNS servers).

ipconfig /release Releases the current IP address from the network adapter.

ipconfig /renew Renews the IP address for the adapter.

ipconfig /flushdns Clears the DNS resolver cache.

ipconfig /displaydns Displays the contents of the DNS cache.

ipconfig /registerdns Refreshes all DHCP leases and re-registers DNS names.

Usage Examples

Check your IP address


ipconfig

Get full details including DNS and MAC

ipconfig /all
Fix connectivity issues (renew IP)
ipconfig /release
ipconfig /renew

Fix DNS issues

ipconfig /flushdns

Page 5 of 51
2. PING Command:
Here are the commonly used ping commands in Windows OS, used to test network
connectivity and diagnose issues:

Basic Ping Command

Command Description

Tests network connection to a server or


ping <hostname or IP>
device.

Example:
ping [Link]
ping [Link]

Useful Ping Options (Windows)

Command Description

Pings the target continuously until stopped (press Ctrl + C to


ping -t <host>
stop).

ping -n <count>
<host>
Sends a specific number of pings.

ping -l <size>
<host>
Sends a ping packet of a specific byte size (default is 32 bytes).

ping -4 <host> Forces the use of IPv4.

ping -6 <host> Forces the use of IPv6.

Examples of Ping in Use

1. Ping a website once


ping [Link]
2. Ping continuously
ping -t [Link]
3. Ping 5 times only
ping -n 5 [Link]
4. Ping with 1000 bytes data size
ping -l 1000 [Link]
5. Ping using IPv4
ping -4 [Link]
6. Ping using IPv6
ping -6 [Link]

Page 6 of 51
3. TRACERT Command:
The tracert command (short for Trace Route) in Windows OS is used to trace the path
packets take from your computer to a destination host. It helps identify network delays or
connection failures between routers.

Basic Tracert Command

Command Description

tracert <hostname or IP> Traces the route taken by packets to reach a destination.

Example:
tracert [Link]

Useful Tracert Options

Command Description

tracert -d <host> Do not resolve hostnames (faster).

tracert -h <max_hops> <host> Set maximum number of hops (default is 30).

tracert -w <timeout> <host> Set timeout in milliseconds to wait for each reply.

tracert -4 <host> Use only IPv4.

tracert -6 <host> Use only IPv6.

Examples of Tracert in Use

Trace route to a website


tracert [Link]
Trace route without resolving names (faster)
tracert -d [Link]
Limit route to 10 hops
tracert -h 10 [Link]
Set timeout to 5000 ms
tracert -w 5000 [Link]
Use IPv4 route
tracert -4 [Link]

Use Case

• Helps identify where in the network chain a slowdown or disconnection is occurring.


• Useful for diagnosing ISP or DNS issues.

Page 7 of 51
4. NSLOOKUP Commands:
The nslookup (Name Server Lookup) command in Windows OS is used to query DNS
servers and troubleshoot domain name resolution issues. It helps you find the IP address of
a domain or the domain name of an IP address.

Basic nslookup Command

Command Description

nslookup <domain> Returns the IP address of a domain name.

Example:
nslookup [Link]

Useful nslookup Commands & Options

Command Description

nslookup Starts interactive mode for multiple queries.

Reverse DNS lookup – returns domain name for an IP (if


nslookup <IP>
available).

nslookup <domain> <DNS


server>
Uses a specific DNS server to resolve a domain.

set type=MX Looks up mail exchange (MX) records.

set type=A Looks up IPv4 address records.

set type=AAAA Looks up IPv6 address records.

set type=NS Looks up name server records.

set type=ANY Retrieves all available DNS records.

Examples of nslookup in Use

Basic domain to IP
nslookup [Link]
Reverse IP to domain
nslookup [Link]
Use a specific DNS server (e.g., Cloudflare)
nslookup [Link] [Link]

Page 8 of 51
5. GETMAC Command:
The getmac command in Windows OS is used to display the MAC addresses of your
computer's network adapters.

Basic Command
getmac

This shows:

• Physical (MAC) address


• Transport name (interface info)

Useful Options with getmac

Command Description

Shows verbose output: includes connection name, network adapter


getmac /v
name, and MAC address.

getmac /fo
list
Displays output in a list format.

getmac /fo
table
Displays output in a table format (default).

getmac /fo
csv
Displays output in CSV (comma-separated) format.

getmac /nh Hides the column headers in output (use with /fo).

Examples

1. Show MAC addresses (default format)


2. getmac
3. Detailed info (adapter name + MAC)
4. getmac /v
5. List format output
6. getmac /fo list
7. CSV format without headers
8. getmac /fo csv /nh

Tip:

You can also view MAC addresses using:


ipconfig /all
Look for the "Physical Address" under each adapter.

Page 9 of 51
6. NETSTAT Command:
The netstat command (Network Statistics) in Windows OS is used to display active
network connections, ports, and various networking statistics. It's especially useful for
diagnosing network issues and identifying open ports or suspicious activity.

Basic Command
netstat

Shows all active TCP connections.

Useful netstat Options

Command Description

netstat -a Displays all connections and listening ports.

netstat -n Shows addresses and ports in numeric format (no DNS lookup).

netstat -o Displays owning process ID (PID) for each connection.

Shows application/executable that opened each connection (requires


netstat -b
admin).

netstat -e Shows Ethernet statistics (packets sent/received).

netstat -r Displays the routing table.

netstat -s Displays protocol statistics for TCP, UDP, ICMP, etc.

netstat -
anob
Combines multiple options: numeric + process ID + binary (app names).

Common Usage Examples

All connections and listening ports


netstat -a
Show IP addresses and ports (no DNS)
netstat -an
Show connections with process ID
netstat -ano
Find which program opened a port (Admin required)
netstat -b
Display routing table
netstat -r
Check network usage statistics
netstat -e

Page 10 of 51
Combine with tasklist to Identify Programs by PID

After using:
netstat -ano
You can match the PID (last column) with the program name:
tasklist /fi "PID eq 1234"

Page 11 of 51
[Link] Command:
hostname Command in Windows

The hostname command in Windows is used to display the name of the current computer
(i.e., the hostname of the machine on the network).

Syntax:
hostname

Example Output:
C:\Users\Kapil>hostname
DESKTOP-ABC123

Use Case:

• Useful in network troubleshooting or identifying machines in a domain or LAN.


• Often used along with commands like ping, ipconfig, or net view.

Want to Change Hostname?

You cannot change the hostname using the hostname command. Instead, do one of the
following:
GUI Method:

1. Go to Control Panel → System.


2. Click Change settings next to the computer name.
3. Click Change, then type the new name.
4. Restart your PC.

Command Line Method (PowerShell):


Rename-Computer -NewName "NEW-HOSTNAME" -Restart

Page 12 of 51
8. ARP Command:
arp Command in Windows

The arp (Address Resolution Protocol) command in Windows is used to view and manage
the ARP cache, which stores mappings of IP addresses to MAC (physical) addresses on a
local network.

Syntax:
arp [command] [options]

Common arp Commands:

Command Description

arp -a Displays all ARP entries in the ARP table.

arp -a <IP> Displays ARP entry for a specific IP address.

arp -d <IP> Deletes a specific ARP entry.

arp -s <IP> <MAC> Adds a static ARP entry. Must be admin.

Example Usage:

View ARP table:


arp -a
Output:
Interface: [Link] --- 0x10
Internet Address Physical Address Type
[Link] 00-1d-7e-a4-b3-22 dynamic
[Link] 08-00-27-0a-8c-4d dynamic
Delete an ARP entry:
arp -d [Link]
Add a static ARP entry:
arp -s [Link] 00-aa-00-62-c6-09
Note: Requires admin privileges.

Note:

• The ARP cache stores entries temporarily unless manually added with -s.
• Use arp -a often when troubleshooting LAN connectivity or checking if a device is
reachable.

Page 13 of 51
9. SYSTEMINFO Command:
systeminfo Command in Windows

The systeminfo command provides detailed configuration information about your


computer, including some network-related data.

Basic Syntax:
systeminfo

What It Shows (including network info):

When you run systeminfo, it displays system details like:

• Host Name
• Domain
• Logon Server
• Network Card(s):
o Description (e.g., Intel Ethernet, Wi-Fi)
o MAC Address
o DHCP Enabled
o IP Address(es)
o Subnet Mask
o Default Gateway

Example Output (partial, for networking):


Host Name: DESKTOP-ABC123
Domain: WORKGROUP
Logon Server: \\DESKTOP-ABC123

Network Card(s): 2 NIC(s) Installed.


[01]: Intel(R) Ethernet Connection
Connection Name: Ethernet
DHCP Enabled: Yes
DHCP Server: [Link]
IP address(es)
[01]: [Link]

How to Export Output to File:


systeminfo > [Link]
This saves the full report to a text file in the current directory.

Page 14 of 51
10. ROUTE Command:
In Windows, the route command is a powerful networking utility used to view and
manipulate the IP routing table. It allows you to add, delete, and print network routes.

Basic Syntax:
route [command] [destination] [mask subnet_mask] [gateway] [metric metric]
[if interface]
Common route Commands in Windows:

Command Description

route print Displays the current routing table.

route add Adds a new route to the table.

route delete Deletes an existing route.

route change Modifies an existing route.

Examples:

View Routing Table


route print

Add a Static Route


route add [Link] mask [Link] [Link]

Adds a route to the [Link]/24 network via gateway [Link].

Add a Persistent Route (Survives Reboot)


route -p add [Link] mask [Link] [Link]

Delete a Route
route delete [Link]

Modify a Route
route change [Link] mask [Link] [Link]

Notes:

• Use -p only with the add command to make the route persistent.
• You may need Administrator privileges to use route add, delete, or change.

Page 15 of 51
BATCH SCRIPT
PROGRAMMING

Page 16 of 51
📘 Batch Programming (Windows)
🔹 What is Batch Programming?
Batch programming involves writing a series of commands in a .bat or .cmd file to
automate tasks in Windows Command Prompt (CMD).

Basic Structure
@echo off
REM This is a comment
echo Hello, World!
pause

🔹 Common Commands
Command Description

echo Displays text or turns echoing on/off

pause Pauses execution and waits for user input

cls Clears the screen

REM or :: Adds a comment

set Sets a variable

if Conditional statement

goto Jumps to a label

call Calls another batch file or function

exit Exits the script

🔹 Variables
set name=Kapil
echo Hello %name%

🔹 User Input
set /p username=Enter your name:
echo Hello, %username%

🔹 Conditional Statements
if %name%==Kapil echo Welcome, Kapil!

Page 17 of 51
🔹 Labels and Goto
:menu
echo 1. Say Hello
echo 2. Exit
set /p choice=Choose:
if %choice%==1 goto hello
if %choice%==2 goto end

:hello
echo Hello!
goto menu

:end
exit

🔹 Loops using for


for %%i in (*.txt) do echo %%i
for /l %%i in (1,1,5) do echo %%i

🔹 Error Handling
commandThatMightFail
if errorlevel 1 echo An error occurred

🔹 File Operations
Operation Example

Copy copy [Link] backup\[Link]

Delete del [Link]

Rename rename [Link] [Link]

Create Dir mkdir newfolder

Remove Dir rmdir /s /q oldfolder

🔹 Useful Tips

• Always use @echo off at the top to make output clean.


• %~dp0 gives the directory of the batch file.
• Use double % (e.g., %%i) in loops when writing in batch files (single % for CMD
directly).

Page 18 of 51
🔹 Saving and Running

1. Write your code in Notepad.


2. Save as [Link].
3. Double-click to execute or run from CMD.

Page 19 of 51
Q1: Write a program in batch to perform all arithmetic
operations:

Page 20 of 51
Q2: Write a program in batch to perform all arithmetic
operations through function:

Page 21 of 51
Q3: Write a program to perform sum and multiplication of series
from 1 to N by using Function:

Page 22 of 51
Q3: Write a program to find factorial of given number?

OUTPUT:

Page 23 of 51
Q4: Write a program to print table of given number;

OUTPUT:

Page 24 of 51
Q5: Write a program to print pattern:

OUTPUT:

Page 25 of 51
Q6: Write a program to print pattern second.

OUTPUT:

Page 26 of 51
Q7: Write a program to print pattern third

OUTPUT:

Page 27 of 51
CLIENT/SERVER
ARCHITECTURE

Page 28 of 51
CLIENT/SERVER ARCHITECTURE:

Page 29 of 51
Client/Server Socket Connection Diagram:

Page 30 of 51
TCP PROGRAMMING IN JAVA:
// [Link]
import [Link].*;
import [Link].*;

public class Server {


public static void main(String[] args) {
try {
ServerSocket serverSocket = new ServerSocket(6666);
[Link]("Server started. Waiting for client...");
Socket socket = [Link]();
[Link]("Client connected.");

DataInputStream dataInputStream = new DataInputStream([Link]());


String message = [Link]();
[Link]("Message received: " + message);

[Link]();
} catch (Exception e) {
[Link](e);
}
}
}

// [Link]
import [Link].*;
import [Link].*;

public class Client {


public static void main(String[] args) {
try {
Socket socket = new Socket("localhost", 6666);
DataOutputStream dataOutputStream = new DataOutputStream([Link]());
[Link]("Hello Server!");
[Link]();
[Link]();
[Link]();
} catch (Exception e) {
[Link](e);
}
}
}

Page 31 of 51
📘 UDP Programming Through Java
UDP (User Datagram Protocol) is a connectionless protocol that sends data in small packets
(datagrams). Unlike TCP, it doesn't guarantee delivery, ordering, or error checking, but it's
faster and lightweight, often used in real-time applications.

🔧 UDP Communication in Java Requires:


• DatagramSocket: for sending/receiving datagrams.
• DatagramPacket: for encapsulating data sent/received.

🔹 Step-by-Step Example: Java UDP Client-Server


✅ 1. UDP Server Code
import [Link].*;

public class UDPServer {


public static void main(String[] args) throws Exception {
DatagramSocket serverSocket = new DatagramSocket(9876); // Server
binds to port 9876
byte[] receiveBuffer = new byte[1024];
byte[] sendBuffer;

[Link]("UDP Server is running...");

while (true) {
// Receive packet
DatagramPacket receivePacket = new
DatagramPacket(receiveBuffer, [Link]);
[Link](receivePacket);
String clientData = new String([Link](), 0,
[Link]());
[Link]("Received from client: " + clientData);

// Prepare reply
String reply = "Hello from server";
sendBuffer = [Link]();

// Send reply
InetAddress clientAddress = [Link]();
int clientPort = [Link]();
DatagramPacket sendPacket = new DatagramPacket(sendBuffer,
[Link], clientAddress, clientPort);
[Link](sendPacket);
}
}
}

Page 32 of 51
✅ 2. UDP Client Code
import [Link].*;
import [Link];

public class UDPClient {


public static void main(String[] args) throws Exception {
DatagramSocket clientSocket = new DatagramSocket();
InetAddress IPAddress = [Link]("localhost"); //
Replace with server IP if remote
Scanner sc = new Scanner([Link]);

[Link]("Enter message: ");


String message = [Link]();
byte[] sendBuffer = [Link]();
byte[] receiveBuffer = new byte[1024];

// Send packet
DatagramPacket sendPacket = new DatagramPacket(sendBuffer,
[Link], IPAddress, 9876);
[Link](sendPacket);

// Receive response
DatagramPacket receivePacket = new DatagramPacket(receiveBuffer,
[Link]);
[Link](receivePacket);
String serverReply = new String([Link](), 0,
[Link]());
[Link]("Reply from server: " + serverReply);

[Link]();
[Link]();
}
}

Key Points:

Feature Detail

Protocol UDP (connectionless)

Port Must match on both client/server (e.g., 9876)

Classes Used DatagramSocket, DatagramPacket

Data Unit byte[] buffer

Speed Fast, but unreliable

Important Tips:

• Use try-catch for better error handling.


• Use setSoTimeout() for receive timeout.
• Avoid using UDP for critical data transfers (use TCP instead).

Page 33 of 51
NETWORKING TOOLS

Page 34 of 51
NETWORKING TOOLS:
1. CRIMPLING TOOL:

2. LAN CABLE TESTER:

Page 35 of 51
3.RJ45 Connector:

Page 36 of 51
DIFFERENCE BETWEEN STRAIGHT AND CROSSOVER
CABLE:

Here's a clear comparison between Straight Through Cable and Crossover Cable, used in
computer networking:

🔁 1. Straight Through Cable


Feature Description

Purpose Connects different devices

Used Between PC ↔ Switch, PC ↔ Router, Switch ↔ Router

Wiring Pattern Same at both ends (e.g., T568A to T568A or T568B to T568B)

Automatic Crossover
No
Needed?

Pin Mapping Pin 1 → Pin 1, Pin 2 → Pin 2, etc.

Most Ethernet connections today (especially with auto-


Common Use
MDI/MDIX switches)

🔁 2. Crossover Cable
Feature Description

Purpose Connects similar devices

Used Between PC ↔ PC, Switch ↔ Switch, Router ↔ Router

Wiring Pattern Different at both ends (e.g., T568A to T568B)

Automatic Crossover
Yes, if not using crossover cable
Needed?

Pin Mapping Pin 1 ↔ Pin 3, Pin 2 ↔ Pin 6 (Transmit ↔ Receive)

Used mostly in older networks or when auto-crossover is not


Common Use
supported

Page 37 of 51
🧠 Summary Table:
Feature Straight Cable Crossover Cable

Device Type Different devices Similar devices

Wiring Same at both ends Different at each end

Common Usage PC to Switch/Router PC to PC, Switch to Switch

Standard Pairing T568A ↔ T568A or T568B ↔ T568B T568A ↔ T568B

Tip: Modern devices (since Gigabit Ethernet) often support Auto MDI/MDIX, which
means they can detect and adjust the connection type automatically making crossover cables
mostly obsolete.

Page 38 of 51
CISCO PACKET TRACER
SIMULATOR

Page 39 of 51
CISCO PACKET TRACER:
Cisco Packet Tracer, a powerful network simulation tool from Cisco used for learning
networking concepts and practicing configurations.

📌 What is Cisco Packet Tracer?


Cisco Packet Tracer is a network simulation software that lets you build, configure, and
test virtual network topologies. It’s used widely for:

• Learning CCNA/CCNP concepts


• Practicing networking commands
• Simulating routers, switches, PCs, IoT devices, etc.

✅ 1. Download and Install

• Download from: Cisco Networking Academy


• Requires a free NetAcad account
• Available for Windows, Linux, macOS

✅ 2. Interface Overview
Section Purpose

Device-Type Selection Box Select routers, switches, PCs, etc.

Workspace Drag devices and connect them

Config Tab Configure IPs, protocols

Simulation Mode Watch data packet movement step-by-step

✅ 3. Create a Simple Network


🖥️ Devices:

• 2 PCs
• 1 Switch
• Ethernet cables

Page 40 of 51
📦 Steps:

1. Add 2 PCs: Click End Devices → PC, then place on the workspace.
2. Add a Switch: Click Switches → Switch 2960.
3. Connect: Use Copper Straight-Through Cable to connect PC → Switch.
4. Assign IPs:
o Click PC → Desktop → IP Configuration
o Set:
▪ PC1: [Link] / [Link]
▪ PC2: [Link] / [Link]

✅ 4. Test Connection (Ping)

1. Click PC1 → Desktop → Command Prompt


2. Type:
3. ping [Link]
4. You should get reply messages, meaning the connection works.

✅ 5. Add Router and Configure Interfaces

1. Add a Router (e.g., 2911).


2. Connect PCs to Router (through switch or directly).
3. Assign IPs to Router interfaces:
o Click Router → CLI → Use commands like:
o enable
o configure terminal
o interface gig0/0
o ip address [Link] [Link]
o no shutdown
o exit

✅ 6. Basic CLI Commands


Command Description

enable Enters privileged mode

configure terminal Enters global config mode

interface g0/0 Selects interface

ip address ... Sets IP

no shutdown Enables interface

show ip interface brief Shows status of interfaces

Page 41 of 51
Command Description

ping IP Tests connectivity

🎥 Simulation Mode
1. Switch to Simulation Mode (bottom right).
2. Send ping packets and watch the data flow.
3. Useful for troubleshooting and protocol analysis.

📚 Practice Ideas
• Static Routing (2 routers, 2 networks)
• Dynamic Routing (RIP, OSPF)
• VLAN Configuration
• DHCP Server setup
• IoT Devices and Wireless Configuration

Page 42 of 51
Steps to Configure and Verify Three Router Connections in Cisco
Packet Tracer using RIP Routing:
Step 1: First, open the Cisco packet tracer desktop and select the devices given below:

[Link] Device Model Name Qty.

1. PC PC 6

2. Switch PT-Switch 3

3. Router PT-router 3

IP Addressing Table:

[Link] Device IPv4 Address Subnet mask Default Gateway

1. PC0 [Link] [Link] [Link]

2. PC1 [Link] [Link] [Link]

3. PC2 [Link] [Link] [Link]

4. PC3 [Link] [Link] [Link]

5. PC4 [Link] [Link] [Link]

6. PC5 [Link] [Link] [Link]

Then, create a network topology as shown below the image.

Use an Automatic connecting cable to connect the devices with others.

Page 43 of 51
Step 2: Configure the PCs (hosts) with IPv4 address and Subnet Mask according to the IP
addressing table given above.

To assign an IP address in PC0, click on PC0.

Then, go to desktop and then IP configuration and there you will IPv4 configuration.

Fill IPv4 address and subnet mask.

Page 44 of 51
Assigning an IP address using the ipconfig command, or we can also assign an IP address with
the help of a command.

Go to the command terminal of the PC.

Then, type iPConfig <IPv4 address><subnet mask><default gateway>(if needed)

Example: iPConfig [Link] [Link] [Link]

Page 45 of 51
Repeat the same procedure with other PCs to configure them thoroughly.

Step 3: Configure router with IP address and Subnet mask.

IP Addressing Table Router:

[Link] Device Interface IPv4 Address Subnet mask

FastEthernet0/0 [Link] [Link]


router0
1. Serial2/0 [Link] [Link]

router1 FastEthernet0/0 [Link] [Link]

Page 46 of 51
[Link] Device Interface IPv4 Address Subnet mask

Serial2/0 [Link] [Link]

2. Serial3/0 [Link] [Link]

FastEthernet0/0 [Link] [Link]


router2
3. Serial2/0 [Link] [Link]

To assign an IP address in router0, click on router0.

Then, go to config and then Interfaces.

Make sure to turn on the ports.

Then, configure the IP address in FastEthernet and serial ports according to IP addressing Table.

Fill IPv4 address and subnet mask.

Page 47 of 51
Repeat the same procedure with other routers to configure them thoroughly.

Step 4: After configuring all of the devices we need to assign the routes to the routers.
To assign RIP routes to the particular router:

First, click on router0 then Go to CLI.

Then type the commands and IP information given below.

CLI command : router rip


CLI command : network <network id>
RIP Routes for Router0 are given below:

Router(config)#router rip
Router(config-router)#network [Link]
Router(config-router)#network [Link]
RIP Routes for Router1 are given below:

Router(config)#router rip
Router(config-router)#network [Link]

Page 48 of 51
Router(config-router)#network [Link]
Router(config-router)#network [Link]
RIP Routes for Router2 are given below:

Router(config)#router rip
Router(config-router)#network [Link]
Router(config-router)#network [Link]

Step 5: Verifying the network by pinging the IP address of any PC.


We will use the ping command to do so.

First, click on PC0 then Go to the command prompt.

Then type ping <IP address of targeted node>.

As we can see in the below image we are getting replies which means the connection is working
properly.

Example : ping [Link]

Page 49 of 51
A simulation of the experiment is given below we are sending PDU from PC0 to PC2 and PC3 to
PC5

Page 50 of 51
Page 51 of 51

You might also like