CSE - 4512 - Computer - Networks - Lab 04
CSE - 4512 - Computer - Networks - Lab 04
4.1 Objectives:
• Define and describe the concept of VLAN
• Describe the advantages of VLAN
• Design and implement VLAN and inter-VLAN routing
4.2 Theory:
As with other labs, this lab will also build up on the concepts and techniques of previous labs.
So, make sure you have properly understood the previous lab contents.
VLAN
VLAN or Virtual LAN (Local Area Network) is a logical grouping of networking devices. When
we create VLAN, we actually break a large broadcast domain into smaller broadcast domains.
Consider VLAN as a subnet. Just as two different subnets cannot communicate with each
other without a router, different VLANs also require a router to communicate.
Advantages of VLAN
VLAN provides the following advantages:
• Solve the broadcast problem.
• Reduce the size of broadcast domains.
• Allow us to add an additional layer of security.
• Make device management easier.
• Allow us to implement the logical grouping of devices by function instead of location.
1
to each VLAN. Now, we have two broadcast domains with fifty devices in each. Thus, more
VLAN means more broadcast domains with fewer devices.
2
VLAN Example
To understand VLAN more clearly, let’s take an example.
3
Figure 2: A logical representation of VLANs.
With the help of VLAN, we have separated our single network into three small networks
(sub-networks). These networks do not share their broadcast domains with each other, which
improves network performance and enhances security. Now, the Development department can-
not access the Administration and the Production departments directly.
VLAN Connections
During the configuration of VLAN on ports, we need to know what type of connection it has.
Switch supports two types of VLAN connection:
1. Access link
2. Trunk link
Access link
An access link is a connection where a switch port is connected to a device that has a standard-
ized Ethernet NIC. Standard NIC only understands IEEE 802.3 or Ethernet II frames. Access
link connection can only be assigned with a single VLAN. That means all devices connected
to this port will be in the same broadcast domain.
For example, if twenty users are connected to a hub, and we connect that hub with an access
link port on a switch, then all of these users belong to the same VLAN. If we want to keep ten
users in another VLAN, then we have to purchase another hub. We must plug in those ten
users in that hub and then connect it with another access link port on the switch.
Trunk link
A Trunk link is a connection where a switch port is connected to a device that is capable
of understanding multiple VLANs. Usually, a trunk link connection is used to connect two
switches or switches to a router. Remember when we said that VLAN could span anywhere in
the network? That is basically due to the trunk link connection. Trunking allows us to send
or receive VLAN information across the network. To support trunking, the original Ethernet
frame is modified to carry VLAN information.
4
Figure 3 demonstrates access links and trunk links in a VLAN.
Inter-VLAN Routing
Inter-VLAN routing is a process for forwarding network traffic from one VLAN to another us-
ing a layer-3 device. Two common approaches to inter-VLAN routing are the router-on-a-stick
approach and the layer-3 switch, which uses switch virtual interfaces (SVIs).
5
Figure 4: An example of a Router-on-a-Stick approach to inter-VLAN routing.
A layer-3 switch is also known as a Multi-Layer Switch (MLS) as it operates both in layer-2
and layer-3. A switch virtual interface (SVI) is created for each VLAN i.e. one SVI is for one
VLAN. The function of a SVI is the same as the router interface in case of the router-on-a-
stick approach. It processes the incoming and outgoing packets of the VLANs and routes them
accordingly. As the packets do not leave the switch to be routed to a different network, the
latency is very low compared to router-on-a-stick approach. This MLS approach is employed
in most modern enterprise systems due to its scalability and faster routing. Figure 5 is an
example of an MLS approach to inter-VLAN routing.
6
4.3 Configure inter-VLAN routing using Router-on-a-Stick approach:
Figure 6: A sample network topology for configuring inter-Vlan routing using the router-on-a-
stick approach.
In this section, we will configure the network topology in Figure 6 consisting of two VLANs
using the router-on-a-stick approach.
a. At first, configure two (2) Vlans with VLAN ID 10 and 30 inside the switch.
S1(config)# vlan 10
S1(config-vlan)# exit
S1(config)# vlan 30
S1(config-vlan)# exit
S1(config)# exit
S1# show vlan
7
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
This command configures the interface as an access link (see the theory section to understand
an access link).
S1(config-if)# switchport access vlan 10
This command configures the interface as a trunk link (see the theory section to understand
a trunk link).
S1(config-if)# switchport trunk allowed vlan all
8
This command specifies the list of VLANs on the trunk link. In this case, we have allowed
all the VLANs.
S1(config-if)# no shutdown
9
4.4 Tasks:
1. The task description for this task is provided in 4.4.1. In this task, you need to implement
inter-VLAN routing using a layer-3 switch or MLS approach. You have also been given
a .pka file for this task.
2. You will implement inter-VLAN routing using a router-on-a-stick approach. The task
description is provided in 4.4.2. You will need to create the network topology yourself,
as no .pka file has been provided for this task.
3. After completing the previous two tasks, you can start task 3. In this task, you have to
design and implement VLANs for IUT. You can use your previous solution for task 3 of
lab3. The description is provided in 4.4.3.
10
4.4.1 Task 1 - Configure Layer 3 Switching and Inter-VLAN Routing
Objectives
Part 1: Configure Layer 3 Switching
Part 2: Configure Vlan
Part 3: Configure Inter-Vlan Routing
Background / Scenario
A multilayer switch like the Cisco Catalyst 3650 is capable of both Layer 2 switching and Layer
3 routing. One of the advantages of using a multilayer switch is this dual functionality. A ben-
efit for a small to medium-sized company would be the ability to purchase a single multilayer
switch instead of separate switching and routing network devices. Capabilities of a multilayer
switch include the ability to route from one VLAN to another using multiple switched virtual
interfaces (SVIs), as well as the ability to convert a Layer 2 switchport to a Layer 3 interface.
Addressing Table
Instructions
Part 1: Configure Layer 3 Switching
In Part 1, you will configure the GigabitEthernet 0/2 port on switch MLS as a routed port
and verify that you can ping another Layer 3 address.
a. On MLS, configure G0/2 as a routed port and assign an IP address according to the Ad-
dressing Table.
MLS(config)# interface g0/2
MLS(config-if)# no switchport
MLS(config-if)# ip address 209.165.200.225 255.255.255.252
11
b. Verify connectivity to Cloud by pinging 209.165.200.226.
MLS# ping 209.165.200.226
12
Step 4: Enable Routing on MLS
a. Use the show ip route command. Are there any active routes?
13
4.4.2 Task 2 - Implement Inter-VLAN Routing using Router-on-a-Stick Approach
Objectives
Part 1: Build the Network and Configure Basic Device Settings
Part 2: Create VLANs and Assign Switch Ports
Part 3: Configure an 802.1Q Trunk between the Switches
Part 4: Configure Inter-VLAN Routing on the Router
Part 5: Verify Inter-VLAN Routing is working
Backgroun / Scenario
Modern switches use virtual local-area networks (VLANs) to improve network performance by
separating large Layer 2 broadcast domains into smaller ones. VLANs can also be used as a
security measure by separating sensitive data traffic from the rest of the network. In general,
VLANs make it easier to design a network to support the goals of an organization. Commu-
nication between VLANs requires a device operating at Layer 3 of the OSI model. Adding an
inter-VLAN router allows the organization to segregate and separate broadcast domains while
simultaneously allowing them to communicate with each other.
VLAN trunks are used to span VLANs across multiple devices. Trunks allow the traffic from
multiple VLANs to travel over a single link, while keeping the VLAN identification and seg-
mentation intact. A particular kind of inter-VLAN routing, called “Router-on-a-Stick”, uses a
trunk from the router to the switch to enable all VLANs to pass to the router.
In this lab, you will create VLANs on both switches in the topology, assign VLANs to switch
access ports, verify that VLANs are working as expected, create VLAN trunks between the
two switches and between S1 and R1, and configure Inter-VLAN routing on R1 to allow hosts
in different VLANs to communicate, regardless of which subnet the host resides.
Topology
14
Required Resources
• 1 Router (Cisco 4321)
• 2 Switches (Cisco 2960)
• 2 PCs
• Console cables to configure the Cisco IOS devices via the console ports
• Ethernet cables as shown in the topology
Addressing Table
Instructions
15
i. Create a banner that warns anyone accessing the device that unauthorized access is prohib-
ited.
j. Save the running configuration to the startup configuration file.
VLAN Table
16
Step 1: Create VLANs on both switches.
a. Create and name the required VLANs on each switch from the table above.
b. Configure the management interface and default gateway on each switch using the IP ad-
dress information in the Addressing Table.
17
Step 2: Complete the following tests from PC-A. All should be successful.
a. Ping from PC-A to its default gateway.
b. Ping from PC-A to PC-B.
c. Ping from PC-A to S2.
Question:
What intermediate IP addresses are shown in the results?
18
4.4.3 Task 3 - Design and Implement Vlan and Inter-Vlan Routing for IUT
IUT has six departments: CSE, EEE, MCE, CEE, BTM, and TVE. Each department can
further be divided into, at most, two sections. The student capacity of each department is 60.
IUT wants to add a new department, BTHT. Initially, a total of 20 students will be enrolled
under the BTHT department, but this number can be increased to 30 if needed.
You have been hired to provide a network solution for IUT. The institution is allowed to use
the network address 192.168.0.0/16. Assume that the IP addresses for the six existing de-
partments have already been assigned from 192.168.0.0/23. Your task is to design the given
network address into a suitable number of subnets.
Instructions:
a. Find a suitable subnetwork address for each section/department.
b. Provide the subnet mask, first address, and last address for each subnet.
c. For each section/department, consider 2 PCs as end devices. Assign the first two addresses
from the selected subnet to these end devices.
d. The end devices of departments are to be connected to switches separately. All switches
should be connected to a single router.
e. Configure each section/department as a separate VLAN. Assume and configure other VLANs
if necessary.
f. Configure inter-Vlan routing for the communication among VLANs. You can choose any
approach between Router-on-a-Stick or with layer-3 Switching.
g. Verify the connectivity.
Note: You can use your previous solution (or any modification to the solution) of task
3 from lab 3.
19