The access-vlan command adds one or more sub-VLANs to a super-VLAN.
The undo access-vlan command removes one or more sub-VLANs from a super-VLAN.
By default, no sub-VLAN is added to the super-VLAN.
access-vlan { vlan-id1 [ to vlan-id2 ] } &<1-10>
undo access-vlan { vlan-id1 [ to vlan-id2 ] } &<1-10>
Parameter |
Description |
Value |
---|---|---|
vlan-id1 [ to vlan-id2 ] |
Specifies a range of sub-VLAN IDs.
You can specify a maximum of 10 VLAN ID ranges at a time. The ranges cannot overlap. |
|
Usage Scenario
The VLAN technology is widely applied to packet switching networks because it controls broadcast domains flexibly and is easy to deploy. Generally, a Layer 3 switch usually uses a Layer 3 logical interface in each VLAN to allow user hosts in different broadcast domains to communicate. This wastes IP addresses. The VLAN aggregation function is introduced to save IP addresses while implementing communication between VLANs.
The VLAN aggregation function associates a super-VLAN with multiple sub-VLANs. A VLANIF interface can be created in the super-VLAN and be configured with an IP address. Interfaces in all the sub-VLANs use this IP address as the gateway address to communicate with interfaces in other VLANs. This reduces subnet IDs, subnet default gateway addresses, and subnet broadcast IP addresses. In a word, the VLAN aggregation function allows different broadcast domains to use the same subnet address, implements flexible addressing, and saves IP addresses.
Prerequisites
The super-VLAN has been configured using the aggregate vlan command.
Before running the access-vlan command, delete VLANIF interfaces from all the sub-VLANs.
Follow-up Procedure
Configure the sub-VLANs to implement Layer 2 communication between them.
Precautions
The super-VLAN must be different from all its sub-VLANs.
A VLAN can be added to only one super-VLAN.
If you run the access-vlan command multiple times in the same VLAN view, all the specified VLANs are added to the super-VLAN.