Vlan 1
Vlan 1
Topology Diagram
Addressing Table
Device
Interface IP Address Subnet Mask Default Gateway
(Hostname)
S1 VLAN 99 172.17.99.11 255.255.255.0 N/A
S2 VLAN 99 172.17.99.12 255.255.255.0 N/A
S3 VLAN 99 172.17.99.13 255.255.255.0 N/A
PC1 NIC 172.17.10.21 255.255.255.0 172.17.10.1
PC2 NIC 172.17.20.22 255.255.255.0 172.17.20.1
PC3 NIC 172.17.30.23 255.255.255.0 172.17.30.1
PC4 NIC 172.17.10.24 255.255.255.0 172.17.10.1
PC5 NIC 172.17.20.25 255.255.255.0 172.17.20.1
PC6 NIC 172.17.30.26 255.255.255.0 172.17.30.1
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 1 of
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
Learning Objectives
Upon completion of this lab, you will be able to:
Cable a network according to the topology diagram
Erase the startup configuration and reload a switch to the default state
Perform basic configuration tasks on a switch
Create VLANs
Assign switch ports to a VLAN
Add, move, and change ports
Verify VLAN configuration
Enable trunking on inter-switch connections
Verify trunk configuration
Save the VLAN configuration
Step 1: Cable a network that is similar to the one in the topology diagram.
You can use any current switch in your lab as long as it has the required interfaces shown in the topology.
Note: If you use 2900 or 2950 switches, the outputs may appear different. Also, certain commands may
be different or unavailable.
Step 2: Clear any existing configurations on the switches, and initialize all ports in the shutdown
state.
If necessary, refer to Lab 2.5.1, Appendix 1, for the procedure to clear switch configurations.
It is a good practice to disable any unused ports on the switches by putting them in shutdown. Disable all
ports on the switches:
Switch#config term
Switch(config)#interface range fa0/1-24
Switch(config-if-range)#shutdown
Switch(config-if-range)#interface range gi0/1-2
Switch(config-if-range)#shutdown
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 2 of
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
S2(config-if-range)#no shutdown
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 3 of
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
S3(config-if)#no shutdown
Assigning a management address allows IP communication between the switches, and also allows any
host connected to a port assigned to VLAN 99 to connect to the switches. Because VLAN 99 is
configured as the management VLAN, any ports assigned to this VLAN are considered management
ports and should be secured to control which devices can connect to these ports.
Step 6: Configure trunking and the native VLAN for the trunking ports on all switches.
Trunks are connections between the switches that allow the switches to exchange information for all
VLANS. By default, a trunk port belongs to all VLANs, as opposed to an access port, which can only
belong to a single VLAN. If the switch supports both ISL and 802.1Q VLAN encapsulation, the trunks
must specify which method is being used. Because the 2960 switch only supports 802.1Q trunking, it is
not specified in this lab.
A native VLAN is assigned to an 802.1Q trunk port. In the topology, the native VLAN is VLAN 99. An
802.1Q trunk port supports traffic coming from many VLANs (tagged traffic) as well as traffic that does not
come from a VLAN (untagged traffic). The 802.1Q trunk port places untagged traffic on the native VLAN.
Untagged traffic is generated by a computer attached to a switch port that is configured with the native
VLAN. One of the IEEE 802.1Q specifications for Native VLANs is to maintain backward compatibility with
untagged traffic common to legacy LAN scenarios. For the purposes of this lab, a native VLAN serves as
a common identifier on opposing ends of a trunk link. It is a best practice to use a VLAN other than VLAN
1 as the native VLAN.
Use the interface range command in global configuration mode to simplify configuring trunking.
S1(config)#interface range fa0/1-5
S1(config-if-range)#switchport mode trunk
S1(config-if-range)#switchport trunk native vlan 99
S1(config-if-range)#no shutdown
S1(config-if-range)#end
S2(config)# interface range fa0/1-5
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#switchport trunk native vlan 99
S2(config-if-range)#no shutdown
S2(config-if-range)#end
S3(config)# interface range fa0/1-5
S3(config-if-range)#switchport mode trunk
S3(config-if-range)#switchport trunk native vlan 99
S3(config-if-range)#no shutdown
S3(config-if-range)#end
Verify that the trunks have been configured with the show interface trunk command.
S1#show interface trunk
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 5 of
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
Ping from host PC2 to host PC1. Is the ping attempt successful? Không thành công
Even though the ports used by PC1 and PC2 are in the same VLAN, they are still in different
subnetworks, so they cannot communicate directly.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 6 of
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
Task 6: Clean Up
Erase the configurations and reload the switches. Disconnect and store the cabling. For PC hosts that are
normally connected to other networks (such as the school LAN or to the Internet), reconnect the
appropriate cabling and restore the TCP/IP settings.
S1:
hostname S1
!
enable secret 5 $1$mERr$9cTjUIEqNGurQiFU.ZeCi1
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/2
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/3
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/4
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/5
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/6
shutdown
!
interface FastEthernet0/7
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 7 of
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
shutdown
!
interface FastEthernet0/8
shutdown
!
interface FastEthernet0/9
shutdown
!
interface FastEthernet0/10
shutdown
!
interface FastEthernet0/11
shutdown
!
interface FastEthernet0/12
shutdown
!
interface FastEthernet0/13
shutdown
!
interface FastEthernet0/14
shutdown
!
interface FastEthernet0/15
shutdown
!
interface FastEthernet0/16
shutdown
!
interface FastEthernet0/17
shutdown
!
interface FastEthernet0/18
shutdown
!
interface FastEthernet0/19
shutdown
!
interface FastEthernet0/20
shutdown
!
interface FastEthernet0/21
shutdown
!
interface FastEthernet0/22
shutdown
!
interface FastEthernet0/23
shutdown
!
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 8 of
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
interface FastEthernet0/24
shutdown
!
interface GigabitEthernet0/1
shutdown
!
interface GigabitEthernet0/2
shutdown
!
interface Vlan1
no ip address
shutdown
!
interface Vlan99
ip address 172.17.99.11 255.255.255.0
!
!
!
!
line con 0
password cisco
login
!
line vty 0
password cisco
login
line vty 1 4
login
line vty 5 15
login
!
!
end
S2:
hostname S2
!
enable secret 5 $1$mERr$9cTjUIEqNGurQiFU.ZeCi1
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport trunk native vlan 99
switchport mode trunk
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 9 of
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
!
interface FastEthernet0/2
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/3
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/4
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/5
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/6
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 30
shutdown
!
interface FastEthernet0/8
switchport access vlan 30
shutdown
!
interface FastEthernet0/9
switchport access vlan 30
shutdown
!
interface FastEthernet0/10
switchport access vlan 30
shutdown
!
interface FastEthernet0/11
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/12
switchport access vlan 10
shutdown
!
interface FastEthernet0/13
switchport access vlan 10
shutdown
!
interface FastEthernet0/14
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 10
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
switchport access vlan 10
shutdown
!
interface FastEthernet0/15
switchport access vlan 10
shutdown
!
interface FastEthernet0/16
switchport access vlan 10
shutdown
!
interface FastEthernet0/17
switchport access vlan 10
shutdown
!
interface FastEthernet0/18
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/19
switchport access vlan 20
shutdown
!
interface FastEthernet0/20
switchport access vlan 20
shutdown
!
interface FastEthernet0/21
switchport access vlan 20
shutdown
!
interface FastEthernet0/22
switchport access vlan 20
shutdown
!
interface FastEthernet0/23
switchport access vlan 20
shutdown
!
interface FastEthernet0/24
switchport access vlan 20
shutdown
!
interface GigabitEthernet0/1
shutdown
!
interface GigabitEthernet0/2
shutdown
!
interface Vlan1
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 11
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
no ip address
shutdown
!
interface Vlan99
ip address 172.17.99.12 255.255.255.0
!
!
line con 0
password cisco
login
!
line vty 0
password cisco
login
line vty 1 4
login
line vty 5 15
login
!
!
End
S3:
hostname S3
!
enable secret 5 $1$mERr$9cTjUIEqNGurQiFU.ZeCi1
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/2
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/3
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/4
switchport trunk native vlan 99
switchport mode trunk
!
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 12
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
interface FastEthernet0/5
switchport trunk native vlan 99
switchport mode trunk
!
interface FastEthernet0/6
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 30
shutdown
!
interface FastEthernet0/8
switchport access vlan 30
shutdown
!
interface FastEthernet0/9
switchport access vlan 30
shutdown
!
interface FastEthernet0/10
switchport access vlan 30
shutdown
!
interface FastEthernet0/11
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/12
switchport access vlan 10
shutdown
!
interface FastEthernet0/13
switchport access vlan 10
shutdown
!
interface FastEthernet0/14
switchport access vlan 10
shutdown
!
interface FastEthernet0/15
switchport access vlan 10
shutdown
!
interface FastEthernet0/16
switchport access vlan 10
shutdown
!
interface FastEthernet0/17
switchport access vlan 10
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 13
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
shutdown
!
interface FastEthernet0/18
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/19
switchport access vlan 20
shutdown
!
interface FastEthernet0/20
switchport access vlan 20
shutdown
!
interface FastEthernet0/21
switchport access vlan 20
shutdown
!
interface FastEthernet0/22
switchport access vlan 20
shutdown
!
interface FastEthernet0/23
switchport access vlan 20
shutdown
!
interface FastEthernet0/24
switchport access vlan 20
shutdown
!
interface GigabitEthernet0/1
shutdown
!
interface GigabitEthernet0/2
shutdown
!
interface Vlan1
no ip address
shutdown
!
interface Vlan99
ip address 172.17.99.13 255.255.255.0
!
!
!
!
line con 0
password cisco
login
!
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 14
CCNA Exploration
LAN Switching and Wireless: VLANs Lab 3.5.1: Basic VLAN Configuration
line vty 0
password cisco
login
line vty 1 4
login
line vty 5 15
login
!
!
!end
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information.
Page 15