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:
|
The vlan-id1 and vlan-id2 are integers ranging from 1 to 4094. |
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 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. The vlan command multiple times creates multiple VLANs. If a VLAN has been created, using 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, using this command cannot be used to create the same VLAN or modify the configurations of the VLAN. The vlan batch commands multiple times creates VLANs in multiple batches.
Before deleting a VLAN, run the undo interface vlanif command to delete the corresponding VLANIF interface.