Switch
Switch
Configuring a Layer 2
Switch
Lab Objective:
Learn how to configure layer 2 switches.
Lab Purpose:
Installing, configuring, and troubleshooting layer 2 switches will be part of
your day-to-day routine as a network engineer. In this lab we cover basic
VLAN and trunk configuration. Our two VLANs will use the trunk to
connect. To keep things simple, each switch has only one host per VLAN.
Lab Tool:
Packet Tracer
Lab Topology:
Please use the following topology to complete this lab exercise:
Lab Walkthrough:
Task 1:
Drag two Cisco switches (2960) onto the canvas and attach four PCs as per
the diagram.
Task 2:
Add IP addresses of 172.16.20.2 and .3 to the devices going into VLAN 20.
For the devices in VLAN 30 the IP addresses will be 172.16.30.2 and .3. We
are using VLSM here, so make sure you use a subnet mask of 255.255.255.0.
When all devices are configured, you will be able to ping devices in the same
network but not across networks, even though they may be connected to the
same VLAN. Here is a ping source from host 172.16.30.3.
This lab isn’t concerned with inter-VLAN routing though, so we will just
focus on connecting hosts in the same VLAN across switches using trunk
links. The ‘show vlan brief’ command demonstrates the fact that all ports are in
the same VLAN.
Switch#show vlan brief
Task 5:
When you are done with this part, check the layer 2 settings for the interfaces
with the ‘show interfaces X switchport’ command. We are most interested in the
parts highlighted in bold.
Switch1#show int f0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 20 (VLAN0020)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: All
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
Task 6:
From 172.16.20.2 ping .3. It should fail because there is no trunk link
between Switch0 and Switch1. The link connecting the two will be at the
default setting of VLAN1 and an access port.
Task 8:
Finally, ping from 172.16.20.2 to .3. It should be successful.
Note:
There are many features we could go into, but we will be covering more
switching features later in the relevant sections.