vlan

Syntax

vlan { vlan-id1 [ to vlan-id2 ] | all }

undo vlan { vlan-id1 [ to vlan-id2 ] | all }

View

System view

Default level

2: System level

Parameters

vlan-id1, vlan-id2: Specifies a VLAN ID, in the range of 1 to 4094.

vlan-id1 to vlan-id2: Specifies a VLAN range. The vlan-id2 argument cannot be smaller than the vlan-id1 argument.

all: Creates or removes all VLANs except reserved VLANs. The keyword is not supported when the maximum number of VLANs that can be created on a device is less than 4094.

Description

Use vlan vlan-id to create a VLAN and enter its view or enter the view of an existing VLAN.

Use vlan vlan-id1 to vlan-id2 to create VLANs in the range of vlan-id1 to vlan-id2, except reserved VLANs.

Use undo vlan to remove the specified VLANs.

By default, only the default VLAN (VLAN 1) exists.

You cannot create or remove the default VLAN (VLAN 1).

You cannot create or remove reserved VLANs reserved for specific functions.

For the following VLANs, you must remove the related configurations first, because you cannot use the undo vlan command to directly remove them:

Related commands: display vlan.

Examples

# Create VLAN 2, and enter VLAN 2 view.

<Sysname> system-view
[Sysname] vlan 2
[Sysname-vlan2]

# Create VLAN 4 through VLAN 100.

<Sysname> system-view
[Sysname] vlan 4 to 100
Please wait............. Done.