Creating a Sub-VLAN
Context
In VLAN aggregation, physical interfaces can be added to a sub-VLAN but a VLANIF interface cannot be created for the sub-VLAN. All the interfaces in a sub-VLAN use the same IP address of the VLANIF interface associated with the super-VLAN. VLAN aggregation reduces subnet IDs, subnet default gateway addresses, and directed broadcast IP addresses, and allows the switch to assign IP addresses to hosts in sub-VLANs according to the number of hosts.
Procedure
- Run:
system-view
The system view is displayed.
- Run:
vlan vlan-id
A VLAN is created and the VLAN view is displayed.
If a device is configured with multiple VLANs, configuring names for these VLANs is recommended:
Run the name vlan-name command in the VLAN view. After a VLAN name is configured, you can run the vlan vlan-name vlan-name command in the system view to enter the corresponding VLAN view.
The vlan configuration command completes vLAN configurations when the VLAN is not created.
- Run:
interface interface-type interface-number
The interface view is displayed.
- Configure the link type of the interface.
Run either of the following commands as needed:
Set the link type of the interface to Access.
Run:
port link-type access
The link type of the interface is set to Access.
Run:
port default vlan vlan-id
The interface is added to the sub-VLAN.
Set the link type of the interface to Trunk.
Run:
port link-type trunk
The link type of the interface is set to Trunk.
Run:
port trunk allow-pass vlan vlan-id
The interface is added to the sub-VLAN.
Set the link type of the interface to Hybrid.
Run:
port link-type hybrid
The link type of the interface is set to Hybrid.
Run:
port hybrid tagged vlan vlan-id or port hybrid untagged vlan vlan-id
The interface is added to the sub-VLAN.
- Run:
quit
Return to the system view.