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.
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>
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 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.