VLAN and Trunking 1
Topology

Tasks:
Three switches (SW1, SW2, and SW3) need to be configured for Layer 2 connectivity to support two separate departments. The company requires only the designated VLANs to be configured on their respective switches. VLANs should be permitted on inter-switch links only as specified.
The network needs two user-defined VLANs configured:
- VLAN 100: SALES
- VLAN 200: IT
- Configure the VLANs on the designated switches and assign them as access ports to the interfaces connected to the PCs.
- Configure the Fa0/2 interfaces on SW1 and SW2 as 802.1Q trunks with only the required VLANs permitted.
- Configure the Fa0/3 interfaces on SW2 and SW3 as 802.1Q trunks with only the required VLANs permitted.
Solution:
Task 1: Configure the VLANs on the designated
switches and assign them as access ports to the interfaces connected to the
PCs.
SW1 is connected to only a
single PC (PC1), which is in VLAN 100. Therefore, we only need to configure
VLAN 100 on this switch and assign the Fa0/1 interface as an access port for
VLAN 100 as its connected to PC1.
On SW1:
SW1#configure
terminal
SW1(config)#vlan
100
SW1(config-vlan)#name
SALES
SW1(config-vlan)#exit
SW1(config)#interface
f0/1
SW1(config-if)#switchport
mode access
SW1(config-if)#switchport
access vlan 100
SW1(config-if)#exit
SW2 is connected to only a
single PC (PC2), which is in VLAN 200. However, both VLAN 100 and VLAN 200 need
to be configured on this switch so that VLAN 100 traffic can pass between SW1
and SW3 through SW2. Assign the Fa0/1 interface as an access port for VLAN 200
as its connected to PC2.
On SW2:
SW2#configure
terminal
SW2(config)#vlan
100
SW2(config-vlan)#name
SALES
SW2(config-vlan)#vlan
200
SW2(config-vlan)#name
IT
SW2(config-vlan)#exit
SW2(config)#interface
f0/1
SW2(config-if)#switchport
mode access
SW2(config-if)#switchport
access vlan 200
SW2(config-if)#exit
SW3 is connected to PC3 and
PC4, which are in VLAN 100 and VLAN 200, respectively. This means we need to
configure both VLANs on the switch and set their respective ports (Fa0/1 and
Fa0/2) as access ports.
On SW3:
SW3#configure
terminal
SW3(config)#vlan
100
SW3(config-vlan)#name
SALES
SW3(config-vlan)#vlan
200
SW3(config-vlan)#name
IT
SW3(config-vlan)#exit
SW3(config)#interface
f0/1
SW3(config-if)#switchport
mode access
SW3(config-if)#switchport
access vlan 100
SW3(config-if)#interface
f0/2
SW3(config-if)#switchport
mode access
SW3(config-if)#switchport
access vlan 200
SW3(config-if)#exit
Task 2: Configure the Fa0/2 interfaces on SW1
and SW2 as 802.1Q trunks with only the required VLANs permitted.
As SW1 is not connected to
VLAN 200, we need to only permit VLAN 100 on the trunk link.
On SW1:
SW1(config)#interface
f0/2
SW1(config-if)#switchport
trunk encapsulation dot1q
SW1(config-if)#switchport
mode trunk
SW1(config-if)#switchport
trunk allowed vlan 100
SW1(config-if)#exit
On SW2:
SW2(config)#interface
f0/2
SW2(config-if)#switchport
trunk encapsulation dot1q
SW2(config-if)#switchport
mode trunk
SW2(config-if)#switchport
trunk allowed vlan 100
SW2(config-if)#exit
Task 3: Configure the Fa0/3 interfaces on SW2
and SW3 as 802.1Q trunks with only the required VLANs permitted.
Both VLAN 100 and VLAN 200
need to be configured on this trunk link.
On SW2:
SW2(config)#interface
f0/3
SW2(config-if)#switchport
trunk encapsulation dot1q
SW2(config-if)#switchport
mode trunk
SW2(config-if)#switchport
trunk allowed vlan 100,200
On SW3:
SW3(config)#interface
f0/3
SW3(config-if)#switchport
trunk encapsulation dot1q
SW3(config-if)#switchport
mode trunk
SW3(config-if)#switchport
trunk allowed vlan 100,200
Now exit the configuration
mode and save the configuration.
SW1(config-if)#end
SW1#write
memory
SW2(config-if)#end
SW2#write
memory
SW3(config-if)#end
SW4#write
memory
Packet Tracer File
Clicking this button will begin the download of a ZIP file. Inside the ZIP file, you'll find a Packet Tracer Activity (.pka) file, which will automatically track your progress as you configure the network.