0% found this document useful (0 votes)
19 views

6-3 Lab Manual - Computer Networks

The document is a lab manual for a computer networks course. It contains 7 labs covering topics like preparing ethernet cables, network commands, IP addressing, configuring and securing switches, VLANs, and servers with CDP. Each lab includes objectives, theoretical descriptions of the topics, and tasks to complete.

Uploaded by

amirhanzala831
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

6-3 Lab Manual - Computer Networks

The document is a lab manual for a computer networks course. It contains 7 labs covering topics like preparing ethernet cables, network commands, IP addressing, configuring and securing switches, VLANs, and servers with CDP. Each lab includes objectives, theoretical descriptions of the topics, and tasks to complete.

Uploaded by

amirhanzala831
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

LAB MANUAL

COMPUTER NETWORKS
Course Code: CSCN-348

DEPARTMENT OF ARTIFICIAL INTELLIGENCE


FACULTY OF ENGINEERING & COMPUTER SCIENCES
NATIONAL UNIVERSITY OF MODERN LANGUAGES
H-9, ISLAMABAD
PAKISTAN
BS (Computer Science) 2023

Preface
The lab manual has been designed to familiarize students with the layered approach in data communications,
switching technologies, and protocols. It would also help to have expertise in specific areas, such as the
design and maintenance of various types of networks.

Tools/ Technologies
• Packet Tracer
• GNS 3

2
BS (Computer Science) 2023

TABLE OF CONTENTS

Preface ............................................................................................................................................................... 2
Tools/ Technologies .......................................................................................................................................... 2
LAB 1: Preparing Ethernet Cables ................................................................................................................ 7
Objectives.......................................................................................................................................................... 7
1. Tools required: -.................................................................................................................................... 7
a. For Patch Cables (connect switches): .................................................................................................. 7
b. For Fixed Wiring: ................................................................................................................................. 7
2. Recommended: ...................................................................................................................................... 7
3. Introduction: About the Cable ............................................................................................................ 7
4. Introduction to RJ45 Plugs or Jacks:.................................................................................................. 8
5. Forms of Ethernet Cables - Crossed and Straight cables - When to use them ............................... 8
Notes: ............................................................................................................................................................. 9
6. Ethernet Cable Pin Outs and Connections ......................................................................................... 9
Theoretical Description ................................................................................................................................... 9
1. What Is Straight Through Cable? ....................................................................................................... 9
2. What Is Crossover Cable?.................................................................................................................. 10
3. Straight Through vs. Crossover Cable, which to choose? ............................................................... 10
4. Pin Out Tables for ethernet and fast ethernet connections............................................................. 11
5. How to wire Ethernet Patch Cables: ................................................................................................. 12
6. How to wire fixed Ethernet Cables: .................................................................................................. 12
Lab Tasks........................................................................................................................................................ 12
LAB 2: Understanding Network Commands .............................................................................................. 14
Objectives........................................................................................................................................................ 14
1. Equipment required: - ........................................................................................................................ 14
Recommendation........................................................................................................................................ 14
Theoretical Description ................................................................................................................................. 14
Lab Tasks........................................................................................................................................................ 19
LAB 3: IP Addressing and Subnetting......................................................................................................... 20
Objectives........................................................................................................................................................ 20
Theoretical Description ................................................................................................................................. 20
Lab Tasks........................................................................................................................................................ 26
LAB 4: Configuring basic Switch ................................................................................................................. 27

3
BS (Computer Science) 2023

Objectives........................................................................................................................................................ 27
1. Equipment required: - ........................................................................................................................ 27
Recommendation........................................................................................................................................ 27
Theoretical Description ................................................................................................................................. 27
Lab Tasks........................................................................................................................................................ 29
LAB 5: Securing the Switch .......................................................................................................................... 30
Objectives........................................................................................................................................................ 30
1. Equipment required: - ........................................................................................................................ 30
Recommendation........................................................................................................................................ 30
Theoretical Description ................................................................................................................................. 30
Lab Tasks........................................................................................................................................................ 33
LAB 6: Virtual LAN (VLANs)...................................................................................................................... 34
Objectives........................................................................................................................................................ 34
1. Equipment required: - ........................................................................................................................ 34
Recommendation........................................................................................................................................ 34
Connectivity with internet................................................................................................................................ 34
Theoretical Description ................................................................................................................................. 34
You will be able to see the mismatch message on CLIs of both of the switches. ........................................... 38
Lab Tasks........................................................................................................................................................ 39
LAB 7: Servers and CDP .............................................................................................................................. 40
Objectives........................................................................................................................................................ 40
1. Equipment required: - ........................................................................................................................ 40
Recommendation........................................................................................................................................ 40
Connectivity with internet................................................................................................................................ 40
Theoretical Description ................................................................................................................................. 40
DNS in Cisco packet tracer and how to configure DNS on Cisco router.................................................. 46
There are a couple of ways in which we can configure dns in packet tracer. We will configure dns on
the cisco router and endpoint server. ........................................................................................................... 46
Create a mapping for the Switch in the server so that PCs can ping the Switch with the name 'switch' ......... 48
Lab Tasks........................................................................................................................................................ 48
LAB 8: Switch Redundant connections and Loops (STP) ......................................................................... 49
Objectives........................................................................................................................................................ 49
1. Equipment required: - ........................................................................................................................ 49
Recommendation........................................................................................................................................ 49
Connectivity with internet................................................................................................................................ 49
Theoretical Description ................................................................................................................................. 49

4
BS (Computer Science) 2023

Spanning tree protocol ................................................................................................................................. 49


Lab Tasks........................................................................................................................................................ 50
1. Select switch 1 as a root bridge.................................................................................................................... 50
2. Enable rapid spanning tree protocol ............................................................................................................ 50
Lab Configuration ............................................................................................................................................ 50
Task 1 .............................................................................................................................................................. 50
Switch(config)#spanning-tree vlan 1 priority 0 ............................................................................................... 50
or ...................................................................................................................................................................... 50
Switch(config)#spanning-tree vlan 1 root primary .......................................................................................... 50
Task 2 .............................................................................................................................................................. 50
All Switches ..................................................................................................................................................... 50
Switch(config)#spanning-tree mode rapid-pvst ............................................................................................... 50
LAB 9: Setting up basic Router Configurations ......................................................................................... 51
Objectives........................................................................................................................................................ 51
1. Equipment required: - ........................................................................................................................ 51
Recommendation........................................................................................................................................ 51
Connectivity with internet................................................................................................................................ 51
Theoretical Description ................................................................................................................................. 51
Setting up router name and passwords......................................................................................................... 51
Basic router configuration in packet tracer .................................................................................................. 51
Lab Tasks........................................................................................................................................................ 53
LAB 10: Setting up Static Routes ................................................................................................................. 56
Objectives........................................................................................................................................................ 56
1. Equipment required: - ........................................................................................................................ 56
Recommendation........................................................................................................................................ 56
Theoretical Description ................................................................................................................................. 56
Static Routing Labs.................................................................................................................................... 56
Lab Tasks........................................................................................................................................................ 57
LAB 11: Setting up Default Routes .............................................................................................................. 59
Objectives........................................................................................................................................................ 59
1. Equipment required: - ........................................................................................................................ 59
Recommendation........................................................................................................................................ 59
Theoretical Description ................................................................................................................................. 59
Default Route .............................................................................................................................................. 59
Lab Tasks........................................................................................................................................................ 61
LAB 12: Configuring WAN Connection ...................................................................................................... 62
5
BS (Computer Science) 2023

Objectives........................................................................................................................................................ 62
1. Equipment required: - ........................................................................................................................ 62
Recommendation........................................................................................................................................ 62
Theoretical Description WAN Connection Labs .................................................................................... 62
Lab Tasks........................................................................................................................................................ 63
LAB 13: Implementing Router Information Protocol (RIP) ver. 2........................................................... 64
Objectives........................................................................................................................................................ 64
1. Equipment required: - ........................................................................................................................ 64
Recommendation........................................................................................................................................ 64
Connectivity with internet................................................................................................................................ 64
Theoretical Description ................................................................................................................................. 64
RIP Configuration: .................................................................................................................................... 64
Lab Tasks........................................................................................................................................................ 65

6
BS (Computer Science) 2023

LAB 1: Preparing Ethernet Cables


Objectives
How to wire Ethernet cables and connect them to RJ45 Jacks.

1. Tools required: -
• Cable - bulk Category 5, 5e, 6
• Wire Cutters - to cut the cable if necessary.
• Wire Stripper - to strip the cable if necessary.
a. For Patch Cables (connect switches):
• RJ45 Plugs
• RJ45 Crimper
b. For Fixed Wiring:
• RJ45 Jacks
2. Recommended:
• Wire Stripper
• Cable Tester
3. Introduction: About the Cable
You can find bulk supplies of the cable at many computer stores or most electrical or home centers. UTP
(Unshielded Twisted Pair) Category 5 cables are used for basic 10/100 Mbps functionality and CAT 5e and
6 for gigabit (1000BaseT) operation, and CAT 7 gives you a measure of future proofing.
Bulk cable comes in many types, and there are two basic
categories, solid and braided cable. Braided cable tends to work
better in patch applications for desktop use. It is more flexible
and resilient than solid cable and easier to work with but meant
for shorter lengths. Solid cable is meant for longer runs in a
fixed position.
The plenum-rated cable must be used whenever the cable travels
through an air circulation space, for example, above a false
ceiling or below a raised floor. It may be difficult or impossible to tell from the package what type of cable
it is, so peal out an end and investigate and look inside the cable. Usually, there are eight color-coded wires.
These wires are twisted into four pairs of wires, and each pair has a common color theme.
One wire in the pair is a solid or primarily solid-colored wire, and the other is a primarily white wire with a
colored stripe. Examples of the naming schemes used are Orange (alternatively Orange/White) for the solid-
colored wire and White/Orange for the striped cable. The twists are extremely important. Twisting is there
to counteract noise and interference.

It is important to wire according to a standard to get proper performance from the cable. The TIA/EIA-568-
A specifies two wiring standards for an 8-position modular connector such as RJ45. The two wiring
standards, T568A and T568B, vary only in the arrangement of the colored pairs.

7
BS (Computer Science) 2023

Your choice might be determined by the need to match existing wiring, jacks, or personal preference, but
you should maintain consistency. I've shown both below for straight-through cabling and just T568B for
crossover cabling.

4. Introduction to RJ45 Plugs or Jacks:


An 8-pin/8-position plug or jack is commonly used to connect computers to Ethernet-based local area
networks (LAN), as shown in figure 1.1. There are a couple of variations available. The primary variation
students need to pay attention to is whether the connector is intended for braided or solid wire.
For braided/stranded wires, the connector has sharp pointed contacts that pierce the wire.
For solid wires, the connector has fingers that cut through the insulation and contact the wire by grasping it
from both sides.
The connector is the weak point in an ethernet cable; choosing the wrong one will often cause grief later. If
you just walk into a computer store, it's nearly impossible to tell what type of plug it is. You may be able to
determine what type it is by crimping one without a cable.

Figure 1.1 RJ45 Plug or Jack

RJ45 jacks come in a variety of styles intended for several different mounting options. The choice is one of
the requirements and preferences. RJ45 jacks are designed to work only with solid cable. Most jacks come
labeled with color codes for either T568A, T568B, or both.

5. Forms of Ethernet Cables - Crossed and Straight cables - When to use them
The following diagram shows the Normal use of Crossed and Straight cables (see figure 1.2).

Figure 1.2 Type of ethernet cables


8
BS (Computer Science) 2023

Notes:

a. We show Straight cables as BLUE and Crossed as RED. That is our convention; the cable color can
be anything you choose or, more likely, the vendor decides.
b. To avoid the need for Crossed cables, many vendors provide UPLINK ports on Hubs or Switches -
these are specially designed to allow the use of a STRAIGHT cable when connecting back-to-back
Hubs or Switches. Read the manufacturer's documentation carefully.

6. Ethernet Cable Pin Outs and Connections


There are two basic cable pinouts. A straight-through cable is used to connect to a hub or Switch, and a
crossover cable is used to operate in a peer-to-peer fashion without a hub/switch.
Generally, all fixed wiring should be run straight through. Some ethernet interfaces can cross and un-cross a
cable automatically as needed, a handy feature.
NOTE: Standard, Straight-Through Wiring (both ends are the same):

Let's first learn how to find the PIN No. of the Connector. Make sure you identify and start with the correct
Pin.

Figure 1.3 Pinout of connector

Theoretical Description

1. What Is Straight Through Cable?


A straight-through cable is a type of twisted pair cable that is used in local area networks to connect a
computer to a network hub such as a router. This type of cable is also sometimes called a patch cable and is
an alternative to wireless connections where one or more computers access a router through a wireless
signal. On a straight-through cable, the wired pins match. Straight-through cable uses one wiring standard:
both ends use the T568A wiring standard, or both ends use the T568B wiring standard. The following figure
shows a straight-through cable of which both ends are wired as the T568B standard.

9
BS (Computer Science) 2023

Figure 1.4 Straight-Through cable connections

2. What Is Crossover Cable?


A crossover Ethernet cable is a type of Ethernet cable used to connect computing devices directly. Unlike
straight-through cable, the RJ45 crossover cable uses two different wiring standards: one end uses the
T568A wiring standard, and the other end uses the T568B wiring standard. The internal wiring of Ethernet
crossover cables reverses the transmit and receive signals. It is most often used to connect two devices of the
same type: e.g., two computers (via network interface controller) or two switches to each other.

Figure 1.5 Crossover Cable


3. Straight Through vs. Crossover Cable, which to choose?
Straight through vs. crossover cable, which one should I choose? Usually, straight-through cables are
primarily used for connecting, unlike devices. And crossover cables are used for connecting like devices.
Use straight-through Ethernet cable for the following cabling:
• Switch to Router
• Switch to PC or server
• Hub to PC or server

Use crossover cables for the following cabling:


10
BS (Computer Science) 2023

• Switch to switch
• Switch to Hub
• Hub to Hub
• Router to Router
• Router Ethernet port to PC NIC
• PC to PC

4. Pin Out Tables for ethernet and fast ethernet connections

Straight-Through Cable Pin Out for T568A


RJ45 Pin # Wire Color Wire Diagram 10Base-T Signal 1000Base-T Signal
(T568A) (T568A) 100Base-TX Signal
1 White/Green Transmit+ BI_DA+
2 Green Transmit- BI_DA-
3 White/Orange Receive+ BI_DB+
4 Blue Unused BI_DC+
5 White/Blue Unused BI_DC-
6 Orange Receive- BI_DB-
7 White/Brown Unused BI_DD+
8 Brown Unused BI_DD-

Straight-Through Cable Pin Out for T568B


RJ45 Pin # Wire Color Wire Diagram 10Base-T Signal 1000Base-T Signal
(T568B) (T568B) 100Base-TX Signal
1 White/Orange Transmit+ BI_DA+
2 Orange Transmit- BI_DA-
3 White/Green Receive+ BI_DB+
4 Blue Unused BI_DC+
5 White/Blue Unused BI_DC-
6 Green Receive- BI_DB-
7 White/Brown Unused BI_DD+
8 Brown Unused BI_DD-

Cross Over Cable (T568B):


RJ45 Pin # Wire Color Diagram End RJ45 Pin # Wire Color Diagram End
(END 1) #1 (END 2) #2
1 White/Orange 1 White/Green
2 Orange 2 Green
3 White/Green 3 White/Orange
4 Blue 4 White/Brown
5 White/Blue 5 Brown
6 Green 6 Orange
7 White/Brown 7 Blue
8 Brown 8 White/Blue

11
BS (Computer Science) 2023

Note: The crossover cable layout is suitable for 1000Base-T operation; all four pairs are crossed.

5. How to wire Ethernet Patch Cables:

a. Strip off about 2 inches of the cable sheath.


b. Untwist the pairs - don't untwist them beyond what you have exposed; the more untwisted cable you
have, the worse the problems you can run into.
c. Align the colored wires according to the diagrams above.
d. Trim all the wires to the same length, about 1/2" to 3/4" left exposed from the sheath.
e. Insert the wires into the RJ45 plug - make sure each wire is fully inserted into the front of the RJ45 plug
and in the correct order. The sheath of the cable should extend into the RJ45 plug by about 1/2" and will
be held in place by the crimp.
f. Crimp the RJ45 plug with the crimper tool.
g. Verify the wires ended up in the right order and that the wires extend to the front of the RJ45 plug and
make good contact with the metal contacts in the RJ45 plug
h. Cut the cable to length - make sure it is more than long enough for your needs.
i. Repeat the above steps for the second RJ45 plug.

6. How to wire fixed Ethernet Cables:

a. Run the full length (Max 100 meters) of cable in place, from endpoint to endpoint, making sure to leave
excess.
b. At one end, cut the wire to length, leaving enough length to work but not too much excess.
c. Strip off about 2 inches of the cable sheath.
d. Align each of the colored wires according to the layout of the jack.
e. Use the punch-down tool to insert each wire into the jack.
f. Repeat the above steps for the second RJ45 jack.

If a cable tester is available, use it to verify the proper connectivity of the cable. That should be it; if your
cable doesn't turn out, look closely at each end and see if you can find the problem. Often a wire ends up in
the wrong place, or one of the wires is making no contact or poor contact.

Also, double-check the color coding to verify it is correct. If you see a mistake or problem, cut the end off
and start again. A cable tester is invaluable at identifying and highlighting these issues.

When sizing cables, remember that an end-to-end connection should not extend more than 100m (~328ft). Try to
minimize the cable length; the longer the cable becomes, the more it may affect performance. This is usually
noticeable as a gradual decrease in speed and increase in latency.

Lab Tasks
Task A:
Prepare the ethernet cable during the lab. Explain the steps, and attach the pictures of the equipment and
steps performed with the Lab 1 report.

Task B
Perform the Lab task and attach it along with the lab report while submitting.

12
BS (Computer Science) 2023

1. Identifying the pins on the RJ45 male connector, which are used for transmission of 100 Mbps.
Identify The Color Pairs
PAIR NO 1 _____________________
PAIR NO 2 _____________________
PAIR NO 3 _____________________
PAIR NO 4 _____________________
2. Correctly number the pins of the jack
2. Label the
pins according
to the color
schemes

3. Provide a correct color code of the connector for 568b standard


Straight Cable Cross Cable

13
BS (Computer Science) 2023

LAB 2: Understanding Network Commands


Objectives
• Gather information including connection, hostname, Layer 2 MAC address, and Layer 3 TCP/IP network
address information.
• Compare network information to other PCs on the network.
• Learn to use the TCP/IP Packet Internet Groper (ping) command from a workstation.
• Learn to use the Trace Route (tracert) command from a workstation.
• Observe name resolution occurrences using WINS and/or DNS servers.
1. Equipment required: -
• Windows PC
Recommendation
Connectivity with internet

Theoretical Description

This lab assumes the use of any version of Windows XP and above. This is a non-destructive lab and can be
done on any machine without concern about changing the system configuration. Ideally, this lab is
performed in a Computer Lab or other LAN environment that connects to the internet.
The commands help us to diagnose the LAN environment and troubleshoot the network.
The following command will be used to practice during the lab:
a. Ensuring the computer has an IP address
b. Ping
c. Trace Route

a. Step 1 Connect to the internet


Establish and verify connectivity to the internet. This ensures the computer has an IP address.
Step 2 Gather TCP/IP configuration information
Use the Start menu to open the Command Prompt, an MS-DOS-like window.
Press Start > Programs >Accessories >Command Prompt
OR
Start >Programs >Command Prompt.
OR
Press Start>Run, Then type cmd.
The following figure shows the Command screen. Type ipconfig and press the Enter key. The spelling of
ipconfig is critical, while the case is not. It is short for IP Configuration.

14
BS (Computer Science) 2023

Figure 2.1 ipconfig command


This first screen shows the IP address, subnet mask, and default gateway. The IP address and the default
gateway should be in the same network or subnet. Otherwise, this host would not be able to communicate
outside the network. In figure 2.1, the subnet mask tells us that the first three octets must be the same to be
in the same network. Further understanding shall be taught in the next lab on IP addressing.
Note: If this computer is on a LAN, the default gateway might not be seen if it is running behind a Proxy
Server. Record the following information for this computer.
Step 3 Record the following TCP/IP information for this computer
IP address: ___________________________________________________________
Subnet Mask: _________________________________________________________
Default Gateway: ______________________________________________________

Record a couple of the IP Addresses:_______________________________________

Step 5 Check additional TCP/IP configuration information


To see detailed information, type ipconfig /all and press Enter. The figure shows the detailed IP
configuration screen.

Figure 2.2 ipconfig /all


The hostname, including the computer name and NetBIOS name, should be displayed. Also, the DHCP
server address, if used, and the date the IP lease starts and ends should be displayed. Look over the
information. Entries for the DNS, used in name resolution servers, may also be present.
The previous figure reveals that the Router is performing both DHCP and DNS services for this network.
This would likely be a small office or home office (SOHO) or small branch office implementation.
Notice the Physical Address (MAC) and the NIC model (Description).
Step 6 Close the screen
Close the screen when finished examining network settings.
Repeat the previous steps as necessary. Make sure that it is possible to return to and interpret this screen.
15
BS (Computer Science) 2023

Reflection
Based on observations, what can be deduced about the following results taken from three computers
connected to one Switch?
Computer 1
IP Address: 192.168.12.113
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.12.1
Computer 2
IP Address: 192.168.12.205
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.12.1
Computer 3
IP Address: 192.168.112.97
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.12.1
Should they be able to talk to each other? Are they all on the same network? Why or why not? If something
is wrong, what is most likely the problem
b. Using "ping" and "tracert "
Objective
• Learn to use the TCP/IP Packet Internet Groper (ping) command.
• Learn to use the Trace Route (tracert) command.
• Observe name resolution occurrences using WINS and/or DNS servers.
Background
This lab assumes the use of any version of Windows. This is a non-destructive lab and can be done on any
machine without concern about changing the system configuration.
Ideally, this lab is performed in a LAN environment that connects to the internet. It can be done from a
single remote connection via a modem or DSL-type connection. The student will need the IP addresses that
were recorded in the previous part of the lab.
Step 1 Establish and verify connectivity to the internet
This ensures the computer has an IP address.
Step 2 Access the command prompt
As accessed in the previous part of the lab.
Step 3 ping the IP address of another computer
In the window, type ping, a space, and the IP address of a computer recorded in the previous lab. The
following figure shows the successful results of ping to this IP address.

16
BS (Computer Science) 2023

Figure 2.3 Ping Command reply


ping uses the ICMP echo reply feature to test physical connectivity. Since the ping reports four attempts, it
indicates the reliability of the connection. Look over the results and verify that the ping was successful. Is
the ping successful?
Step 4 ping the IP address of the default gateway
Try to ping the IP address of the default gateway if one was listed in the last exercise. If the ping is
successful, it means there is physical connectivity to the Router on the local network and probably the rest of
the world.
Step 5 ping the IP address of a DHCP or DNS servers
Try to ping the IP address of any DHCP and/or DNS servers listed in the last exercise. If this works for
either server, and they are not in the network, what does this indicate?
_______________________________________________________________________
Was the ping successful? ____________________
Step 6 ping the Loopback IP address of this computer
Loopback address helps to identify if the NIC of the computer is working fine or if it is faulty.
Type the following command: ping 127.0.0.1
The 127.0.0.0 network is reserved for loopback testing. If the ping is successful, then TCP/IP is
properly installed and functioning on this computer.
Was the ping successful? ____________________
Step 7 ping the hostname of another computer
Try to ping the hostname of the computer that was recorded in the previous lab. The figure shows the
successful result of the ping of the hostname.

Figure 2.4 Pinging hostname


Look over the results. Notice that the first line of output shows the hostname, m450, in the example,
followed by the IP address. This means the computer was able to resolve the hostname to an IP address.
Without name resolution, the ping would have failed because TCP/IP only understands valid IP addresses,
not names.
If the ping was successful, it means that connectivity and discovery of IP addresses can be made with only a
hostname. This is how many early networks communicated. If successful, then ping a hostname also shows
that there is probably a WINS server working on the network.
Step 8 ping the Cisco website
Type the following command: ping www.cisco.com

17
BS (Computer Science) 2023

Figure 2.5 Ping Cisco.com


The first output line shows the Fully Qualified Domain Name (FQDN) followed by the IP address. A
Domain Name Service (DNS) server somewhere in the network was able to resolve the name to an IP
address. DNS servers resolve domain names, not hostnames, to IP addresses.
Without this name resolution, the ping would have failed because TCP/IP only understands valid IP
addresses. It would not be possible to use the web browser without this name resolution.
With DNS, connectivity to computers on the internet can be verified using a familiar web address, or
domain name, without having to know the actual IP address. If the nearest DNS server does not know the IP
address, the server asks for a DNS server higher in the Internet structure.
Step 9 ping the Microsoft website
Type the following command: ping www.microsoft.com

Figure 2.6 ping Microsoft.com


Notice that the DNS server was able to resolve the name to an IP address, but there is no response.
Some Microsoft routers are configured to ignore ping requests. This is a frequently implemented
security measure.
Ping some other domain names and record the results. For example, ping www.msn.de
________________________________________________________________________
________________________________________________________________________
c. Trace the route to the Cisco website
Type tracert www.cisco.com and press Enter.
tracert is TCP/IP abbreviation for traceroute. The preceding figure shows the successful result when
running a tracert from Bavaria in Germany. The first output line shows the FQDN followed by the IP
address. Therefore, a DNS server was able to resolve the name to an IP address. Then there are listings of all
routers the tracert requests had to pass through to get to the destination.
18
BS (Computer Science) 2023

tracert uses the same echo requests and replies as the ping command but in a slightly different way. Observe
that tracert contacted each Router three times. Compare the results to determine the consistency of the route.
Notice in the above example that there were relatively long delays after routers 11 and 13, possibly due to
congestion. The main thing is that there seems to be a relatively consistent connection.

Lab Tasks
1. Ping 127.0.0.1
2. Ping the default gateway
3. Ping your hostname
4. Ping the DNS server(s)
Do you get a positive reachability result? ___________________

5. How to obtain the following network configuration on your computer.


Host Name:

MAC Address:

IP Address:

Subnet Mask:

Default Gateway:

DHCP Servers:

Open a web browser and visit the following website: http://whatismyipaddress.com/


Is the reported IP address consistent with that obtained by ipconfig? If not, why?

19
BS (Computer Science) 2023

LAB 3: IP Addressing and Subnetting


Objectives
• Study the difference between IPv4 and IPv6.
• Learn the concept of subnetting.
• Study fixed length and variable length subnetting in IPV4.

Theoretical Description
IP Addressing
The Internet Protocol (IP) is the method or protocol by which data is sent from one computer to another on
the LAN or WAN. Each computer (known as a host) on the internet has at least one IP address that uniquely
identifies it from all other computers on the internet. Each Network Interface Card (NIC or Network card)
present in a PC is assigned one Network address called an IP address. This IP address is assigned by the
administrator of the network. There is a burned-in address on the NIC called a Physical Address [or MAC].
The MAC address of a network card indicates the vendor of that card and a unique serial number.
IPv4 IPv6

IPv4 addresses are 32-bit in length. IPv6 addresses are 128-bit in length.

IPv4 addresses are binary IPv6 addresses are binary


numbers represented in decimals. numbers represented in hexadecimal.

IPsec support is only optional. Inbuilt IPsec support.

Fragmentation is done by the sender and


Fragmentation is done only by the sender.
forwarding routers.

Broadcast Uni-cast
Multicast Multicast
Uni-cast Any-cast

Manual configuration (Static) of IPv4


addresses or DHCP (Dynamic Auto-configuration of addresses is
configuration) is required to available.
configure IPv4 addresses.

Roles of IPv4 Addressing


Format of the IP address
IPv4 is made up of four parts, in the pattern of w.x.y.z. Each part has eight binary bits, and the values in
decimal can range from 0 to 255. For example 31.223.182.162

20
BS (Computer Science) 2023

IP address classes
IP addresses are divided into different classes. These classes determine the maximum number of hosts per
network ID. Only three classes are used for network connectivity.
The following table lists all the address classes.
IP address class Value of the leftmost byte (part 1st Octet
w)
Class A 1-126 [0 and 127 are not allowed] 0

Class B 128-191 10

Class C 192-223 110

Class D 224-239 1110

Class E 240-255 1111

Grouping of IP addresses into different classes: A, B, C, D, and E.


Class A: first bit in part w is 0, and others can be anything.
IP Addressing
0000 0001: 1
0111 1110: 126
The first 8 bits are used for the network part, and the remaining for the host part.
Class B: First two bits in w are 10, and the others can be anything
1000 0000: 128
1011 1111: 191
The first 16 bits are used for the network part, and the remaining for the host part
Class C: first three bits in w are 110, and others can be anything
1100 0000: 128
1101 1111: 223
The first 24 bits are used for the network part, and the last 8 bits for the host part.
Class D: first four bits in w are 1110, and others can be anything; used for multicast.
1110 0000: 224
1110 1111: 239

21
BS (Computer Science) 2023

Default Subnet mask


It is used to identify the network part from the host part. Put binary one for the parts that represent the
network part and zero for the part that represents the host part.
Address Class Bits for Subnet Mask Subnet Mask
Class A 11111111 00000000 00000000 255.0.0.0
00000000
Class B 11111111 11111111 00000000 255.255.0.0
00000000
Class C 11111111 11111111 11111111 255.255.255.0
00000000

Private IP Addresses
Class Private Networks Subnet Mask Address Range
A 10.0.0.0 255.0.0.0 10.0.0.0 - 10.255.255.255
B 172.16.0.0 - 172.31.0.0 255.240.0.0 172.16.0.0 - 172.31.255.255
C 192.168.0.0 255.255.0.0 192.168.0.0 - 192.168.255.255

Invalid IP address:
a. If the network part is all 0s, the address belongs to the class, but this is an invalid IP address because,
for an IP address, all the network or host parts should not be all 1s or all 0s.
b. If the network part is all 1s, this address belongs to class E But due to the presence of all 1s, it is not
valid. This represents broadcast to all networks.
c. If the host part is all 0s, this represents the network address. This is not a valid IP address.
d. If the host part is all 1s, this represents the broadcast address. This is not a valid IP address.
e. 127.0.0.0 network address is used for loopback testing. This will help you to check the network card
of your own PC [localhost].
f. The validity of the IP address is also based on the subnet mask used provided.
Unicast: one device calls another.
Multicast: one device calls a group of the network.
Broadcast: one device calls the entire network.
Anycast: Mostly near
Subnetting
Subnetting is the practice of dividing a network into two or more networks.
Subnet mask
The subnet mask is a 32-bit value that allows the receptionist of the IP packet to distinguish the network
ID portion in the IP address from the host ID portion.
Class A, B, and C networks have default masks, also known as natural masks, as shown here:
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
Subnetting
Subnetting is the process of designating some high-order bits from the host part and grouping them with the
network mask to form the subnet mask. This divides a network into smaller subnets. The following diagram
modifies the example by moving 2 bits from the host part to the subnet mask to form four smaller subnets
one-quarter the previous size:
22
BS (Computer Science) 2023

Binary form Dot-decimal notation


IP address 11000000.10101000.00000101.10000010 192.168.5.130
Subnet mask 11111111.11111111.11111111.11000000 255.255.255.192
Network prefix 11000000.10101000.00000101.10000000 192.168.5.128
Host part 00000000.00000000.00000000.00000010 0.0.0.2

Special addresses and subnets


Internet Protocol version 4 uses specially designated address formats to facilitate recognition of special
address functionality. The first and the last subnets obtained by subnetting have traditionally had a special
designation and, early on, special usage implications. In addition, IPv4 uses all one's host addresses, i.e., the
last address within a network, for broadcast transmission to all hosts on the link.
Subnet zero and the all-ones subnet
The first subnet obtained from subnetting has all bits in the subnet bit group set to zero. It is therefore
called subnet zero. The last subnet obtained from subnetting has all bits in the subnet bit group set to one. It
is therefore called the all-ones subnet.
The IETF originally discouraged the production use of these two subnets due to possible confusion about
having a network and subnet with the same address. The practice of avoiding subnet zero and the all-ones
subnet was declared obsolete in 1995 by RFC 1878, an informational but now historical document.
Subnet and host counts
The number of subnetworks available and the number of possible hosts in a network may be readily
calculated. In the example (above), two bits were borrowed to create subnetworks, thus creating 4 (22)
possible subnets.
Network Network (binary) Broadcast address
192.168.5.0/26 11000000.10101000.00000101.00000000 192.168.5.63
192.168.5.64/26 11000000.10101000.00000101.01000000 192.168.5.127
192.168.5.128/26 11000000.10101000.00000101.10000000 192.168.5.191
192.168.5.192/26 11000000.10101000.00000101.11000000 192.168.5.255

The RFC 950 specification recommended reserving the subnet values consisting of all zeros (see above) and
all ones (broadcast), reducing the number of available subnets by two. However, due to the inefficiencies
introduced by this convention, it was abandoned for use on the public internet and is only relevant when
dealing with legacy equipment that does not implement CIDR. The only reason not to use the all-zeroes
subnet is that it is ambiguous when the prefix length is not available. RFC 950 itself did not make the use of
the zero-subnet illegal; it was, however, considered best practice by engineers.
CIDR-compliant routing protocols transmit both length and suffix. RFC 1878 provides a subnetting table
with examples.
The remaining bits after the subnet bits are used for addressing hosts within the subnet. In the above
example, the subnet mask consists of 26 bits, leaving 6 bits for the host identifier. This allows for 62 host
combinations (26-2).
The all-zeros value and all-ones values are reserved for the network address and broadcast address,
respectively. In systems that can handle CIDR, a count of two is therefore subtracted from the host

23
BS (Computer Science) 2023

availability rather than the subnet availability, making all 2n subnets available and removing a need to
subtract two subnets.
For example, under CIDR /28, all 16 subnets are usable. Each broadcast, i.e., .15 .31 - .255, comes off the
client count, not the network, thus making the last subnet also usable.
Only legacy technology not capable of using CIDR default in accordance with the RFC 1878 standard
required the subtraction of subnets, one at the beginning of the range and one at the end of the range. Cisco
added to this confusion by the use of subtracting from the subnetting formula in its publications for so-called
usable subnets up until 2007. Cisco routers, by default, did not allow an IP address belonging to subnet zero
to be configured on an interface.
In general, the number of available hosts on a subnet is 2h-2, where h is the number of bits used for the host
portion of the address. The number of available subnets is 2n, where is the number of bits used for the
network portion of the address. This is the RFC 1878 standard used by the IETF, the IEEE, and COMPTIA.
RFC 3021 specifies an exception to this rule for 31-bit subnet masks, which means the host identifier is only
one bit long for two permissible addresses. In such networks, usually point-to-point links, only two hosts
(the endpoints) may be connected, and a specification of network and broadcast addresses is not necessary.
A /24 network may be divided into the following subnets by increasing the subnet mask successively by one
bit. This affects the total number of hosts that can be addressed in the /24 network (last column).

Prefix size Network mask Available Usable hosts Total


subnets per subnet usable hosts
/24 255.255.255.0 1 254 254
/25 255.255.255.128 2 126 252
/26 255.255.255.192 4 62 248
/27 255.255.255.224 8 30 240
/28 255.255.255.240 16 14 224
/29 255.255.255.248 32 6 192
/30 255.255.255.252 64 2 128
/31 255.255.255.254 128 2* 256

*Only applicable for point-to-point links


Method of subnetting:
There are two methods of subnetting.
• FLSM (Fixed Length Subnet Mask)
In this method, the network is divided into equal lengths.
For example, if the required hosts are 50
We divide the network into
0-63
64-127
128-191
192-256

24
BS (Computer Science) 2023

• VLSM (Variable Length Subnet Mask)


In this method, the network is divided into different lengths.

Example of subnetting in class C:

For example, the required host is 60 from the below address


IP Address 192.168.1.0/24 255.255.255.0
1. After a search in the given table 64<60>32. This means 26=64 is the required host, so H=6
2. Converted network bits= Total host bits – Required host bits = 8 – 6 = 2. N=2.
As we are using class C then we have 24 network bits.

3. Total Network bits= Total + Converted network bits= 24 + 2 = 26.


4. Now we can find subnet mask by adding 1,s in to the two least significant bits 255.255.255. x x x x x
x x x
128 64 32 16 8 4 2 1
1 1 0 0 0 0 0 0
We add first two enable bits.
128 + 64 = 192
The Network address and subnet mask is 192.168.1.0 /26 255.255.255.192.
1. Block size of the network:
2. 0 to 63 192.168.1.0 (Network ID for 1st Block)-192.168.1.63(Broadcast ID for 1st Block)
3. 64 to 127 192.168.1.64 - 192.168.1.127
4. 128 to 191 192.168.1.128 - 192.168.1.191
192 to 255 192.168.1.192 - 192.168.1.255

25
BS (Computer Science) 2023

Lab Tasks
1. What address Class does 172.16.33.1/24 belong to?
2. When calculating usable hosts per subnet, the following formula is used 2^bits - 2. For what reason is two
subtracted?

26
BS (Computer Science) 2023

LAB 4: Configuring basic Switch


Objectives
• Perform basic switch configuration in Cisco packet tracer to enable Switch for the basic functionality.
• Complete walk-through of 100 MB full duplex configuration in Cisco Switch step by step.

1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation
Connectivity with internet

Theoretical Description
A good thing about the Cisco IOS is that it works quite similarly on both the routers as well as switches,
However, there is a difference in the commands that we use for each one of them. For example, some
specific commands are meant only for the switches while others for routers as per the device's functionality.
In this lab, we will assign an IP address to the Vlan1 interface and we will configure the default gateway on
the Switch. We will also perform some basic configurations which will prepare the Router for the functional
network.

Figure 4. 1 Ethernet cables connected to the Switch


Introduction to basic Switch configuration:
All switches comes with default VLAN1, To assign an IP address to the VLAN1 interface, we have to enter
into interface configuration mode. While configuring the Switch for basic functionality, we should also
assign a default gateway to the Switch.
It is important to remember that the VLAN1 interface and default gateway IP address must be on the same
network. This enables the Switch to redirect traffic to other networks.
Saving the configurations on Switch
Vlan1 interface allows to connect with the Switch remotely via telnet, we can use the telnet client to
remotely manage and configure the Switch. If you are unable to save the changes made to the Switch, all the
hard work will do down the drain. Therefore, if the changes made to the Switch is worth-a-while and
nothing unexpected has occurred, the user may save configuration on Cisco devices by typing the command
'write'. It copies the running-config to the startup-config alternatively we can also use the command' copy
running config startup config' to save the running configuration of the device.
No IP Domain Lookup
While configuring Cisco devices, it's common to make typing mistakes. If we mistype a command then the
Cisco device will try to resolve the name to the IP address. This makes Cisco devices freeze for about 60
27
BS (Computer Science) 2023

seconds as it resolves IP addresses in the background. One minute is the maximum time taken by the device.
Now, we have to wait until the device allows us to type something again. This can be very annoying. It
happens because the domain name lookup is enabled by default in Cisco devices. Hence, to solve this
problem we can disable domain lookup by entering the command 'No IP Domain Lookup' in switch
command line.
Logging synchronous
Now, let us talk about the status messages received on Cisco devices. When we receive status messages on
Cisco devices the message kind of mixes with the text that we type on the CLI. This can also be very
confusing sometimes. So, to solve this problem we can type the command' logging synchronous'. This
command synchronizes the status messages. Hence, the message does not interfere with our typing.

Speed and Duplex:


100Mb Full Duplex configuration.
Description:
Simplex – In this mode of communication, data is sent only in one direction, and the device at the receiving
end will only receive the data. The role of the sender and receiver cannot be changed in this mode of
connection.
Example of Simplex – TV is an example of simplex communication, it only receives data and no data is sent
back in the opposite direction.
Half-duplex – On this mode switch can only receive or send at the same time hence half duplex is a slow
connection and prevent the full-duplex Switch to work with full potential. On the other hand, hubs do not
have full-duplex functionality so they can only receive or send data at once.
Example of half-duplex – Radio is an example of a half-duplex in which data is sent by one device and
received by the other.
Full-duplex – full-duplex functionality allows a switch to transfer and receive data at the same time that
makes the bandwidth double therefore, we must check the devices for duplex mismatch because duplex
mismatch causes a collision and when a collision takes place then the data is lost so the device has to send
the data again which further reduces the speed of the network.
Example of the full-duplex – Telephone is an example of full-duplex communication as data can be sent and
received at the same time.
Most of the time Cisco auto-negotiation for duplex selection works perfectly, however in some instances, a
Cisco device is unable to detect the duplex mode and it may result in a duplex mismatch. This could result in
collisions in the network. Therefore, to fully utilize the bandwidth and the capacity of the Switch, it is a
good practice to hard-code the speed and duplex on the Cisco devices.
In this lab, we will configure the speed to 100 Mbps and the duplex mode to full. The duplex mode should
be configured on both switches. Now, to configure the duplex and speed, we will have to go into the specific
interface on which we want to hard-code the duplex setting.
After configuring both switches with full-duplex, we can solve the issue that occasionally occurs due to
auto-negotiate settings in the switches and if there is a 100MB connection between two switches then full-
duplex allow switches to work with double speed.
Please note that full-duplex configuration must be configured on each interface on which we want to
hardcode the full-duplex mode.

28
BS (Computer Science) 2023

Lab Tasks
Task 1
Switch(config)#interface fastethernet 0/1
Switch(config)#duplex full

Task 2
Switch(config)#interface fastethernet 0/1
Switch(config)#speed 100

Task 3
Apply the above on all ports of Switch, How Use range command

Task 4
Switch(config)#interface vlan 1
Switch(config-if)#ip address 192.168.4.2 255.255.255.0

Task 5
Switch(config)#ip default-gateway 192.168.4.1

Task 6
Switch#write

Task 7
Router(config)#no ip domain lookup

Task 8
Switch(config)#line con 0
Switch(config-line)#logging synchronous

29
BS (Computer Science) 2023

LAB 5: Securing the Switch

Objectives
• Configuring MOTD banner and Telnet in Packet Tracer.
• Learn about telnet configuration in Cisco packet tracer
• We will encrypt various passwords configured on the Cisco device using one command.
• we will be configuring switch port security in packet tracer to secure the Switch from unauthorized
access. We will allow only one MAC address to connect on switch-port.
1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation
Connectivity with internet

Theoretical Description
MOTD banner and Telnet
This lab exercise entails the basic setup of the Switch or a router. In this lab, we will configure the IP
address on a fast Ethernet port of the Router. We will name the interface the 'Branch Office Interface.'
Naming the interface is an excellent and very essential practice because it will let us know, to which location
the port is connected. As a Network Admin, when we log into a router, the description of the interfaces is
very helpful. It makes management of the interfaces a wee bit easier especially in the big networks where
there are many different devices. The user has to go into the interface configuration mode to set up the IP
Address and description.
You will also learn to configure MOTD [Message of the Day in this lab. When the user is logged into the
device then a message appears on the screen. That message is known as the Message of the Day (MOTD).
Usually, the MOTD banner is set up as a warning against unauthorized access.
Some people show ASCII art and huge messages like terms and conditions as a message of the day however
best practice is to use short and precise MOTD banners as big messages put extra load on the device which
results in unnecessary processor cycles.
It's all up to the admin to choose whatever message of the day should show up when we log in to the Cisco
device.
Telnet connection and Testing
Configuring the Telnet Connection on the Router allows the user to manage the Router remotely with the
help of a Telnet Protocol. Setting up a Telnet Connection also requires a Telnet Password to be configured.
We will configure that password in this lab. Also, we will have to get into the Telnet lines to configure the
telnet. We can do this by typing the line VTY command.
Configuration of the telnet helps a lot when we have to manage the device from the remote location or we
are not available onsite. Configuration of the devices remotely has become common practice now a day and
especially due to the Coronavirus outbreak, most of the IT individuals are working from home using the
internet.
Using the internet is not to connect to an office network is not safe and secure so to overcome this issue we
should use a VPN connection or we should use the SSH instead of telnet as it encrypts the data which
prevents the network from attacks of the hackers.

30
BS (Computer Science) 2023

Telnet configuration in Cisco packet tracer.

Description:
Telnet -Protocol developed in 1969, allow us to connect to the remote device using the command line
interface, telnet protocol is part of the TCP/IP suite.
To use the telnet, the device should have a telnet client installed and the remote device should be configured
to accept telnet connection so most of the devices like servers, routers, switches, firewalls, etc are
configured to allow telnet connection.
We can use any telnet client to establish the connection; one of the famous free telnet clients is putty. Putty
is used by many organizations as it is open source and it also works for the SSH connection.
In this packet tracer lab, we will set up a router for telnet access. And then use the command prompt on the
computer to test our telnet connection.
To telnet the Router from our PC we will have to assign an IP address to our PC. After that, we will assign
the IP address to the router interface which is connected with that PC.
For establishing a successful telnet connection, our PC and Router should be on the same network as the PC
and Router are connected directly.
After assigning the IP addresses to both our devices, we have to enable the Router for a telnet connection by
configuring the VTY lines.
We will configure telnet lines 0-15 on the Router, which will allow 16 simultaneous telnet connections to
the Router, this feature is helpful if more than one person wants to log in to the device at the same time, this
type of practice is common if we have many administrators to look after the device.
Once we have configured both devices properly, we can try pinging the Router from our PC to check the
connectivity. If the Router is responding to the ping command then we can establish a telnet connection
from our PC's command prompt.
Once the telnet connection is initiated successfully, we will be prompted with the password to access the
Router via a telnet connection.
An important thing, we have to configure the privileged mode password. That's because it is not possible to
access the privileged mode through a telnet connection if the password for our privileged mode is not
configured. if we will try to access privileged mode without the configuration of the password then we will
see an error message saying 'no password set'.

Cisco Password Encryption.


Configuring passwords and securing up devices is very important and we must configure the password on
different layers to prevent unauthorized access to the device.
Due to the increased number of cyber-attacks, networks now a day are more prone to online attacks rather
than physical damage to the devices and hackers continuously try to find out the loophole in the network to
compromise the security. Every year organizations lose thousands of dollars due to cyber-attacks and
sometimes important data is lost permanently. Most of these attacks can be prevented if the security is
properly implemented at every layer.
There are various types of devices available in the market to stop these attacks like advance firewalls,
intrusion prevention systems, antivirus, etc however we should not ignore the basic security parameters like
31
BS (Computer Science) 2023

setting up a good password on the device. Organizations spend a large amount of money on expensive
hardware to secure the networks however that can be of no use if security is not implemented at every layer.
In this lab, we will encrypt all the passwords on the device with one command.
When we configure passwords like Privileged Mode password, VTY line password, Console line password,
etc. on our Cisco devices, these passwords are visible as a clear text in the running-config. This is a security
vulnerability since anyone can view them just by looking at the running-config or start-up config. Even
when you are checking the Cisco device configuration, someone could be watching over your shoulder. To
fix this problem, we could use a command known as the 'service password-encryption. This command
encrypts all passwords and converts them into alphanumeric numbers. Hence, we can use this command to
store and display the passwords in encrypted form for added security.
Service password-encryption command encrypts the password so just by looking at the password, no will be
able to figure out or steal it however it does not provide complete protection as someone can easily copy that
encrypted password from the running or startup-config and can find the used password by decrypting that,
there are some sites available online that easily decrypt the password with just one click so we must use
enable secret that use MD5 hash to encrypt the password which is a very powerful encryption and it is not
easy to reverse engineer the hash.
Although password encryption should be enabled by default but it is not so we have to manually encrypt the
passwords.

Cisco Port Security


Configuring switch port security in packet tracer.
Cisco has implemented some security measures to safeguard its devices from unauthorized access.
Therefore, to be able to secure the physical ports on a Cisco Switch, we have to enable Port Security.
There are a few options available to the user while configuring the Port Security. One such option is to limit
the number of MAC Addresses that the port can connect with. This security feature does not provide
complete security however it makes it extremely difficult for the attacker to break into the network. The
only way a hacker can beat this security parameter is by finding out the attached mac-address and giving the
same mac-address to the device which attackers want to connect to the particular switch port.
Many times, some employees in the organization connect their devices to the switch port available in their
cubicle just for the fun or sometimes for experimental purposes, and if the security is not implemented then
that device can jeopardize the whole network and hackers can also this vulnerability to hack into the
network.
In this lab, we will allow only one MAC Address to be able to access the interface fast Ethernet 0/2. If some
other device is attached to the interface the port will go to a shutdown state. Also, when the port will be shut
down then the light on the Switch will turn amber on that switch port so the admin can find out the issue just
by looking at the physical indicator on the Switch.
To enable Port Security on a Cisco switch, we have to change the 'Switchport' mode from dynamic to
access. By default, the Switchport mode is set to dynamic. Once the Switchport mode is changed, we can
then enable the Switchport security on that port.
There are couple of ways in which we can restrict devices with random mac-address to connect with the
switch port.
One way is to hardcode the mac address on the switch interface with the command "switchport port-security
mac-address [mac-address number]"
Another command that we can use is "switchport port-security mac-address sticky", this command will stick
the already attached mac-address to the interface and other mac-address will be rejected so if devices with
other mac-address will try to connect with the interface then the interface will simply reject the connection
and we can also configure how the interface should react when the security violation takes place.
32
BS (Computer Science) 2023

Lab Tasks
Task 1
Click on pc2 > click desktop tab > click on terminal > click ok
(you should be able to access Router now)

Task 2
Router>
Router>enable
Router#configure terminal
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown

Task 3
Router(config)#interface fastEthernet 0/0
Router(config-if)#description BRANCH OFFICE INTERFACE

Task 4
Router(config)#banner motd / —- UNAUTHORIZED ACCESS IS NOT ALLOWED —- /

Task 5
Router(config)#line vty 0 15
Router(config-line)#password cisco
Router(config-line)#login

Task 6
Click on pc0 > click on desktop tab > click on ip configuration > set ip address
Task 7
Router(config)#interface fastethernet 0/0 Router(config-if)alp address 192.168.1.1 255.255.255.0
Task 8
R1(config)#enable password cisco Task Router(config)#line vty 0 15 Router(config-line)#password cisco
Router(config-line)#login
Task 9
Click on pc0 > click on command prompt > type telnet 192.168.1.1 > type privileged mode password
Task 10
Router(config)#enable secret cisco

Task 11
Router(config)#service password encryption

Task 12
Switch(config)#interface fastethernet 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
Switch(config-if)#switchport port-security maximum 1

Task 13
Switch(config-if)#switchport port-security violation shutdown
33
BS (Computer Science) 2023

LAB 6: Virtual LAN (VLANs)


Objectives
• Create and configure VLANs in Cisco packet tracer.
• Study the Router on a Stick Configuration.
• Learn to Configure native VLAN in Cisco packet tracer and Fix native VLAN mismatch.
1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation

Connectivity with internet

Theoretical Description
We will create VLAN 10 and VLAN 20 in this lab. It is always a good practice to give names to the VLANs
as this makes it easier for the admins to manage the configured VLANs. The best way to give a name is
according to their role in the network for e.g. if there is a VLAN that handles traffic for the voice of IP then
we can give the name 'voice' to the VLAN and another way of assigning a name is according to the
departments in the organization like Sales, marketing, etc.
In a case of a network outage or any issue with the VLANs, admins can easily identify the VLANs with
names, which makes their work easier
We can use the following command to create VLAN 10 and 20 and give it a name.
Switch(config)#vlan 10
Switch(config-vlan)#name Voice
Switch(config)#vlan 20
Switch(config-vlan)#name Sales
Once we are done creating the VLANs, we can check the created VLANs with the command 'show VLAN'

Assigning ports to VLANs:


You can see in the image above that although we have created the VLANs however to use those VLANs, we
have to assign ports to VLAN. By default, all ports are assigned to VLAN 1
We will assign 1 port to VLAN 10 and 5 ports to VLAN 20
If we want to assign multiple ports to a single VLAN then we can use the interface range command and
include the range of ports that we want to add to any VLAN
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config)#interface range fastEthernet 0/2 – 6
34
BS (Computer Science) 2023

Switch(config-if-range)#switchport mode access


Switch(config-if-range)#switchport access vlan 20
Now, we can see in the image below that assigned ports are appearing in the front of VLAN 10 and 20

Inter VLAN routing in packet tracer


Each VLAN represents a separate network so to enable routing from one VLAN to another VLAN; we have
to either use a layer 3 switch or Router.
On a single router interface, we can create sub interfaces and configure those interfaces to accept traffic
from specific VLANs so we can use only one interface that is connected to the Switch for routing purposes.
After configuring the sub-interfaces, we have to assign a default gateway on the end device so the default
gateway would be the IP address of the sub-interface specified for the same VLAN of the end device.
Now the traffic will travel within Switch when communicating with the end device in the same VLAN and
traffic will travel through the Router when communicating with devices on other VLANs.
Please check Lab 6.2 router on a stick lab to properly configure inter VLAN routing.

Router on A Stick:
'Router on a Stick' allows routing between VLANs with only one interface. Each VLAN represents a
different Subnet. In general, routers can take traffic from only one subnet and transfer it to another subnet.
And we can assign only one IP Address to a router interface. 'Router on a stick' allows us to create sub-
interfaces, and assign IP Addresses to those sub-interfaces. To make it work, we have to create a truck
connection between the Switch and a router so that traffic from multiple VLANs can be sent to the Router.
If we create a route between VLANs without the 'Router on a Stick' method, then we have to waste
interfaces on the switches and routers. And if we enable routing between multiple VLANs then it will
become practically inefficient as the switches and the routers will use those multiple interfaces.
The image below is an alternative method for allowing routing between VLANs. As you can see, we are
using two interfaces on both the Router and a switch to allow routing between VLANs. We have not created
a sub-interface in the below figure.

35
BS (Computer Science) 2023

You can see that we have to use extra interfaces for each VLAN. So, it becomes practically non-efficient if
we have multiple VLANs. Hence, 'Router on a Stick' is a perfect solution for routing between VLANs with
just one router interface.
The simpler way to do routing between VLANs is by using a Layer 3 Switch. We just have to create virtual
interfaces for each VLAN and assign them IP Addresses from the same network. A Layer 3 Switch will then
enable routing between VLANs as it has routing capabilities as well. However, Layer 3 Switch is quite
expensive so it might not be an affordable option for small office networks.
In the below lab, we will configure 'Router on a Stick' that would allow routing between the VLANs. Some
of the important concepts in this lab are – to create sub-interfaces, use encapsulation dot1Q command to
encapsulate the traffic, and mentioning the VLAN number to ascertain that for which VLAN the sub-
interface should respond.
Router on a stick configuration in packet tracer.

Native VLAN and Mismatch:


Native VLAN – Native VLAN allows untagged traffic to be part of one particular VLAN. Native VLAN
functionality is used when untagged traffic is received on the trunk connection of the Switch.

36
BS (Computer Science) 2023

In the above image, you can see that the Hub is connected with the Switch. VLAN and tagging are switching
technology and as Hub is unable to tag the traffic then what will happen if PC 4 and PC 5 which are
connected to the Hub send the traffic? In that case, we have to specify native VLAN on both of the switches
interfaces that are connected to Hub and that will help when the Switch will receive the untagged traffic on
those interfaces then it will be the part of the specified VLAN which we have configured as Native VLAN.
Although Hubs are not in use now a day's however in a small organization where the budget is low and
organizations cannot afford to spend money on new network equipment and they want to use the old
network devices then network admin may have to work with such topologies.
In small networks, speed is not the priority for the company so using the device as a hub does not harm the
network.
Another network scenario, in which native VLAN is used commonly, is shown below. IP phones are used
commonly in the companies these days, they allow daisy-chaining of end devices like PC which saves the
interfaces and saves the extra cost of the telecom.
Daisy-chaining the PC is an efficient solution as an organization does not have to buy extra switches to
implement IP phones.

PC 6 cannot tag the traffic so we have to configure Native VLAN to route the traffic generated by the PC on
the desired VLAN however, Cisco IP phone can tag the traffic so native VLAN will only be used by the PC.
By default, native VLAN is configured as 1 on all the interfaces however, in case we want to route traffic to
another VLAN then we have to change the native VLAN accordingly.
To check the native VLAN that is configured, we can use the command' show interfaces trunk'

37
BS (Computer Science) 2023

To configure the native VLAN or to change the default native VLAN, we have to use the following
command.
Switch(config)#interface FastEthernet 0/24
Switch(config-if)#switchport trunk native vlan 5
We have to enter into interface configuration mode and then use the command shown above; we have to
specify the VLAN number where we want to redirect untagged traffic. In the above example, traffic will be
routed to the VLAN 5.
Native VLAN mismatch
Native VLAN mismatch happens when interfaces of the Switch are configured with different native VLAN
and in that case traffic generated by PC will be routed to both VLAN which will cause issues in the network.
The good thing about the Switch is that it detects the native VLAN itself and the following message is
displayed on the Command-line interface of the device.
— %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/24 (5),
with Switch FastEthernet0/24 (1) —
To fix the Native VLAN mismatch, we have to configure the same native VLAN on all interfaces that are
connected to the Hub so the traffic generated will only be redirected to the one VLAN.
In this lab, we have intentionally created a native VLAN mismatch so you can download this lab and can
practice fixing the mismatch by assigning the same Native VLAN on both switches.

You will be able to see the mismatch message on CLIs of both of the switches.

38
BS (Computer Science) 2023

Lab Tasks
• Assign IP address and default gateway to the PC
• Create Vlans and assign ports to the Vlans
• Configure trunk connection between Router and a switch
• Create sub-interface and allow routing between the Vlans

Lab Configuration

Task 1
Click on pc0 > click on desktop tab > click on IP configuration > set IP address and default gateway

Task 2
Switch(config)#interface fa0/5
Switch(config-if)#switchport access vlan 5
Switch(config-if)#in fa0/10
Switch(config-if)#switchport access vlan 10

Task 3
Switch(config)#in fastethernet 0/1
Switch(config-if)#switchport mode trunk

Task 4
Router(config)#in fa 0/1
Router(config-if)#no shutdown
Router(config)#interface fastethernet 0/1.5
Router(config-subif)#encapsulation dot1Q 5
Router(config-subif)#ip address 192.168.2.1 255.255.255.0
Router(config-subif)#in fastethernet 0/1.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip add 192.168.3.1 255.255.255.0

39
BS (Computer Science) 2023

LAB 7: Servers and CDP


Objectives
• Using CDP protocol to find out neighbor information in Cisco packet tracer.
• Setting up a DHCP server in Cisco packet tracer.
• Configure a web server in Cisco packet tracer and access the internet in packet tracer.
1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation

Connectivity with internet

Theoretical Description
CDP Protocol:
CDP is a handy protocol. It is a fantastic tool for searching the details about directly connected devices.
However, being Cisco propriety, it only works if the connected device is a Cisco device. It sends messages
to the directly connected devices, these messages contain details about the host, devices, network, IOS,
ports, etc. It is enabled by default on all Cisco devices.
CDP protocol generates messages every 60 seconds, these messages are received by the neighbor device and
then the information is stored in the database.
CDP provides us with information that is quite useful if we do not have a complete diagram or have
incomplete documentation about the network.
By using CDP we can find out the following information:
The hostname of the remote devices
Local and remote interfaces on which the devices are connected
Type of device and the platform
The IP address of the connected devices
The version of IOS running
Although CDP provides good information about the directly connected devices however it can also pose a
security threat to the network as hackers can identify and gather information very easily if any device in the
network is compromised so it is the best practice to use this protocol very carefully and disable this protocol
on highly secure devices. For e.g, we should not send CDP messages on the interface that is connecting
outside of our network.
If we do not have the cisco device on the other end then the CDP protocol will not work however we can use
the LLDP (Link Layer Discovery Protocol) as an alternative since it is a non-proprietary protocol so most of
the vendors support this protocol. It is an industry-standard protocol with the same functionality.
In this lab, you will be required to find information about directly connected devices. To find complete
information and details of all the devices, you have to use telnet because CDP can only provide information
about directly connected devices. In the below lab, 'device0' does not have a direct link to all Cisco devices.
And finally, we have to disable the CDP on the fast Ethernet 0/5 interface of router 5 – which is connected
with the ISP router – because we do not want to pass our internal network information to the internet service
provider (ISP).
CDP in packet tracer.

40
BS (Computer Science) 2023

DHCP Server:
Setting up a DHCP server and configuring the Router as DHCP server in Cisco packet tracer.

In the Cisco packet tracer, various endpoints are given that we can use to create networks and one of them is
the server. This single server provides lots of services like HTTP, FTP, email, DHCP, etc.
Before enabling the DHCP service on the server, we must assign the static IP address to the server to
establish connectivity.

41
BS (Computer Science) 2023

PC should be configured to accept IPs from the DHCP server so we will change IP configuration from static
to DHCP.
To configure the DHCP service, we have to click on the DHCP tab and turn on the DHCP service.
We can change the default name of the pool which is server pool.
We can set up the default gateway and DNS if required as per our network design.
Define the start IP address so the server will issue the IP address according to our scope mentioned.
We now have to define the maximum number of users so the server will not lease IP addresses to the
devices if the limit is reached. In this example, the defined limit is 10 in pool1, now the server will only
release 10 IP addresses even if the mentioned IP range scope has a high number of IP addresses.
Multiple pools can be added to the server and if any pool is not required then it can be removed easily.
42
BS (Computer Science) 2023

One extra pool name as pool1 has been added to the server with a different IP range so now the server has a
lot more IPs to assign.

We can see in the image above that PC has been assigned an IP address successfully by the DHCP server.
An assigned IP address is from the configured scope on the server.
Now, as we are done configuring the DHCP on the server. We will configure the Router as a DHCP server
in the following packet tracer lab.

We have to configure the same parameters on the Router as well however we have to use the Router's
command-line interface to set up the routers with DHCP capabilities.
We will configure DHCP on the Cisco router with 4 easy steps.
Creating a pool and naming the pool. In this lab, we have given the name 'dynamic' to the DHCP pool.
Command : Router(config)#ip dhcp pool Dynamic
Defining the ranges of the addresses that the Router will lease to the clients.
Command: Router(dhcp-config)#network 192.168.1.0 255.255.255.0
Excluding the range of IP addresses that we do not want the Router to lease, this comes in handy when we
want to keep some IPs that can be assigned to the devices statically whenever required in our network. In
this example, we have assigned IP 192.168.1.1 to the Router so we should exclude this IP to prevent any IP
address conflict.
Command: Router(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.5
Finally, we will enable the DHCP service on the Router using the following command.
Command: Router(config)#service dhcp
Additionally, the time limit can be defined for the lease. For e.g, if we want the Router to lease IP for a
certain period then we can configure the same using the following command.
Command: Router(config)#lease 10 10 10
This would mean that Router will lease the IP for 10 days 10 hours and 10 mins. After the defined period,
the client will be given a new IP address.
43
BS (Computer Science) 2023

Or
Use the following command to lease the IP for an indefinite time.
Command: Router(config)#lease infinite.
In the image, we can see that the PC has received the IP address from the Router so now the Router is acting
as a DHCP server.

Web Server and Internet:


To simulate the internet, we have to configure the server endpoint given. The server has the capabilities to
provide the web service.

We have two hosts that will be able to access the internet via an ISP router. Our internal network is
connected to the ISP router. The interface of the internal Router which is connected to the ISP router has
been given public IP address. This is static IP that has been configured on the interface.
ISP router is further connected to the Google web server so after the successful configuration of our
network, we should be able to access the google.com
How to configure the web server.
We have to open services and click on HTTP service. This service is enabled by default and we can see that
server is hosting some files already. These files are present by default and when we point the web browser to
this server, this server will serve the web page to our browser.

44
BS (Computer Science) 2023

We have configured this server as a Google web server and it is serving a Google web page. To change the
content of the webpage, we have to edit the index file present in the web server.
For testing purposes, we can copy the source code of any side that you want the web server to show and
paste it into the index file. After saving the file, the web server will show sites according to the source code.
Now, we can test the web server by opening the browser on the PC and pointing it to the server.

We have to enter the IP address of the web server in the URL and press enter. If everything is configured
properly then we should see the browser loading the webpage successfully.

Before opening the browser, we must make sure that the connectivity of the server is fine.
Download the lab and test the Google web server and if you want the server to host any other site then
change the index file present on the server.

45
BS (Computer Science) 2023

This lab is the smaller presentation of the big network like the internet. This is the way how the internet
works however there are thousands of routers and servers connected forming a huge network.
You can try adding more servers with different sites and access those sites on the browser of the PC.
DNS in Cisco packet tracer and how to configure DNS on Cisco router
There are a couple of ways in which we can configure dns in packet tracer. We will configure dns on
the cisco router and endpoint server.
DNS means domain name server, and DNS contains a database of domain names and IP mapping. DNS
servers are very helpful as we don't have to remember the IP address and we can use the domain name
instead. Names are much easier to type and learn so DNS plays an important role in every network.

When we enter google.com in the web browser the DNS server finds out the mapped IP of that domain and
the HTTP request is forwarded to that IP address.

Configure DNS on the Cisco router


To configure the Cisco router as DNS, we have to enable the DNS service on the Router using the following
command.

Router(config)#ip dns server

Now, we have to map the names with the IP address using the following command.

Router(config)#ip host PC1 192.168.1.5

Router(config)#ip host PC2 192.168.1.6

Finally, we need to configure the DNS server IP in the PC setting. In this case, as the Router is configured as
a DNS server, we will use the Router's IP.

Now, we can ping one PC from another PC with their names.

Please note that Configuring the Cisco router as a DNS server is not possible in packet tracer as it does not
provide this functionality however If you want to try this lab then you can use GNS3 as it has all the
commands.

Configuring DNS in Cisco packet tracer with the available server endpoint

46
BS (Computer Science) 2023

To configure the DNS server, we have to enable the DNS service in the server which is disabled by default.

Now, we have to add an A record or create a name for IP mapping in the server.

Finally, PCs should be configured with the IP address of the server in the DNS settings.

That is all required to successfully enable the DNS server in packet tracer.

Now, we should be able to ping the PCs with the names.

C:\>ping PC2

Pinging 192.168.1.6 with 32 bytes of data:

Reply from 192.168.1.6: bytes=32 time=35ms TTL=128

Reply from 192.168.1.6: bytes=32 time<1ms TTL=128

Reply from 192.168.1.6: bytes=32 time<1ms TTL=128

Reply from 192.168.1.6: bytes=32 time<1ms TTL=128

As expected, we can ping one PC from another with the names.

47
BS (Computer Science) 2023

Download this lab and ping the PC with names, and you will see the successful ping replies.

Activity for you

Create a mapping for the Switch in the server so that PCs can ping the Switch with the name 'switch'

Lab Tasks
a. Use CDP commands to find out Cisco devices 1 to 5
b. Find out their IPs and interfaces on which they are connected.
c. Disable CDP on interface FastEthernet 0/1 of device 5
(YOU ARE ONLY ALLOWED TO ACCESS SWITCH 0 THROUGH CONSOLE CONNECTION)
(USE TELNET TO ACCESS DEVICE 1)
(TELNET PASSWORD – cisco)
(Privileged mode password – cisco)
Lab Configuration
Task 1
Router#show cdp neighbors
Router#show cdp neighbors detail

Task 2
From Switch 0
local interface – Remote interface and IP address
1. FastEthernet 0/1 FastEthernet 0/1- 192.168.1.100
2. FastEthernet 0/2 FastEthernet 0/0- 192.168.1.3
3. FastEthernet 0/3 FastEthernet 0/0- 192.168.1.4
From Switch 1
4. FastEthernet 0/2 FastEthernet 0/0- 192.168.1.45/24
5. FastEthernet 0/3 FastEthernet 0/0- 192.168.1.43/24

Task 3
Router(config)#interface fastethernet 0/1
Router(config-if)#no cdp enable

48
BS (Computer Science) 2023

LAB 8: Switch Redundant connections and Loops (STP)


Objectives
• Using CDP protocol to find out neighbor information in Cisco packet tracer.
• Setting up a DHCP server in Cisco packet tracer.
• Configure a web server in Cisco packet tracer and access the internet in packet tracer.
1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation

Connectivity with internet

Theoretical Description
Spanning tree protocol
In a typical network topology, we have redundant connections between switches. Redundant connections
play a very crucial role as it eliminates the single point of failure in the network. However, redundant
connections create loop in the network. And to prevent those loops in networks the Spanning Tree Protocol
chooses the best link while blocking the redundant links.

Root Bridge is the most important Switch in a Spanning Tree Network. And all the other switches choose
the best way to reach a Root Bridge and block the redundant links. Therefore, it is very important to choose
the best Switch in the network as a Root Bridge.

Root is selected on the basis of a Bridge ID. So, whichever Switch will have the lowest Bridge ID, that very
Switch will be selected as a Root Bridge. Basically, Bridge ID is made up of a priority number and the MAC
address. And by default, all switches have the same priority number – 32768 to be precise – so the Spanning
Tree relies on a MAC address for the selection of Root Bridge. But the problem is that by default any switch
which has the lowest Bridge ID can be automatically selected as a Root Bridge. And if that Switch is slow
then it will slow down the entire network because its network traffic will pass through that Switch. Hence, it
is very important that every Spanning Tree Network has the best Switch as a root.

By default, the Spanning Tree is enabled on the switches so if we create a redundant connection on switches
then the Spanning Tree Protocol will automatically come into action to prevent a loop in the network.
Therefore, for maximum optimization it is very important to select the right Switch as a Root Bridge.
We cannot however, change the MAC address of a switch so we will have to change the priority number of
switches to influence the selection of a Root Bridge.

In this lab, we will try changing the priority of a switch to be able to select the Switch of our choice as a
Root Bridge. Root Bridge is selected as per the VLAN number so we have to mention that for which VLAN,
the Switch is a root. We will also enable a newer version of the Spanning Tree which is a Rapid Spanning
Tree.

49
BS (Computer Science) 2023

Spanning tree protocol configuration in packet tracer.

Lab Tasks
1. Select switch 1 as a root bridge

2. Enable rapid spanning tree protocol

Lab Configuration

Task 1

Switch(config)#spanning-tree vlan 1 priority 0

or

Switch(config)#spanning-tree vlan 1 root primary

Task 2

All Switches

Switch(config)#spanning-tree mode rapid-pvst

50
BS (Computer Science) 2023

LAB 9: Setting up basic Router Configurations


Objectives
• Configure the hostname of a router.
• Configure the password for a router.
• We will configure three Cisco routers. We will enable these routers for dynamic routing using the Rip
protocol.
1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation

Connectivity with internet

Theoretical Description

Setting up router name and passwords


By default, Cisco router is configured with the hostname as 'router' and Switch is configured with the default
hostname of 'switch' so we must change the default names of all the devices to make it relevant to the
network diagram and this also makes it easy to understand and help us recognize the device when we are
configuring the device.
It is the best practice to give hostnames to the devices according to the location for example if the Router is
situated in network then we can give the hostname as network followed by the model number [Network
1700] or we can give the hostname as per the role of the device for example If a router is connecting to the
ISP then a good hostname can be ISP router.
Once a password is configured, users will be prompted to type in that password whenever they enter the
Privileged Exec Mode. And if both the 'Enable Password' and 'Secret' are configured, then the users will
have to access the Privileged Mode with 'Enable Secret' as enable secret is considered a superior password.
In this lab, we will also configure the Console line password and Auxiliary line password. To set up the
Console line and Auxiliary line passwords we have to get under the line configuration mode of both lines.
We will also edit the hostname of our device. The device's name will instantly change when we enter the
command – 'hostname device-name' on the Command-line Interface. And to check the configured password
for the privileged mode you have to exit back to the User Exec mode by simply typing Exit while on the
Privileged mode. Then, you will have to type the password every time you enter into the Privileged mode.
You can check the password by initiating a Console connection once again. However, the Auxiliary line
password cannot be simulated in the Packet Tracer.

Basic router configuration in packet tracer


Configuration of RIP protocol is very easy as compared to some of the link-state routing protocols like
OSPF or EIGRP however RIP protocol does not offer that many features and RIP has a very simple working
mechanism. RIP protocol uses hop counts when directing the traffic in the network.

RIP protocol is still widely used due to its simplicity and it is favored in small company networks where
there is a fewer number of routers used and small networks do not even need advance routing protocols as
51
BS (Computer Science) 2023

they rarely use features that are provided by the advance routing protocols while big companies with
hundreds of Router and complex networks use advance routing protocols as they provide more features that
are required for the stability and the functioning of the big networks so at the end it comes up to the
requirement of the network.

To set up routers, we will assign an IP address to the router interfaces. It's the best practice to give a unique
name to the Router, as well as describing the interfaces of the routers.

To enable the routing between routers we will use a basic routing protocol called Rip. After implementing
the Rip protocol on all routers, we can look into the routing table of every Router to check if it has learned
the routes with the help of the Rip protocol. We can check the routing table using the command 'show IP
route'.

After successful configuration of the routing protocol, we must see the routes in the routing table learned
with the help of RIP and if we are unable to see the routes then we have to check the configuration and
troubleshoot the issue with the configuration.

In the below image, check out the routes that are learned using RIP protocol by the Router, you should also
make sure that Router should learn routes of all the networks in the diagram.

R is representing the RIP protocol so all the routes having R in the front are learned by the Router via RIP
protocol.

By default, the RIP protocol auto summarizes the routes so we have to disable the summarization on each
Router.

We will also disable auto summarization of the routes in the routing table by using the command 'no auto
summary'.

Also, we will set up a MOTD banner on all the routers.

52
BS (Computer Science) 2023

Lab Tasks
a. Setting router name to R1
b. Set privileged mode password to cisco
c. Set privileged mode secret to cisco
d. Set console line password to lab
e. Set auxiliary line password to ciscolab

Lab Configuration:
Task 1
Router(config)#hostname R1
R1(config)#
Task 2
R1(config)#enable password cisco

Task 3
R1(config)#enable secret cisco
Task 4
R1(config)#line con 0
R1(config-line)#password lab
R1(config-line)#login
Task 5
R1(config)#line aux 0
R1(config-line)#password ciscolab
R1(config-line)#login

Lab Tasks:

a. assign IP address the router interfaces


b. enable rip protocol and disable auto summarization
c. set router 0 name as Arizona, router 1 as Virginia, router 2 as NY
d. Set description of the interfaces as follow
e. fa 0/0 interface of router 0 – connection to headquarter

fa 0/0 of router 1 – connection to branch 1

se 2/0 of router 1 – connection to branch 2

se 2/0 of router 2 – connection to headquarter

f.
g. Set MOTD on all routers to —- UNAUTHORIZED ACCESS IS NOT ALLOWED —-

Lab Configuration:

Task 6
Router 0

53
BS (Computer Science) 2023

Router(config)#in fa 0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#no sh

Router 1
Router(config)#in fa 0/0
Router(config-if)#ip add 192.168.1.2 255.255.255.0
Router(config-if)#no sh

Router(config-if)#in se 2/0
Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#no sh
Router(config-if)#clock rate 56000

Router 2
Router(config)#in se 2/0
Router(config-if)#ip add 192.168.2.2 255.255.255.0
Router(config-if)# no sh

Task 7
Router 0
Router(config)#router rip
Router(config-router)#ver 2
Router(config-router)#network 192.168.1.0
Router(config-router)#no auto-summary

Router 1
Router(config)#router rip
Router(config-router)#ver 2
Router(config-router)#network 192.168.1.0
Router(config-router)#network 192.168.2.0
Router(config-router)#no auto-summary

Router 2
Router(config)#router rip
Router(config-router)#ver 2
Router(config-router)#network 192.168.2.0
Router(config-router)#no auto-summary

Router(config)#interface fastEthernet 0/0

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#no shutdown

Task 8
Router 0
Router(config)#hostname Arizona
54
BS (Computer Science) 2023

Router 1
Router(config)#hostname Virginia

Router 2
Router(config)#hostname NY

Task 9
Router 0
Router(config)#in fa 0/0

Router(config-if)#description connection to headquarter

Router 1
Router(config)#in fa 0/0

Router(config-if)#description connection to branch 1

Router(config)#in se 2/0

Router(config-if)#description connection to branch 2

Router 2
Router(config)#in se 2/0

Router(config-if)#description connection to headquarter

Task 10
On all routers

Router(config)#banner motd / —- UNAUTHORIZED ACCESS IS NOT ALLOWED —- /

55
BS (Computer Science) 2023

LAB 10: Setting up Static Routes


Objectives
• Configure the Router for static routing.
1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation
Connectivity with internet

Theoretical Description
Static Routing Labs
Static routes – Static routes are those routes that are configured manually on the Router. Static routes are
useful when we have a very small network with a small number of routers. We do not require routing
protocols in a small network where routes are not constantly changing and we do not have new routers
added often in the network.

A static route is easy to configure however it takes time to build manual routes so dynamic routing with
routing protocol is the only choice we have when working with big networks.

In big networks, we have thousands of routes are they are constantly changing so in that situation, we have
to use the advance routing protocol which helps us to easily handle all the routes, and routing protocol also
provide us with many features like load balancing, auto alternative route selection, etc

In this example, you will learn to perform the basic configuration of the static route. First of all, we have to
assign the IP Addresses to the router interfaces that are connecting different routers. After assigning the IP
Addresses, you should easily be able to ping the devices that are directly connected. However, to reach out
to the routers that are not directly connected, or to reach to the other networks, routers should have their
routes specified in the routing table.

Routers can learn their routes with the help of a routing protocol, or else we can specify the static route on
those routers so that they can reach other networks that they don't yet recognize.

And to create a static route, we have to make the Router aware of the other networks so that it can reach out
to them. And for that, it has to go out to its interface.

For example, in the following scenario we have to tell Router 0 that to reach the 192.168.1.0 network, it has
to go out to its interface using the IP Address 192.168.1.2

Now, we don't have to configure the static route on router 1 as it already knows about the networks
192.168.1.0 and 192.168.2.0 being directly connected to these networks. However, we have to configure the
static route on router 2 as it does not know about the 192.168.1.0 network.

56
BS (Computer Science) 2023

Once we have configured the static routes, you will be able to see those static routes in your routing table.
And finally, to confirm, you can try pinging router 2 from router 0 and check if they have been configured
correctly.

Lab Tasks
a. configure ip addresses on all routers and establish connectivity
b. create a static route on Router 0 to reach 192.168.2.0/24 network
c. create a static route on router 2 to reach 192.168.1.0/24 network
d. Test connectivity by pinging router 2 from router 0

Lab Configuration:

Task 1

Router 0

Router(config)#interface fastethernet 0/0


Router(config-if)#ip address 192.168.1.1 255.255.255.0 Router(config-if)#no shutdown

Router 1

Router(config)#interface fastethernet 0/0


Router(config-if)#ip address 192.168.1.2 255.255.255.0 Router(config-if)#no shutdown
Router(config)#interface fastethernet 0/1
Router(config-if)#ip address 192.168.2.1 255.255.255.0 Router(config-if)#no shutdown

Router 2

Router(config)#interface fastethernet 0/0

Router(config-if)# ip address 192.168.2.2 255.255.255.0 Router(config-if)#no shutdown

57
BS (Computer Science) 2023

Task 2

Router 0

Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.1.2

Task 3
Router 2
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1

58
BS (Computer Science) 2023

LAB 11: Setting up Default Routes


Objectives
• Configuring default static route in Cisco packet tracer and discuss the role of static route in networking.
1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation
Connectivity with internet

Theoretical Description
Default Route
A Default Static Route is configured on the routers so the traffic can be transferred to a default route if there
is no entry in the routing table for a specific network.

Before sending packets to the other networks, routers check their routing table. The Router drops the packets
if it is unable to find a specific route on which traffic should be sent. And when a router does not find the
route in its routing table it sends the traffic to a default route, if that default route is configured. So basically,
the traffic is sent out of the interface mentioned in the default route in the absence of an entry in the routing
table for the traffic.

The default route is most useful when sending traffic to a public network like the internet because it is not
possible to have the routing table for the entire internet. Hence, the default route helps the routers to send the
packets going out to the internet.

In the local area network, when the destination address is not available in the local network then the data is
sent out of the default gateway which is then routed to the other networks by routers; similarly, the default
route helps to find the destination which is not available in the routing table.

In the below lab, we will create a default route on the Router to enable routing between different subnets.

The below network scenario is not common in the real world, we have just created this lab to show how the
default route can route the traffic without the routing table however we can test the real default route in
action if we configure the default route on the Router which is connected to the internet. In the packet tracer
lab, we cannot emulate the internet so we are testing the default route in a simple network.

Note: we will only create a default route on the Router. After that, the Router should be able to route traffic.
You can ping router 4 from router 0 to check routing in action.

Command explanation – IP route 0.0.0.0 0.0.0.0 192.168.1.2

In the above command 0.0.0.0 means that any IP address with any subnet mark should be sent out of
interface 192.168.1.2 if a route is not present in the routing table.

59
BS (Computer Science) 2023

Once we configure the default route, we can see the default route in the routing table with the S* symbol
while static routes are shown with just the S symbol.

Before configuring the default route, you will see that gateway of last resort is not set however once the
default route is configured, the gateway of last resort is the Router's interface from which traffic will be sent
out.

60
BS (Computer Science) 2023

Lab Tasks
a. Create a default route on router 0 and 1 to reach network 192.168.3.0/24 and 192.168.4.0/24
b. Create a default route on router 2 to reach network 192.168.1.0/24
c. Create a default route on router 3 and 4 to reach network 192.168.1.0/24 and 192.168.2.0/24
d. Test Routing by pinging router 4 from router 0

Lab Configuration:
Task 1
Router 0

Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2

Router 1

Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2

Task 2
Router 2

Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.1

Task 3
Router 3

Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1

Router 4

Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.4.1

Task 4
Router 0

Router#ping 192.168.4.2

61
BS (Computer Science) 2023

LAB 12: Configuring WAN Connection


Objectives
• Serial connection explanation and configuration in packet tracer.
1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation
Connectivity with internet

Theoretical Description
WAN Connection Labs

Serial Connection

The Serial connection is used to create a WAN connection with the help of a service provider who offers a
dedicated leased line to its customers.

Business organizations buy leased lines to establish a WAN connection to connect with different offices and
business sites that could physically be thousands of miles apart. Businesses have to pay for these leased lines
according to the service availed. And accordingly, the service providers charge for this service i.e. based on
the bandwidth they offer to their client organizations.

One of the connections used for a leased line is the Serial Connection in Cisco-based networks. If we have
Cisco routers on both sides of the network then the default encapsulation known as HDLC will be used by
the Cisco routers. However, this will not work with other brands' routers (i.e. with the non-Cisco routers)
because this protocol is solely a Cisco proprietary.

If we want to establish a successful connection with a router of other vendors then we must configure the
same data link protocol on both routers. If there will be a mismatch then a connection cannot be established
and we will see the status of the interface as down under the data link.

If we are configuring a new cisco router then by default the data link protocol would be HDLC however if
we are configuring an old device then we should check the configuration and if there is a mismatch then we
have to configure the same protocol on both routers.

Although HDLC works out of the box on all cisco routers however it is not widely used because of its
proprietary nature and it does not provide much feature so PPP protocol is used by the most organization.
Even on cisco routers, organizations prefer PPP protocol over HDLC protocol due to its advanced features
and benefits.

In this lab, we will configure a Serial Connection between the routers. We will set up a clock rate at 56000,
which will provide a speed of 56 Kbps. In the real world, the DCE side of the cable is configured by the
service provider.

62
BS (Computer Science) 2023

Generally, the clock speed is configured according to the availability of the bandwidth speed that the service
provider is offering.

The following lab uses a serial cable that will simulate a service provider. We will configure the clock speed
on the Router that has the DCE side connected.

Lab Tasks
1. Assign IP address to both routers and turn them on
2. Set clocking on DCE side, which is router 0
Lab Configuration:
Task 1
Router 0
Router(config)#interface serial 0/1/0

Router(config-if)# ip address 192.168.1.1 255.255.255.0

Router(config-if)# no shut

Router 1
Router(config)#interface serial 0/1/0

Router(config-if)# ip address 192.168.1.2 255.255.255.0

Router(config-if)# no shut

Task 2
Router 0
Router(config-if)# clock rate 56000

63
BS (Computer Science) 2023

LAB 13: Implementing Router Information Protocol (RIP) ver. 2


Objectives
• Configure the RIP protocol on all the routers.
1. Equipment required: -
• Windows PC
• Packet Tracer
Recommendation

Connectivity with internet

Theoretical Description
RIP Configuration:
Static routing is not feasible in a large network. Hence, to implement routing in an easier way we can use
dynamic routing protocols.
Routing information protocol (RIP) is one of the dynamic protocols that can be used for routing. The best
part is that Rip protocol is very easy to configure. We will configure Rip version 2 in this lab.
RIP version 1 was introduced in 1988 when networks were comparatively simple that did not require
complex routing.
An earlier version of RIP had some limitations hence RIP version 2 was introduced in 1993 which improved
some of the features of the RIP protocol.
RIP is a distance-vector routing protocol and hops count to determine the route in the network. Rip protocol
only works till 15 hops and it does not work if the network is more than 15 hops away so this prevents RIP
to work properly in a big network.
Major differences between version 1 and 2
▪ RIP V2 supports classless networks, which means we can use VLSM [Variable length subnet mask]
in our network while RIP V1 does not support subnetted networks.
▪ RIP V2 supports authentication while RIP V1 does not support authentication which makes RIP v1
prone to hacking attacks while Rip v2 provides added security while configuring the networks
▪ RIP V2 uses multicast packets for routing updates while RIP V1 uses broadcast packets which
increases unnecessary traffic in the network.
To configure RIP V2 on a router, we just have to type the "version 2" command after the "router rip"
command to enable version 2 on any router.
After configuring RIP version 2, we have to advertise the directly connected networks by using the
command' network network id' after enabling the RIP protocol on all the routers.
Once the Rip protocol is configured properly you will be able to see the routes in the routing table, learned
with the help of Rip protocol by the routers.
Below is an example of a route that is learned after configuring the RIP protocol:
R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:28, FastEthernet0/0
You can verify and check routes in the routing table by using the command 'show IP route'.
We will also disable auto summarization by the Rip protocol.

64
BS (Computer Science) 2023

Lab Tasks
Configure Rip ver 2 protocol on all routers and disable auto summarization.
Lab Configuration:
Task 1
Router 0
Router(config)#router rip

Router(config-router)#version 2

Router(config-router)#network 192.168.1.0

Router(config-router)#no auto-summary

Router 1
Router(config)#router rip

Router(config-router)#version 2

Router(config-router)#network 192.168.1.0

Router(config-router)#network 192.168.2.0

Router(config-router)#no auto-summary

Router 2
Router(config)#router rip

Router(config-router)#version 2

Router(config-router)#network 192.168.2.0

Router(config-router)#no auto-summary

65

You might also like