Lab2 Ip
Lab2 Ip
B"
Faculty of Electrical Engineering (FGE)
Department of Telecommunications
Academic Year: 2024/2025
Yacine harket
Zaiter kamelia zahra
222231517412
Sous groupe 1
Introduction :
Modern switches use VLANs to enhance network performance by dividing
Layer 2 broadcast domains into smaller segments. In addition to
optimizing traffic management, VLANs also improve security by
restricting communication between specific hosts.
VLAN trunks are essential for extending VLANs across multiple devices.
They allow traffic from multiple VLANs to travel over a single link while
maintaining VLAN identification and segmentation.
Lab Objectives :
By the end of this session, we will be able to:
• Part 1: Set up the network and configure the basic settings of the devices.
• Part 2: Create VLANs and assign switch ports to their respective VLANs.
• Part 3: Modify port assignments to VLANs and manage the VLAN database.
• Part 4: Configure an 802.1Q trunk between switches to enable inter-VLAN
communication.
• Part 5: Delete the VLAN database and reset the VLAN configuration on the
switches.
Required Resources :
• Switches (Cisco 2960 equipped with Cisco IOS version 15.0(2) lanbasek9
image or similar)
• PCs (Windows 10, or 11, equipped with a terminal emulation program such
as Putty)
• Console cables to configure Cisco IOS devices via console ports
• Ethernet cables according to the topology
Pre-Lab Assignment :
First, we will answer the preliminary questions by conducting research to fully
understand the concepts related to VLANs and trunking. The goal is to have a solid
foundation before moving on to the practical work.
Next, we will recreate the lab topology in Packet Tracer. We will configure the devices
according to the instructions and then verify if the VLANs and trunk are functioning
correctly.
Finally, we will prepare a detailed report summarizing our work in Packet Tracer. This
report will include the configurations, the results obtained, and any challenges
encountered, along with the solutions implemented.
A. Pre-Lab Questions :
VLAN Fundamentals:
1. What is a VLAN, and why are they used in modern networks ?
A VLAN (Virtual Local Area Network) is a logical segmentation of a physical
network that groups devices together, even if they are not physically connected
to the same switch. VLANs improve network organization, security, and
performance by isolating broadcast domains at Layer 2.
Benefits of VLANs:
• Security: Devices in different VLANs cannot communicate unless
explicitly allowed through inter-VLAN routing. This limits
unauthorized access.
• Performance: Reduces network congestion by limiting broadcast
traffic within each VLAN.
• Management: Simplifies network administration by allowing
devices to be logically grouped based on function rather than
physical location.
2. What is the default VLAN on a Cisco switch? What are the potential security
risks associated with using the default VLAN for user traffic?
On Cisco switches, VLAN 1 is the default VLAN. All switch ports are assigned to
VLAN 1 by default.
3. Describe the difference between a data VLAN and a management VLAN. Why
is it recommended to use a separate VLAN for management traffic?
• Data VLAN: Used to carry end-user traffic (PCs, printers, VoIP
phones, etc.). Each department or function can have a separate
data VLAN.
• Management VLAN: Dedicated VLAN for managing network
devices (switches, routers, access points). It allows administrators
to access devices securely.
Why separate management traffic?
• Security: Prevents unauthorized users from accessing the
management interface.
• Network Stability: Isolates control traffic from user-generated
data, reducing congestion and ensuring stable network
performance.
• Remote Access Control: Allows administrators to securely manage
the network from a specific VLAN without interference from
regular user traffic.
Best practice:
Assign a separate VLAN (e.g., VLAN 99) for management and restrict access
using ACLs or authentication mechanisms.
4. What is the range of VLAN IDs available on Cisco switches, and what are the
reserved VLAN ranges? How do extended range VLANs differ from normal range
VLANs?
Cisco switches support VLAN IDs from 1 to 4094, divided into two ranges:
• Normal range VLANs (1 – 1005):
• VLANs 1 and 1002-1005 are reserved.
• Stored in the vlan.dat file in Flash memory.
• Can be used for standard VLAN configurations.
• Extended range VLANs (1006 – 4094):
• Not saved in vlan.dat (stored in running-config on some switches).
• Used in large-scale networks (e.g., service providers).
• Requires a switch running in VTP transparent mode to be
manually configured.
Key differences:
VLAN IDs 1 - 1005 1006 - 4094
Stored in vlan.dat (Flash) Running-config (RAM)
VTP Support Yes (VTP v1 & v2) No (Requires VTP Transparent)
Use Case Enterprise networks No (Requires VTP Transparent)
Best practice:
Use normal range VLANs for standard enterprise networks and extended VLANs
for service provider environments.
VLAN Configuration:
What are the key commands used to create and name VLANs on a Cisco
switch? Provide examples of how to create VLANs with specific IDs and
descriptive names.
To create and name a VLAN on a Cisco switch, the following commands are used
in global configuration mode:
Switch# configure terminal
Switch(config)# vlan <VLAN-ID>
Switch(config-vlan)# name <VLAN-Name>
Switch(config-vlan)# exit
Switch(config)# end
Switch# write memory
Example: Creating VLAN 10 for “Students” and VLAN 20 for “Faculty”:
Switch(config)# vlan 10
Switch(config-vlan)# name Students
Switch(config-vlan)# vlan 20
Switch(config-vlan)# name Faculty
Switch(config-vlan)# exit
This configuration ensures that VLAN 10 and VLAN 20 are created and named
properly.
Trunking:
1. What is trunking, and why is it necessary in a multi-VLAN environment?
Trunking is a method used to allow multiple VLANs to pass through a single
network link between switches. In a multi-VLAN environment, VLANs are
isolated within a switch, meaning devices in different VLANs cannot
communicate unless traffic is routed or trunked between switches.
Why is trunking necessary?
• Allows multiple VLANs to communicate over a single physical
connection.
• Reduces cabling complexity by eliminating the need for separate
links for each VLAN.
• Ensures VLAN consistency across multiple switches in a network.
2.Trunking Protocols: 802.1Q vs. ISL :
Cisco switches support two trunking protocols:
3. How does the 802.1Q trunking protocol work? What is VLAN tagging?
802.1Q adds a VLAN tag inside Ethernet frames to identify VLAN traffic on a
trunk link.
How VLAN tagging works:
1. When a switch sends a frame over a trunk port, it inserts an 802.1Q tag in
the Ethernet frame.
2. The receiving switch checks the VLAN ID in the tag and forwards the frame to
the appropriate VLAN.
3. If the VLAN is the native VLAN, no tag is added, and the frame is sent as is
(untagged).
Structure of an 802.1Q frame:
Field Size (Bytes) Description
Destination MAC 6 Target device’s MAC
address
Source MAC 6 Sender’s MAC address
Tag Protocol Identifier 2 Identifies 802.1Q
(TPID) tagging (value =
0x8100)
Priority Code Point (PCP) 3 bits QoS priority
Drop Eligible Indicator 1 bits Drop priority for
(DEI) congestion
VLAN ID 12 bits VLAN number (1-4094)
EtherType / Length 4 dentifies upper layer
protocol
Data Variable The actual payload
FCS (CRC) 4 Frame Check Sequence
(error detection)
The VLAN tag ensures that VLANs remain separate while sharing the
same trunk link.
4. How to configure a trunk port using switchport mode trunk?
To enable trunking on a switch interface, we use the following commands:
Switch(config)# interface FastEthernet 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# exit
Encapsulation options:
• dot1q → Uses the 802.1Q tagging standard.
• isl → Uses ISL (only available on older Cisco switches).
• negotiate → Automatically selects the encapsulation type (default
on some models).
Example:
Switch(config)# interface GigabitEthernet 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport trunk allowed vlan 10,20,30
Switch(config-if)# switchport trunk native vlan 99
Switch(config-if)# exit
Inter-VLAN Routing:
1. What is inter-VLAN routing, and why is it needed for communication between
devices in different VLANs?
Inter-VLAN routing is the process that allows communication between devices in
different VLANs. By default, VLANs are isolated at Layer 2 (Data Link Layer),
meaning that devices in separate VLANs cannot communicate unless a Layer 3
device (router or Layer 3 switch) is used to forward traffic between them.
Why is inter-VLAN routing necessary?
• VLAN segmentation improves security and performance, but some
devices (e.g., servers, printers) need to communicate across
VLANs.
• Since VLANs function as separate subnets, they require routing to
exchange data.
• A Layer 3 device (router or Layer 3 switch) enables this
communication while maintaining VLAN isolation where needed.
2. Methods of Performing Inter-VLAN Routing
There are two main methods to implement inter-VLAN routing:
1. Router-on-a-Stick (Using a Router with a Trunk Port)
2. Layer 3 Switch (Using Switch Virtual Interfaces - SVIs)
Feature Router-on-a-Stick Layer 3 Switch (SVI)
Device Used Router (Layer 3) Layer 3 Switch
Physical Ports Requires one trunk link Uses VLAN interfaces
between the router and (SVIs) within the switch
switch
Performance Slower (bottleneck due Faster (switch processes
to single interface) routing in hardware)
Configuration More complex, requires Easier, VLANs are
Complexity subinterfaces configured directly on
the switch
Scalability Limited, as all traffic Highly scalable, ideal for
passes through one enterprise networks
interface
Router-on-a-Stick is used for small networks, while Layer 3 Switch (SVI)
is preferred in larger networks for better performance.
3. Router-on-a-Stick Configuration (Inter-VLAN Routing with a Router)
A Router-on-a-Stick uses a single physical router interface configured as a trunk
to handle multiple VLANs.
Step 1: Enable trunking on the switch port connected to the router
Switch(config)# interface FastEthernet 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# exit
Step 2: Configure subinterfaces on the router
Each VLAN needs a subinterface with an IP address.
We have successfully built the network topology as per the lab instructions.
The topology consists of two 2960-24TT switches (S1 and S2), three PCs (PC-
A, PC-B, and PC-C), and designated VLANs (VLAN10 and VLAN20).
This configuration ensures proper segmentation and prepares the network for
inter-VLAN communication using a Layer 3 device.
For this step, we verified the VLAN configurations on the switch using the
command show vlan brief. This allowed us to confirm that VLAN10 and
VLAN20 were successfully created and assigned to their respective ports. The
output displayed the active VLANs along with the interfaces associated with
each VLAN. We ensured that the correct ports were assigned to VLAN10 and
VLAN20 and that the trunk port was configured appropriately. This
verification step was essential to confirm that the VLANs were correctly
implemented before proceeding with further connectivity tests.
we executed the show vlan brief command to verify the VLAN configuration
on the switch. The output confirmed that VLAN10 was successfully created
and assigned to port Fa0/6, while the default VLAN1 remained active with
multiple ports. This step was crucial to ensure that VLAN segmentation was
correctly implemented before proceeding with trunk configuration and
connectivity testing. The presence of VLAN10 in the list indicates that the
configuration was applied successfully
Conclusion :
Through the implementation of VLANs and trunking in Packet Tracer, we
successfully segmented the network to improve security, efficiency, and
manageability. We created VLANs, assigned switch ports accordingly, and
configured trunk links to enable VLAN communication across multiple switches.
The configuration was verified using commands like show vlan brief, show
interfaces trunk, and ping, confirming the correct setup of VLANs and trunking.
The successful pings between devices within the same VLAN demonstrated
proper VLAN segmentation, while the failure of inter-VLAN communication
highlighted the need for inter-VLAN routing. Overall, this exercise reinforced the
importance of VLANs in modern networking, demonstrating how they minimize
broadcast domains and enhance network performance. The hands-on
troubleshooting process provided deeper insights into VLAN misconfigurations
and the significance of trunking for inter-switch communication