VLAN Commands

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.


vlan [ vlan-id] [ range vlan-range]

no vlan vlan-id

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.

Command Default

The default VLAN is VLAN 1.

Command Modes

Switch configuration (config-switch)

Command History

Release Modification
3.5.1

This command was introduced.

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.

Examples

The following example shows how to create a VLAN:


nfvis(config)# switch
nfvis(config-switch)# vlan range 19-23

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.

interface vlan { vlan-id | vlan-range}

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

Values for the range can be between 1–2349 and 2450–4093.

Command Default

Not applicable

Command Modes

Switch configuration (config-switch)

Command History

Release Modification
3.5.1

This command was introduced.

Examples

The following example shows how to configure a VLAN.


nfvis(config-switch)# interface vlan 1

name

To name a VLAN, use the name command in interface switch configuration mode.

name string

Syntax Description

string

Specifies a unique VLAN name. Length: 1 to 32 characters.

Command Default

None

Command Modes

Interface (VLAN) switch configuration (config-switch-if)

Command History

Release Modification
3.5.1

This command was introduced.

Examples

The following example shows how to specify a unique VLAN name:


nfvis(config-switch)# interface vlan 1
nfvis(config-switch-if)# name testvlan
nfvis(config-switch-if)# commit
nfvis(config-switch-if)# end

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.

private-vlan { association vlan-id | community | isolated | primary}

no private-vlan

Syntax Description

association vlan-id

Associates the primary VLAN with secondary VLANs using the VLAN ID. Valid range is:

  • 1–2349

  • 2450–4093

community

Designates the VLAN as a community VLAN.

isolated

Designates the VLAN as an isolated VLAN.

primary

Designates the VLAN as a primary VLAN.

Command Default

None

Command Modes

Interface (VLAN) switch configuration (config-switch-if)

Command History

Release Modification
3.5.1

This command was introduced.

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.

Examples

The following example shows how to configure a private VLAN:


nfvis(config-switch)# interface vlan 1
nfvis(config-switch-if)# private-vlan primary
nfvis(config-switch-if)# commit
nfvis(config-switch-if)# end

show switch vlan

To display VLAN information, use the show switch vlan command in privileged EXEC mode.

show switch vlan [ vlan-id] [ detailed { created-by | name | tagged-ports | untagged-ports | vlan} ]

Syntax Description

vlan-id

Specifies the VLAN ID.

created-by

Displays the information based on the creation mode.

name

Displays the information based on the name.

tagged-ports

Displays the information based on the tagged ports.

untagged-ports

Displays the information based on the untagged ports.

vlan

Displays the information based on the VLAN.

Command Default

None

Command Modes

Privileged EXEC (#)

Command History

Release Modification
3.6.1

This command was introduced.

Examples

The following is a sample output of the show switch vlan command:


nfvis# show switch vlan
VLAN              TAGGED                       CREATED
ID    VLAN  NAME  PORTS   UNTAGGED PORTS       BY
---------------------------------------------------------
1     1     1     None    gi0-7,te2,te4,po1-4   Default
400   400   400   te2     None                  Manual