13-6
Software Configuration Guide—Release 15.0(2)SG
OL-23818-01
Chapter 13 Configuring VLANs, VTP, and VMPS
VLANs
Configuring VLANs in Global Configuration Mode
If the switch is in VTP server or transparent mode (see the “VLAN Trunking Protocol” section on
page 13-7), you can configure VLANs in global and VLAN configuration modes. When you configure
VLANs in global and config-vlan configuration modes, the VLAN configuration is saved in the vlan.dat
files, not the running-config or startup-config files. To display the VLAN configuration, enter the show
vlan command.
If the switch is in VLAN transparent mode, use the copy running-config startup-config command to
save the VLAN configuration to the startup-config file. After you save the running configuration as the
startup configuration, the show running-config and show startup-config commands display the VLAN
configuration.
Note When the switch boots, if the VTP domain name and VTP mode in the startup-config and vlan.dat files
do not match, the switch uses the configuration in the vlan.dat file.
You use the interface configuration command mode to define the port membership mode and add and
remove ports from a VLAN. The results of these commands are written to the running-config file, and
you can display the contents of the file by entering the show running-config command.
User-configured VLANs have unique IDs from 1 to 4094. To create a VLAN, enter the vlan command
with an unused ID. To verify whether a particular ID is in use, enter the show vlan id ID command. To
modify a VLAN, enter the vlan command for an existing VLAN.
See the “VLAN Default Configuration” section on page 13-4 for the list of default parameters that are
assigned when you create a VLAN. If you do not use the media keyword when specifying the VLAN
type, the VLAN is an Ethernet VLAN.
To create a VLAN, perform this task:
When you create or modify an Ethernet VLAN, note the following:
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# vlan vlan_ID
Switch(config-vlan)# Adds an Ethernet VLAN.
Note You cannot delete the default VLANs for these media types:
Ethernet VLAN 1 and FDDI or Token Ring VLANs 1002 to
1005.
When you delete a VLAN, any LAN interfaces configured as
access ports assigned to that VLAN become inactive. They
remain associated with the VLAN (and thus inactive) until you
assign them to a new VLAN.
Use the no keyword to delete a VLAN.
When the prompt shows Switch(config-vlan)#; you are in
vlan-configuration mode. If you want to change any of the parameters
for the newly created VLAN, use this mode.
Step 3 Switch(config-vlan)# end Returns to enable mode from vlan-configuration mode.
Step 4 Switch# show vlan [id | name]
vlan_name Verifies the VLAN configuration.