< Home

access-vlan

Function

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.

Format

access-vlan { vlan-id1 [ to vlan-id2 ] } &<1-10>

undo access-vlan { vlan-id1 [ to vlan-id2 ] } &<1-10>

Parameters

Parameter

Description

Value

vlan-id1 [ to vlan-id2 ]

Specifies a range of sub-VLAN IDs.
  • vlan-id1 specifies the start VLAN ID.
  • to vlan-id2 specifies the end VLAN ID. The value of vlan-id2 must be greater than or equal to the value of vlan-id1. If to vlan-id2 is not specified, only one VLAN is added to the super-VLAN.

You can specify a maximum of 10 VLAN ID ranges at a time. The ranges cannot overlap.

  • The value of vlan-id1 is an integer that ranges from 1 to 4094.
  • The value of vlan-id2 is an integer that ranges from 1 to 4094.

Views

VLAN view

Default Level

2: Configuration level

Usage Guidelines

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.

Example

# Add sub-VLAN20 and sub-VLAN30 to super-VLAN2.

<HUAWEI> system-view
[HUAWEI] vlan 2
[HUAWEI-vlan2] aggregate-vlan
[HUAWEI-vlan2] access-vlan 20 30
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >