< Home

vlan

Function

The vlan command creates a VLAN and displays the VLAN view. If the VLAN exists, the VLAN view is displayed.

The undo vlan command deletes a VLAN.

By default, all interfaces belong to the default VLAN, named VLAN 1.

Format

vlan vlan-id

vlan batch { vlan-id1 [ to vlan-id2 ] } &<1-10>

undo vlan vlan-id

undo vlan batch { vlan-id1 [ to vlan-id2 ] } &<1-10>

Parameters

Parameter Description Value
vlan-id Specifies the VLAN ID. The value is an integer ranging from 1 to 4094.
batch Configures VLANs in batches. -
vlan-id1 to vlan-id2 Specifies range of VLANs to be configured in batches:
  • vlan-id1 specifies the start VLAN ID.

  • vlan-id2 specifies the end VLAN ID.

    vlan-id2 must be greater than or equal to vlan-id1. vlan-id1 and vlan-id2 define a range together.

  • If the parameter to vlan-id2 is not specified, only the VLAN specified by vlan-id1 is created.

The vlan-id1 and vlan-id2 are integers ranging from 1 to 4094.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

To reduce broadcast domains and enhance security on a complex network, VLANs can be created on the network to isolate the hosts that do not need to communicate with each other. The vlan batch command creates multiple VLANs at one time, simplifying VLAN configuration.

Follow-up Procedure

Assign VLANs according to network requirements.

Precautions

VLAN 1 is the default VLAN, which cannot be deleted and does not need to be created.

The vlan command can be used to create a VLAN and enter the VLAN view. If a VLAN has been created, the VLAN view is displayed after this command is used. You can repeat the vlan command for multiple times. If a VLAN has been created, this command cannot be used to create the same VLAN or modify the configurations of the VLAN.

The vlan batch command can be used to create multiple VLANs in batches. If a VLAN has been created, this command cannot be used to create the same VLAN or modify the configurations of the VLAN. If you run the vlan batch command multiple times, all the specified VLANs are created.

Example

# Create VLAN 100 and enter the VLAN 100 view. If VLAN 100 exists, the VLAN 100 view is displayed directly.

<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100]
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >