The vlan
command operates in the global configuration context to configure a static VLAN.vid
Syntax:
If
does not exist in the switch, this command creates a port-based VLAN with the specified
vid
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, wheren
is theassigned to the VLAN.
vid
If the VLAN already exists and you enter either the
or the
vid
, the CLI moves to the specified VLAN's context.
ascii-name-string
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.
Configures a static, protocol VLAN of the specified type.
If multiple protocols are configured in the VLAN, the
no
form removes the specified protocolIf 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.
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
entry:
ascii-name-string
@
,#:
,$
,^
,&
,*
,(
, 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.
NOTE: You can use these options from the configuration level by beginning the command with
vlan
, or from the context level of the specific VLAN by just entering the command option.vid
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:
-
To create the new VLAN, type the
vlan 100
command. -
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.
HP Switch(config)#: vlan 100 HP Switch(config)#: show vlans Status and Counters - VLAN Information Maximum VLANs to support : 8 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