Creating a new static VLAN (port-based or protocol-based) (CLI)

The vlan <vid> command operates in the global configuration context to configure a static VLAN and/or take the CLI to a specified VLAN's context.

Syntax:


vlan <vid> | <ascii-name-string>

no vlan <vid>

If <vid> does not exist in the switch, this command creates a port-based VLAN with the specified <vid>

If the command does not include options, the CLI, moves to the newly created VLAN context.

If an optional name is not specified, the switch assigns a name in the default format VLAN n, where n is the <vid> assigned to the VLAN.

If the VLAN exists and you enter either the <vid> or the <ascii-name-string> ,the CLI moves to the specified VLAN's context.

The no form of the command deletes the VLAN as follows:

If one or more ports belong only to the VLAN to be deleted, the CLI notifies you that these ports will be moved to the default VLAN and prompts you to continue the deletion. For member ports that also belong to another VLAN, there is no move prompt.


protocol [ipx | ipv4 | ipv6 | arp | appletalk | sna | netbeui]

Configures a static, protocol VLAN of the specified type.

If multiple protocols are configured in the VLAN, the no form removes the specified protocol

If a protocol VLAN is configured with only one protocol type and you use the no form of this command to remove that protocol, the switch changes the protocol VLAN to a port-based VLAN (if the VLAN does not have an untagged member port).

If an untagged member port exists on the protocol VLAN, you must either convert the port to a tagged member or remove the port from the VLAN before removing the last protocol type from the VLAN.

NOTE:

If you create an IPv4 protocol VLAN, you must assign the ARP protocol option to it to provide IP address resolution. Otherwise, IP packets are not deliverable. A Caution message appears in the CLI if you configure IPv4 in a protocol VLAN that does not already include the ARP protocol option. The same message appears if you add or delete another protocol in the same VLAN.


name <ascii-name-string>

When included in a vlan command to create a new static VLAN, this command specifies a non-default VLAN name. Also used to change the current name of an existing VLAN.

NOTE:

Avoid spaces and the following characters in the <ascii-name-string> entry: @, #:, $, ^, &, *, ( and). To include a blank space in a VLAN name, enclose the name in single or double quotes.


voice

Designates a VLAN for VoIP use. For more on this topic, see Using voice VLANs.

NOTE:

You can use these options from the configuration level by beginning the command with vlan <vid> , or from the context level of the specific VLAN by just entering the command option.

Creating a new port-based static VLAN

The following example shows how to create a new port-based, static VLAN with a VID of 100 using the following steps:
  1. To create the new VLAN, type the vlan 100 command.

  2. To show the VLANs currently configured in the switch, type the show vlans command.

If the Management VLAN field (Primary VLAN : DEFAULT_VLAN Management VLAN shown in the display information below) is empty, a Secure Management VLAN is not configured in the switch. For more information on configuring a secure management VLAN, see The secure Management VLAN.

switch(config)# vlan 100
switch(config)# show vlans

 Status and Counters - VLAN Information
 Maximum VLANs to support : 16
 Primary VLAN : DEFAULT_VLAN
 Management VLAN :

 VLAN ID Name                 Status       Voice Jumbo
 ------- -------------------- ------------ ----- -----
 1       DEFAULT_VLAN         Port-based   No    No
 100     VLAN100              Port-based   No    No

Changing the VLAN context level

To go to a different VLAN context level, such as to the default VLAN:
switch(vlan-100)# vlan default_vlan 
switch(vlan-1)# _