Table of Contents
Chapter 8 Configuring VLAN... 8-1 8.1 Overview ... 8-1 8.2 Command List... 8-2 8.3 Configuring a VLAN ... 8-2 8.3.1 Adding a VLAN... 8-2 8.3.2 Querying the VLAN Settings ... 8-3 8.3.3 Configuring the VLAN Attributes ... 8-4 8.3.4 Deleting a VLAN... 8-5 8.3.5 Adding a Port to a VLAN ... 8-5 8.3.6 Querying the VLAN Settings of a Port ... 8-5 8.3.7 Deleting a Port from a VLAN... 8-6 8.3.8 Configuring a Layer 3 Virtual Interface for a VLAN... 8-6 8.3.9 Configuring a Super VLAN... 8-6
Chapter 8 Configuring VLAN
This chapter introduces the following:z Overview
z Command List
z Configuring a VLAN
8.1 Overview
There are four VLAN types, namely standard VLAN, smart VLAN, MUX VLAN and super VLAN.
Table 8–1 gives a detailed description of the four VLAN types. Table 8–1 VLAN type and application range
VLAN type Description Application range
Standard VLAN
The Ethernet ports in a standard VLAN can communicates with each other, while the Ethernet port of different standard VLANs cannot.
It is used for the LAN access and the LAN subtending services of the IPMB card.
Smart VLAN
A smart VLAN can contain multiple xDSL virtual ports.
Service flows of the xDSL virtual ports are isolated. In addition, services flows in different smart VLANs are also isolated. A smart VLAN can access multiple xDSL subscribers, reducing the number of VLANs occupied.
It is used for xDSL access services.
MUX VLAN
A MUX VLAN contains only one xDSL virtual port.
Service flows in different MUX VLANs are isolated.
There is a one-to-one mapping between the MUX VLAN and the access subscriber. Therefore, you can distinguish different subscribers by the VLAN tags.
It is used for xDSL access services.
Super VLAN
A super VLAN is a layer-3 based VLAN. A super VLAN consists of multiple
sub-VLANs that can communicate with each other at layer 3 through the ARP Proxy. There are three types of sub-VLANs: standard VLAN, smart VLAN and MUX VLAN.
It saves IP addresses and increases the service efficiency of the IP addresses.
8.2 Command List
Table 8–2 lists the commands for the VLAN configuration. Table 8–2 Commands for the VLAN configuration
To… Use… In…
Add a VLAN vlan
Delete a VLAN undo vlan
Query the VLAN settings display vlan
Add a port to a VLAN port vlan
Query the VLAN settings of a port display port vlan Delete a port from a VLAN undo port vlan Configure a super VLAN supervlan
Cancel a super VLAN undo supervlan
Configure the attributes for a VLAN vlan attrib Delete the configuration of a VLAN undo vlan attrib Configure a layer 3 virtual interface
for a VLAN interface vlanif
Delete a layer 3 virtual interface for
a VLAN undo interface vlanif
Global config mode
8.3 Configuring a VLAN
This section shows how to configure a VLAN.
8.3.1 Adding a VLAN
To add one or more VLANs and specify the VLAN types, use the vlan command.
Example
To add a standard VLAN (VLAN ID=2), a smart VLAN (VLAN ID=3), a MUX VLAN (VLAN ID=4) and a super VLAN (VLAN ID=5), do as follows:
huawei(config)#vlan { vlanid<U><2,4000>|attrib<K> }:2 { vlantype<E><mux,standard,smart,super>|to<K> }:standard huawei(config)#vlan 3 mux huawei(config)#vlan 4 smart huawei(config)#vlan 5 super Example
To add MUX VLANs in batches, with VLAN IDs from 10 to 15, do as follows: huawei(config)#vlan { vlanid<U><2,4000>|attrib<K> }:10 { vlantype<E><mux,standard,smart,super>|to<K> }:to { end-vlanid<U><2,4000> }:15 { vlantype<E><mux,standard,smart,super> }:mux
It will take several minutes, and console may be timeout , please use command idle-timeout to set time limit
Are you sure to add VLANs? (y/n)[n]:y The total of the added vlan is 6
8.3.2 Querying the VLAN Settings
To query the settings of one or all VLANs, use the display vlan command.
Example
To display the settings of VLAN 20, do as follows:
huawei(config)#display vlan 20 { <cr>|to<K> }:
Command:
display vlan 20 VLAN ID: 20
VLAN type: MUX
VLAN attribute: common
--- F/S /P Native VLAN State --- 0/3 /2 2 down --- Standard port number: 1
Service virtual port number: 0
Example
To display the settings of VLAN 10 to VLAN 15, do as follows:
huawei(config)#display vlan { vlanid<U><1,4000>|all<K>|number<K> }:10 { <cr>|to<K> }:to { end-vlanid<U><1,4000> }:15 { <cr>|vlantype<E><mux,standard,smart,super>|vlanattr<K> }: --- VLAN Type Attribute STND-Port NUM SERV-Port NUM
--- 10 MUX common 0 0 11 MUX common 0 0 12 MUX common 0 0 13 MUX common 0 0 14 MUX common 0 0 15 MUX common 0 0 --- Total: 6
Note : STND-Port--standard port, SERV-Port--service virtual port
8.3.3 Configuring the VLAN Attributes
The VLAN supports three attributes: Common, QinQ and Stacking. Table 8–3 shows the details of the VLAN attributes.
Table 8–3 VLAN attributes
VLAN Attributes Application
Common VLAN A common VLAN acts as a common layer 2 VLAN or the layer 3 virtual interface.
QinQ VLAN
A QinQ VLAN packet contains an internal VLAN tag of the subscriber private network and an external VLAN tag allocated by the UA5000. The QinQ VLAN can form a layer 2 VPN tunnel to transparently transmit services among private networks.
Stacking VLAN
A stacking VLAN packet contains an internal VLAN tag and an external VLAN tag. Both tags are assigned by the UA5000. VLAN stacking is adopted for the upper BAS to realize dual VLAN authentication and increase the number of access subscribers.
In a network working in the layer-2 mode, the packets can be forwarded based on the VLAN tags and the MAC addresses. In this way, the UA5000 offers the multi-ISP wholesale service.
To configure the attributes for a specified VLAN, use the vlan attrib command. The default attribute of a VLAN is common.
Example
To configure the attributes of a VLAN (VLAN ID=2) as QinQ, do as follows:
huawei(config)#vlan attrib 2 q-in-q
Note:
These VLANs cannot be configured as the QinQ or stacking VLANs:
z A VLAN which is configured with a virtual port or has enabled the layer 3 function , such as the super VLAN or the sub VLAN
z The system default VLAN (VLAN ID=1), and the default VLAN which is set as the upstream interface for a VLAN
z A standard VLAN
8.3.4 Deleting a VLAN
To delete a VLAN, use the undo vlan command.
Example
To delete VLAN 15, do as follows:
huawei(config)#undo vlan 15
To delete a VLAN, you must delete all the ports in the VLAN.
8.3.5 Adding a Port to a VLAN
To add a port to one or more VLANs, use the port vlan command.
Example
To add port 0/2/1 to VLAN 2, do as follows:
huawei(config)#port vlan { vlanid<U><1,4000> }:2
{ frame/slot<S><3,4>|to<K> }:0/2 { portlist<S><1,256> }:1
8.3.6 Querying the VLAN Settings of a Port
To query the VLAN settings and the default VLAN of a port, use the display port vlan command.
Example
To query the VLAN settings of port 0/2/1, do as follows:
huawei(config)#display port vlan
{ frame/slot/port<S><5,7>|frame/slot<S><3,4> }:0/2/1 ---
1 2
--- Total: 2 Native VLAN: 1
8.3.7 Deleting a Port from a VLAN
To delete a port from a VLAN, use the undo port vlan command.
Example
To delete port 0/2/1 from VLAN 2, do as follows:
huawei(config)#undo port vlan { vlanid<U><1,4000> }:2
{ frame/slot<S><3,4>|to<K> }:0/2 { portlist<S><1,256> }:1
Note:
If a VLAN is the default VLAN of a port, or a VLAN is referenced by the static MAC address entry of a port, the port cannot be deleted from the VLAN.
8.3.8 Configuring a Layer 3 Virtual Interface for a VLAN
To configure a layer 3 virtual interface for a VLAN and enter the interface configuration mode, use the interface vlanif command.
To delete a layer 3 virtual interface from a VLAN, use the undo interface vlanif command.
Note:
A VLAN which is configured with a layer 3 virtual interface cannot be added to a super VLAN as a sub-VLAN.
8.3.9 Configuring a Super VLAN
After creating a super VLAN using the vlan command, you can configure it as shown below.
I. Adding sub-VLANs to a super VLAN
To add multiple sub-VLANs to a super VLAN, use the supervlan command. The sub-VLANs must exist and can be the standard VLAN, smart VLAN and MUX VLAN.
Example
To add the standard VLAN (VLAN ID=2), MUX VLAN (VLAN ID=3) and smart VLAN (VLAN ID=4) to the super VLAN (VLAN ID=5), do as follows:
huawei(config)#supervlan 5 { subvlan<K> }:subvlan { vlanid<U><1,4000> }:2 { <cr>|to<K> }:to
{ end-vlanid<U><1,4000> }:4
It will take several minutes, and console may be timeout, please use command idle-timeout to set time limit
Are you sure to add subvlans? (y/n)[n]:y
The total of the VLAN(s) having been processed is 3
The sum of subvlan(s) which has been added successfully is: 3
Example
To query the settings of the super VLAN (VLAN ID=5), do as follows:
huaweiconfig)#display vlan
{ vlanid<U><1,4000>|all<K>|number<K> }:5 { <cr>|to<K> }:
VLAN ID: 5
VLAN type: super VLAN attribute: common sub vlan number: 3
--- VLAN Type Attribute STND-Port NUM SERV-Port NUM --- 2 standard sub 1 0 3 MUX sub 1 0 4 smart sub 1 0 --- Note:
QinQ or Stacking VLANs cannot be added to a super VLAN as sub-VLANs.
II. Deleting a sub-VLAN from a super VLAN
To delete a sub-VLAN from a super VLAN, use the undo supervlan command.
Example
To delete the sub-VLAN (VLAN ID=2) from the super VLAN (VLAN ID=5), do as follows:
huawei(config)#undo supervlan 5 subvlan 2
III. Configuring an IP address for the layer 3 virtual interface of a super VLAN
To configure an IP address for the layer 3 virtual interface of a super VLAN, use the ip address command. All sub-VLANs share the IP address, which saves the IP address resources.
Example
To configure the IP address of the layer 3 virtual interface of the super VLAN (VLAN ID=5) as 10.1.1.1/24, do as follows: huawei(config)#interface vlanif 5 huawei(config-if-Vlanif5)#ip address { ip_addr<I><X.X.X.X> }:10.1.1.1 { ip_addr<I><X.X.X.X>|integer<U><0,32> }:24 { <cr>|sub<K> }: Note:
The layer 3 forwarding function of a super VLAN is implemented through the ARP Proxy. Therefore, you must enable the ARP proxy function to let the sub-VLANs in a super VLAN communicate with each other.