Configuring VLANs
Configuring VLANs
Configuring VLANs
Objective
Build a lab network to learn the commands needed to add a virtual local area network (VLAN) to a switch.
Lab Topology
The topology diagram below represents the NetMap in the Simulator.
Command Summary
Command Description
configure terminal enters global configuration mode from privileged EXEC mode
enable enters privileged EXEC mode
end ends and exits configuration mode
exit exits one level in the menu structure
hostname host-name sets the device name
interface type number changes from global configuration mode to interface
configuration mode
ip address ip-address subnet-mask assigns an IP address to an interface
no shutdown enables an interface
ping ip-address sends an Internet Control Message Protocol (ICMP) echo
request to the specified address
show running-config displays the active configuration file
show vlan brief displays parameters for all VLANs; contains the VLAN name,
status, and ports assigned to it
switchport access vlan vlan-id assigns the default VLAN for a port
vlan vlan-id creates a VLAN
IP Addresses
Device Interface IP Address Subnet Mask
Switch1 VLAN 1 192.168.100.101 255.255.255.0
Switch2 VLAN 1 192.168.100.102 255.255.255.0
HostA - 192.168.100.1 255.255.255.0
HostB - 192.168.100.2 255.255.255.0
Lab Tasks
1. Configure Switch1 with a host name of Switch1.
2. Verify the VLAN port assignments on Switch1 by issuing the appropriate show command. All
interfaces should be assigned to VLAN 1.
3. On Switch1, create VLAN 10 and VLAN 100. Add FastEthernet ports 0/2, 0/3, and 0/4 to VLAN 10.
4. Configure Switch2 with a host name of Switch2. Use the default VLAN for management, and
configure the appropriate IP address and subnet mask; refer to the IP Addresses table.
5. Ping from HostA to HostB (192.168.100.2) to verify the connectivity between the two hosts. The ping
should be successful.
6. On Switch1, verify the VLAN configuration by issuing the appropriate show command. FastEthernet
ports 0/2, 0/3, and 0/4 should now be in VLAN 10.
Once you have completed this lab, be sure to check your work by using the grading function.
You can do so by clicking the Grade Lab icon ( ) in the toolbar or by pressing Ctrl+G.
Switch>enable
Switch#configure terminal
Switch(config)#hostname Switch1
2. On Switch1, issue the show vlan brief command to verify the VLAN port assignments. All interfaces
should be assigned to VLAN 1, as shown in the following output:
Switch1(config)#exit
Switch1#show vlan brief
3. On Switch1, issue the following commands to create the VLANs and to add the FastEthernet ports
to the appropriate VLAN:
Switch1#configure terminal
Switch1(config)#vlan 10
VLAN 10 added:
Name:VLAN0010
Switch1(config-vlan)#vlan 100
VLAN 100 added:
Name:VLAN0100
Switch1(config-vlan)#exit
Switch1(config)#interface fastethernet 0/2
Switch1(config-if)#switchport access vlan 10
Switch1(config-if)#interface fastethernet 0/3
Switch1(config-if)#switchport access vlan 10
Switch1(config-if)#interface fastethernet 0/4
Switch1(config-if)#switchport access vlan 10
4. On Switch2, issue the following commands to configure a host name, the default VLAN, and the
appropriate IP address and subnet mask for the VLAN interface:
Switch>enable
Switch#configure terminal
Switch(config)#hostname Switch2
Switch2(config)#interface vlan 1
Switch2(config-if)#ip address 192.168.100.102 255.255.255.0
6. On Switch1, issue the show vlan brief command to verify VLAN port assignments. FastEthernet
ports 0/2, 0/3, and 0/4 should now be in VLAN 10, as shown in the following output:
Switch1(config-if)#end
Switch1#show vlan brief
Copyright © 1996–2017 Boson Software, LLC. All rights reserved. NetSim software and documentation are protected by copyright law.