3.4.6 Lab - Configure VLANs and Trunking
3.4.6 Lab - Configure VLANs and Trunking
Topology
Addressing Table
Device Interface IP Address Subnet Mask Default Gateway
Objectives
Part 1: Build the Network and Configure Basic Device Settings
Part 2: Create VLANs and Assign Switch Ports
Part 3: Maintain VLAN Port Assignments and the VLAN Database
Part 4: Configure an 802.1Q Trunk between the Switches
Part 5: Delete the VLAN Database
Background / 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 controlling which hosts can communicate. In general, VLANs make it easier
to design a network to support the goals of an organization.
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
segmentation intact.
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, and then create a VLAN trunk between
the two switches to allow hosts in the same VLAN to communicate through the trunk, regardless
of which switch the host is actually attached to.
Note: The switches used with CCNA hands-on labs are Cisco Catalyst
2960s with Cisco IOS Release 15.2(2) (lanbasek9 image). Other routers, switches, and Cisco IOS
versions can be used. Depending on the model and Cisco IOS version, the commands available
and the output produced might vary from what is shown in the labs. Refer to the Router Interface
Summary Table at the end of the lab for the correct interface identifiers.
Note: Ensure that the routers and switches have been erased and have no startup configurations.
If you are unsure contact your Answers.
Answers Note: Refer to the Answers Lab Manual for the procedures to initialize and reload
devices.
Required Resources
3.4.6 Lab – Configure VLANs and Trunking
2 Switches (Cisco 2960 with Cisco IOS Release 15.2(2) lanbasek9 image or
comparable)
2 PCs (Windows with a terminal emulation program, such as Tera Term)
Console cables to configure the Cisco IOS devices via the console ports
Ethernet cables as shown in the topology
Instructions
switch> enable
2. Enter configuration mode.
switch# config terminal
3. Assign a device name to the switch.
switch(config)# hostname S1
switch(config)# hostname S2
4. Disable DNS lookup to prevent the router from attempting to translate incorrectly
entered commands as though they were host names.
S1(config)# no ip domain-lookup
S2(config)# no ip domain-lookup
5. Assign class as the privileged EXEC encrypted password.
S1(config)# enable secret class
Pings were unsuccessful when trying to ping a device on a different subnet. For those
pings to be successful, a default gateway must exist to route traffic from one subnet to
another.
Close configuration window
<output omitted>
Question:
Note: Current switch technology no longer requires that the vlan command be issued to add
a VLAN to the database. By assigning an unknown VLAN to a port, the VLAN will be created
and added to the VLAN database.
2. Verify that the new VLAN is displayed in the VLAN table.
S1# show vlan brief
After deleting VLAN 30 from the VLAN database, what VLAN is port F0/24 assigned to? What
happens to the traffic destined to the host attached to F0/24?
When you delete a VLAN, any ports assigned to that VLAN become
inactive. So Port F0/24 is still -associated to VLAN 30. However, VLAN 30 is now
inactive because it does not exist in the VLAN database. Additionally, the port will not
transfer any traffic.
S1# show vlan brief
3.4.6 Lab – Configure VLANs and Trunking
VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Gi0/1, Gi0/2
10 Operations active Fa0/6, Fa0/11, Fa0/21
20 Parking_Lot active
99 Management active Fa0/12, Fa0/13, Fa0/14,
Fa0/15
Fa0/16, Fa0/17, Fa0/18,
Fa0/19
Fa0/20, Fa0/22, Fa0/23
1000 Native active
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
Note: Before removing a VLAN from the database, it is recommended that you reassign all
the ports assigned to that VLAN.
Why should you reassign a port to another VLAN before removing the VLAN from the VLAN
database?
The interfaces assigned to a VLAN that is the removed from the VLAN
database become inactive and are unavailable for use until they are reassigned to
another VLAN. This can be a tricky thing to troubleshoot as trunked interfaces do not
show up in the port list as well (Part 4 contains more information about trunked
interfaces).
3.4.6 Lab – Configure VLANs and Trunking
Close configuration window
2. Issue the show vlan brief command on S1 and S2. Interface F0/1 is no longer
assigned to VLAN 1. Trunked interfaces are not listed in the VLAN table.
S1# show vlan brief
3. Issue the show interfaces trunk command to view trunked interfaces. Notice that the
mode on S1 is set to desirable, and the mode on S2 is set to auto.
S1# show interfaces trunk
Note: By default, all VLANs are allowed on a trunk. The switchport trunk command allows
you to control what VLANs have access to the trunk. For this lab, keep the default settings
which allows all VLANs to traverse F0/1.
Close configuration window
3. Modify the trunk configuration on both switches by changing the native VLAN from
VLAN 1 to VLAN 1000.
S1(config)# interface f0/1
S1(config-if)# switchport trunk native vlan 1000
Why might you want to manually configure an interface to trunk mode instead of using DTP?
Not all equipment uses DTP. Using the switchport mode trunk command ensures that the
port will become a trunk no matter what type of equipment is connected to the other
end of the link.
Why might you want to change the native VLAN on a trunk?
3.4.6 Lab – Configure VLANs and Trunking
Using VLAN 1, the default VLAN, as the native VLAN is a security risk. All the different
control protocols that are exchanged between switches are exchanged via the native
VLAN 1 untagged, and that information could be exposed if default settings are used
on ports that users connect to.
Close configuration window
Issue the show flash command to determine if a vlan.dat file exists in flash.
S1# show flash:
Directory of flash:/
Note: If there is a vlan.dat file located in flash, then the VLAN database does not contain its
default settings.
2. Issue the show flash command to verify that the vlan.dat file has been deleted.
S1# show flash:
Directory of flash:/
To initialize a switch back to its default settings, what other commands are needed?
To get a switch back to its default settings, the erase startup-
config and reload commands need to be issued after the delete vlan.dat command.
Close configuration window
Reflection Questions
1. What is needed to allow hosts on VLAN 10 to communicate to hosts on VLAN 99?
Answers will vary, but to allow Inter-VLAN routing requires a Layer 3 device is needed to
route traffic between VLANs.
3.4.6 Lab – Configure VLANs and Trunking
2. What are some primary benefits that an organization can receive through effective use of
VLANs?
Answers will vary, but VLAN benefits include: better security, cost savings (efficient use of
bandwidth and uplinks), higher performance (smaller broadcast domains), broadcast
storm mitigation, improved IT staff efficiency, simpler project and application
management.
End of Document
Switch S1
Building configuration…
Switch S2
Building configuration…