vlan (system view)

Function

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

The undo vlan command deletes the VLAN.

By default, no VLAN exists.

Format

vlan vlan-id

undo vlan vlan-id

Parameters

Parameter Description Value
vlan vlan-id

Specifies a VLAN ID.

The value is an integer ranging from 1 to 4094.

Views

System view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
vlan write

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 devices that do not need to communicate with each other.

Precautions

The vlan command creates a VLAN and displays the VLAN view. If a VLAN has been created, the VLAN view is displayed after this command is used. If you run the vlan command more than once, all the created VLANs take effect. If a VLAN has been created, using this command does not create the same VLAN or modify the VLAN configuration. After a VLAN is created, both the vlan and vlan batch configurations exist in the configuration file.

Example

# Create VLAN 2. If it already exists, display the VLAN 2 view.
<HUAWEI> system-view
[~HUAWEI] vlan 2
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >