Vlan Commands
Vlan Commands
• vlan, on page 2
• interface vlan, on page 3
• name, on page 4
• private-vlan, on page 5
• show switch vlan, on page 6
VLAN Commands
1
VLAN Commands
vlan
vlan
To create a VLAN, use the vlan command in switch configuration mode. Use the no form of the command
to remove a VLAN.
Note To configure any parameter on the ENCS switch portal, ensure that you add or remove parameters using
separate transactions on the CLI. For example, adding and removing multiple VLANs from the ENCS switch
portal is not supported in the same CLI transaction. Add a VLAN first and then remove the VLAN in a separate
transaction.
Syntax Description vlan-id Specifies a VLAN ID. You can enter a value from one of the following ranges for the
VLAN ID:
• 1-2349
• 2450-4093
range vlan-range Specifies a list of VLAN IDs. Separate nonconsecutive VLAN IDs with a comma and
no spaces. Use a hyphen to designate a range of IDs.
Usage Guidelines If the VLAN does not exist, the VLAN is created. If the VLAN cannot be created, the command is finished
with error and the current context is not changed.
Example
The following example shows how to create a VLAN:
nfvis(config)# switch
nfvis(config-switch)# vlan range 19-23
VLAN Commands
2
VLAN Commands
interface vlan
interface vlan
To enter the interface configuration (VLAN) mode for a specific VLAN or a range of VLANs, use the interface
vlan command in the switch configuration mode. After this command is entered, all commands configure
this VLAN or range of VLANs.
Syntax Description vlan-id Specifies the VLAN ID. Valid range is:
• 1–2349
• 2450–4093
vlan-range Specifies a VLAN range. You can enter the range in the following formats:
• 5–7
• 5,6,7
VLAN Commands
3
VLAN Commands
name
name
To name a VLAN, use the name command in interface switch configuration mode.
name string
Example
The following example shows how to specify a unique VLAN name:
VLAN Commands
4
VLAN Commands
private-vlan
private-vlan
To configure a private VLAN, use the private-vlan command in interface switch configuration mode. Use
the no form of the command to return the VLAN to normal VLAN configuration.
Syntax Description association vlan-id Associates the primary VLAN with secondary VLANs using the VLAN ID. Valid
range is:
• 1–2349
• 2450–4093
Usage Guidelines • The VLAN type cannot be changed if there is a private VLAN port that is a member in the VLAN.
• The VLAN type cannot be changed if it is associated with other private VLANs.
• The VLAN type is not kept as a property of the VLAN when the VLAN is deleted.
Example
The following example shows how to configure a private VLAN:
VLAN Commands
5
VLAN Commands
show switch vlan
Example
The following is a sample output of the show switch vlan command:
VLAN Commands
6