3.4. VLAN Commands
3.4.1. vlan database
Command Purpose
Use this command to enter VLAN configure mode.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
vlan database
Command Mode
Global Config
Default
None
Usage
When you try to create or remove VLAN, you must use this command to enter VLAN configure mode first. To exit VLAN configure mode, use exit command.
Examples
This example shows how to enter VLAN configure mode:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)#
This example shows how to exit VLAN configure mode:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# exit
Switch(config)#
3.4.2. vlan
Command Purpose
Use the vlan VLAN configuration command to configure VLAN characteristics for a VLAN in the VLAN database. Use the no form of this command to delete a VLAN.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
vlan VLAN_ID ( name NAME | ) ( state ( enable | disable ) | )
no vlan VLAN_ID
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID |
Vlan id |
1-4094 |
NAME |
the name for specific vlan, |
A string with no more than 31 characters |
enable |
set the operational state of the VLAN to enable, and it is enabled by default |
- |
disable |
set the operational state of the VLAN to disable |
- |
Command Mode
VLAN Configuration
Default
VLAN 1 is the default VLAN and all ports have been added to it by default.
Usage
Default VLAN 1 can not be removed.
Examples
This example shows how to create VLAN 11 and named it to “vlan11”:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# vlan 11 name vlan11 state enable
This example shows how to remove VLAN 11:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# no vlan 11
Related Commands
vlan VLAN_LIST
show vlan vlan
show vlan all
3.4.3. vlan VLAN_LIST
Command Purpose
Use the vlan VLAN_LIST configuration command to add a normal-range VLANs to the VLAN database.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
vlan VLAN_LIST
no vlan VLAN_LIST
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_LIST |
vlan list |
vlan list connected with `-` and `,` , for example, “1-10,15,20,30-40” |
Command Mode
VLAN Configuration
Default
Vlan 1 is the default vlan and all ports have been added to it by default.
Usage
The vlan list should be connected with ‘-’ and ‘,’, the value should be in the range of <1-4094> and should be ascending order.
Default VLAN 1 can not be removed.
Examples
This example shows how to add vlans of “100,200,300-400”:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# vlan 100,200,300-400
This example shows how to remove vlans of “100,200,300-400”:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# no vlan 100,200,300-400
Related Commands
vlan <1-4094>
show vlan vlan
show vlan all
3.4.4. show vlan
Command Purpose
Use this command to display specific vlan information.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
show vlan VLAN_ID
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID |
Vlan id |
1-4094 |
Command Mode
Privileged EXEC
Default
None
Usage
This command is used to display VLAN property including name, state, stp id, DSCP, member ports.
Examples
This example shows how to display the information on VLAN 11:
Switch# show vlan 11
VLAN ID Name State STP ID Member ports
(u)-Untagged, (t)-Tagged
======= ===============================
11 VLAN0011 ACTIVE 0 eth-0-3(u) eth-0-4(t)
Related Commands
show vlan all
3.4.5. show vlan all
Command Purpose
Use this command to show the information of all the VLAN.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
show vlan all
Command Mode
Privileged EXEC
Default
None
Usage
This command is used to display all VLAN property including name, state, stp id, DSCP, member ports.
Examples
This example shows how to display the information on VLAN all:
Switch# show vlan all
VLAN ID Name State STP ID Member ports
(u)-Untagged, (t)-Tagged
======= =========================== ======= ======= ========================
1 default ACTIVE 0 eth-0-1(u) eth-0-2(u)
eth-0-4(t) eth-0-5(u)
11 VLAN0011 ACTIVE 0 eth-0-3(u) eth-0-4(t)
Related Commands
show vlan vlan
3.4.6. show vlan brief
Command Purpose
Use this command to show the brief information on VLAN.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
show vlan brief
Command Mode
Privileged EXEC
Default
None
Usage
This command is used to display all VLAN information for all bridges, including static and dynamic.
Examples
This example shows how to display the brief information on VLAN:
Switch# show vlan brief
VLAN ID Name State STP ID Member ports
(u)-Untagged, (t)-Tagged
======= =========================== ======= ======= =====================
1 default ACTIVE 0 eth-0-1(u) eth-0-2(u)
eth-0-4(u) eth-0-5(u)
10 VLAN0010 ACTIVE 0 eth-0-3(u)
Related Commands
show vlan vlan
3.4.7. show interface switchport
Command Purpose
Use this command to show the vlan configurations on all bridge ports or a bridge port.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
show interface switchport { interface IFNAME | }
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
IFNAME |
Interface name |
Support aggregation and physical ports |
Command Mode
Privileged EXEC
Default
None
Usage
This command is used to display one or all VLAN’s L2 configurations.
Examples
This example shows how to display the vlan configurations on all bridge ports or a bridge port:
Switch# show interface switchport interface eth-0-1
Interface name : eth-0-1
Switchport mode : access
Ingress filter : enable
Acceptable frame types : vlan-untagged only
Default Vlan : 1
Configured Vlans : 1
Interface name : eth-0-2
Switchport mode : access
Ingress filter : enable
Acceptable frame types : vlan-untagged only
Default Vlan : 1
Configured Vlans : 1
Related Commands
switchport mode access
switchport mode trunk
3.4.8. switchport access allowed
Command Purpose
Use this command to allow or remove the access port to the specifid vlan
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
switchport access allowed vlan ( add|remove ) VLAN_ID_LIST
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
add |
add the port to the specified vlan |
- |
remove |
remove the port from the specified vlan |
- |
VLAN_ID_LIST |
vlan list |
Connected with `-` and `,` , for example, “1-10,15,20,30-40” |
Command Mode
Interface Configuration
Default
None
Usage
This command used to allow or forbid the port transmit in specified vlan.
Examples
This example shows how to add the access port to vlan11:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport access allowed vlan add 11
This example shows how to remove the access port to vlan12:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport access allowed vlan remove 12
Related Commands
switchport trunk allowed
3.4.9. switchport access vlan
Command Purpose
Use this command to add port to a specified.Use the no form of this command to add port to vlan1.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
switchport access vlan VLAN_ID
no switchport access vlan
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID |
Vlan id |
2-4094 |
Command Mode
Interface Configuration
Default
All ports are default in vlan 1
Usage
Used the switchport mode access command to switch the port to access mode before use this command.
Examples
This example shows how to add the access port to vlan11:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport access vlan 11
This example shows how to revert the port to vlan1:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no switchport access vlan
Related Commands
switchport mode access
3.4.10. switchport mode access
Command Purpose
Use this command to swith port to access mode.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
switchport mode access
Command Mode
Interface Configuration
Default
None
Usage
Access mode used to connect terminal, e.g:PC.The FDB on the port will be cleared when switch the port mode.
Examples
This example shows how to set the port to access mode:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport mode access
Related Commands
switchport mode trunk
3.4.11. switchport mode trunk
Command Purpose
Use this command to swith port to trunk mode.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
switchport mode trunk
Command Mode
Interface Configuration
Default
None
Usage
Trunk mode used to connect swith device or terminal.The FDB on the port will be cleared when switch the port mode.
Examples
This example shows how to set the port to trunk mode:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport mode trunk
Related Commands
switchport mode access
3.4.12. switchport trunk allowed
Command Purpose
Use this command to allow or remove the trunk port to the specifid vlan
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
switchport trunk allowed vlan ( add VLAN_ID_LIST|remove VLAN_ID_LIST | all | none )
no switchport trunk
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID_LIST |
vlan list |
Connected with `-` and `,` , for example, “1-10,15,20,30-40” |
add |
add the port to the specified vlan |
- |
remove |
remove the port from the specified vlan |
- |
all |
add the port to all vlans |
- |
none |
remove the port from all vlans |
- |
Command Mode
Interface Configuration
Default
None
Usage
This command used to allow or forbid the port transmit in specified vlan.
Examples
This example shows how to add the port in vlan11,12:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport trunk allowed vlan add 11,12
This example shows how to remove the port from vlan11,12:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport trunk allowed vlan remove 11,12
This example shows how to allow the port transmit in all vlan:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport trunk allowed vlan all
This example shows how to forbid the port transmit in all vlan:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport trunk allowed vlan none
Related Commands
switchport access allowed
3.4.13. switchport trunk native
Command Purpose
Use this command to configure the default VLAN for this trunk port.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
switchport trunk native vlan VLAN_ID
no switchport trunk native vlan
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID |
An existing Vlan id |
2-4094 |
Command Mode
Interface Configuration
Default
vlan 1
Usage
This command is used to set the native VLAN for sending and receiving untagged traffic.
Examples
This example shows how to set the native vlan to vlan 10 on the interface:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport trunk native vlan 10
This example shows how to return the native vlan to default on the interface:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no switchport trunk native vlan
Related Commands
switchport trunk allowed
3.4.14. switchport trunk unatgged vlan
Command Purpose
Use this command to strip the packets vlan tag out of this port.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
switchport trunk untagged vlan VLAN_ID_LIST
no switchport trunk untagged vlan VLAN_ID_LIST
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID_LIST |
vlan list |
Connected with `-` and `,` , for example, “1-10,15,20,30-40” |
Command Mode
Interface Configuration
Default
None
Usage
None
Examples
This example shows how to allocate the needing strip vlan tag on the interface.:
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# switchport trunk untagged vlan 1-2
Related Commands
None
3.4.15. vlan bridge disable
Command Purpose
Use this command to disable bridge function on specific VLAN. To enable it, use the no form of this command.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
vlan VLAN_ID bridge disable
no vlan vlan bridge disable
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID |
Vlan id |
1-4094 |
Command Mode
VLAN Configuration
Default
Vlan bridge enable
Usage
None
Examples
This example shows how to disable bridge function on VLAN 2:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# vlan 10 bridge disable
This example shows how to enable bridge function on VLAN 2:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# no vlan 10 bridge disable
Related Commands
None
3.4.16. vlan statistics enable
Command Purpose
Use this command to enable the statistics of VLAN.
To disable the statistics, use the no form of this command.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
vlan VLAN_ID statistics enable
no vlan VLAN_ID statistics enable
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID |
An existing Vlan id |
1-4094 |
Command Mode
VLAN Configuration
Default
inactive
Usage
none
Examples
This example shows how to enable the statistics of vlan 2:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# vlan 2 statistics enable
This example shows how to disable the statistics of vlan 2:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# no vlan 2 statistics enable
Related Commands
vlan statistics interval
clear vlan statistics
show vlan vlan statistics
3.4.17. vlan statistics interval
Command Purpose
Use this command to set sample interval.
To restore to default value, use the no form of this command.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
vlan statistics interval VALUE
no vlan statistics intval
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VALUE |
Sample interval |
5-600, unit:second |
Command Mode
VLAN Configuration
Default
10s
Usage
none
Examples
This example shows how to set sample interval:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# vlan statistics interval 20
Related Commands
vlan statistics enable
clear vlan statistics
show vlan vlan statistics
3.4.18. clear vlan statistics
Command Purpose
Use this command to clear statistics information.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
clear vlan VLAN_ID statistics
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID |
An existing Vlan id |
1-4094 |
Command Mode
Privileged EXEC
Default
none
Usage
none
Examples
This example shows how to clear vlan statistics:
Switch# clear vlan 2 statistics
Related Commands
vlan statistics enable
vlan statistics interval
show vlan vlan statistics
3.4.19. show vlan statistics
Command Purpose
Use this command to show statistics information.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
show vlan VLAN_ID statistics
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID |
An existing Vlan id |
1-4094 |
Command Mode
Privileged EXEC
Default
none
Usage
none
Examples
This example shows how to show vlan statistics:
Switch# show vlan 2 statistics
VLAN: 2
-----------------------------------
Item Packets
-----------------------------------
Inbound: 3654365
Outbound: 3654365
-----------------------------------
Related Commands
vlan statistics enable
vlan statistics interval
3.4.20. show resource vlan-stats
Command Purpose
Use this command to show the resource statistic used by vlan statistics.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
show resource vlan-stats
Command Mode
Privileged EXEC
Default
none
Usage
none
Examples
This example shows how to show resource used by vlan statistics:
Switch# show resource vlan-stats
VLAN-STATS
Resource Used Capability
=============================================================
Applied VLAN Stats Entry 1 128
Related Commands
vlan statistics enable
3.4.21. vlan statistics include-interframe
Command Purpose
Use this command to enable the statistics of VLAN include interframe.
To disable the statistics include-interframe, use the disable form of this command.
Prerequisites
Platform |
Software |
License |
Comments |
---|---|---|---|
AQ-N3000 |
7.0 |
Base |
|
AQ-N5000 |
7.0 |
Base |
|
AQ-N6000 |
7.0 |
Base |
Command Syntax
vlan VLAN_ID statistics include-interframe enable
vlan VLAN_ID statistics include-interframe disable
Parameter |
Parameter Description |
Parameter Value |
---|---|---|
VLAN_ID |
An existing Vlan id |
1-4094 |
Command Mode
VLAN Configuration
Default
disable
Usage
none
Examples
This example shows how to enable the statistics include-interframe of vlan 2:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)# vlan 2 statistics include-interframe enable
This example shows how to disable the statistics include-interframe of vlan 2:
Switch# configure terminal
Switch(config)# vlan database
Switch(config-vlan)#vlan 2 statistics include-interframe disable
Related Commands
vlan statistics enable
clear vlan statistics