04-Layer 2 - LAN Switching Command Reference

HomeSupportSwitchesH3C S9500E Switch SeriesReference GuidesCommand ReferencesH3C S9500E Command Reference-Release1728-6W17004-Layer 2 - LAN Switching Command Reference
01-VLAN Commands
Title Size Download
01-VLAN Commands 252.37 KB

VLAN configuration commands

Basic VLAN configuration commands

default

Syntax

default

View

VLAN interface view

Default level

2: System level

Parameters

None

Description

Use the default command to restore the default settings for a VLAN interface.

This command might fail to restore the default settings for some commands for reasons such as command dependencies and system restrictions. You can use the display this command in interface view to check for these commands, and perform their undo forms or follow the command reference to individually restore their default settings. If your restoration attempt still fails, follow the error message to resolve the problem.

 

CAUTION

CAUTION:

The default command might interrupt ongoing network services. Make sure you are fully aware of the impacts of this command when you perform it on a live network.

 

Examples

# Restore the default settings for VLAN-interface 1.

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] default

This command will restore the default settings. Continue? [Y/N]:y

description

Syntax

description text

undo description

View

VLAN view, VLAN interface view

Default level

2: System level

Parameters

text: Specifies a description for a VLAN or VLAN interface. Valid characters and symbols include case-sensitive letters, digits, special characters (including ~ ! @ # $ % ^ & * ( ) - _ + = { } [ ] | \ : ; " ' < > , . /), spaces, and other Unicode characters and symbols.

·           For a VLAN, this is a string of 1 to 32 characters.

·           For a VLAN interface, this is a string of 1 to 80 characters.

 

 

NOTE:

·       Each Unicode character takes the space of two regular characters.

·       To use Unicode characters or symbols in an interface description, install the specific input method editor and log in to the switch through remote login software that supports the character type.

·       When the length of a description string reaches or exceeds the maximum line width on the terminal software, the software starts a new line, possibly breaking a Unicode character into two. As a result, garbled characters may be displayed at the end of a line.

 

Description

Use the description command to configure the description of the VLAN or VLAN interface.

Use the undo description command to restore the default.

For a VLAN, the default description is the VLAN ID, for example, VLAN 0001. For a VLAN interface, the default description is the name of the interface, for example, Vlan-interface 1 Interface.

You can configure a description to describe the function or connection of a VLAN or VLAN interface, which is very helpful when a large number of VLANs are created on the switch.

Examples

# Configure the description of VLAN 1 as sales-private.

<Sysname> system-view

[Sysname] vlan 1

[Sysname-vlan1] description sales-private

# Configure the description of VLAN-interface 2 as linktoPC56.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] quit

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2] description linktoPC56

display interface vlan-interface

Syntax

display interface [ vlan-interface ] [ brief [ down ] ] [ | { begin | exclude | include } regular-expression ]

display interface vlan-interface vlan-interface-id [ brief ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

vlan-interface-id: Specifies a VLAN interface number.

brief: Displays brief interface information. If you do not specify this keyword, the command displays detailed interface information.

down: Displays information about interfaces in the DOWN state and the causes. If you do not specify this keyword, this command displays information about interfaces in all states.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display interface vlan-interface command to display information about a specified or all VLAN interfaces.

If you do not provide the vlan-interface keyword, this command displays information about all interfaces.

If you provide the vlan-interface keyword but does not specify the VLAN interface number, this command displays information about all VLAN interfaces.

Related commands: interface vlan-interface.

Examples

# Display information about VLAN-interface 3000.

<Sysname> display interface Vlan-interface3000

Vlan-interface3000 current state: UP

Line protocol current state: UP

Description: Vlan-interface3000 Interface

The Maximum Transmit Unit is 1500

Internet Address is 192.168.3.2/24 Primary

IP Packet Frame Type: PKTFMT_ETHNT_2,  Hardware Address: 00e0-fc00-9612

IPv6 Packet Frame Type: PKTFMT_ETHNT_2,  Hardware Address: 00e0-fc00-9612

Last clearing of counters:  Never

    Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

    Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec

    0 packets input, 0 bytes, 0 drops

    0 packets output, 0 bytes, 0 drops  

# Display brief information for VLAN-interface 2.

<Sysname> display interface vlan-interface 2 brief

The brief information of interface(s) under route mode:

Link: ADM - administratively down; Stby - standby

Protocol: (s) - spoofing

Interface            Link Protocol Main IP         Description

Vlan2                DOWN DOWN     --

# Display brief information for VLAN interfaces in DOWN state.

<Sysname> display interface vlan-interface brief down

The brief information of interface(s) under route mode:

Link: ADM - administratively down; Stby - standby

Interface            Link Cause

Vlan2                DOWN Not connected

Table 1 Output description

Field

Description

Vlan-interface3000 current state

The physical state of the VLAN interface:

·       DOWN (Administratively)The administrative state of the VLAN interface is down because it has been manually shut down with the shutdown command.

·       DOWNThe administrative state of the VLAN interface is up, but its physical state is down. It indicates that the VLAN corresponding to this interface does not contain any port in the UP state (possibly because the ports are not well connected or the lines have failed).

·       UPBoth the administrative state and the physical state of the VLAN interface are up.

Line protocol current state

The link layer protocol state of the VLAN interface:

·       DOWNThe protocol state of the VLAN interface is down, usually because no IP address is configured.

·       UPThe protocol state of the VLAN interface is up.

Description

The description string of the VLAN interface.

The Maximum Transmit Unit

The MTU of the VLAN interface.

Internet Address is 192.168.3.2/24 Primary

The primary IP address of this interface is 192.168.3.2/24. This field is displayed when a primary IP address is configured for the interface.

Internet Address

IP address of the VLAN interface.

IP Packet Frame Type

IPv4 outgoing frame format.

Hardware address

MAC address corresponding to the VLAN interface.

IPv6 Packet Frame Type

IPv6 outgoing frame format.

Last clearing of counters

Time when the reset counts interface vlan-interface command was last used to clear the interface statistics. Never indicates the reset counters interface command has never been used on the interface since the switch’s startup.

Last 300 seconds input:  0 bytes/sec 0 packets/sec

Last 300 seconds output:  0 bytes/sec 0 packets/sec

Average rate of input packets and output packets in the last 300 seconds (in bps and pps).

0 packets input, 0 bytes, 0 drops

Total number and size (in bytes) of the received packets of the interface and the number of the dropped packets.

0 packets output, 0 bytes, 0 drops

Total number and size (in bytes) of the transmitted packets of the interface and the number of the dropped packets.

The brief information of interface(s) under route mode

Brief information about Layer 3 interfaces.

Link: ADM - administratively down; Stby - standby

The interface has been administratively shut down. To recover its physical state, perform the undo shutdown command.

Stby indicates that the interface is operating as a standby interface.

Protocol: (s) - spoofing

If the network layer protocol state of an interface is shown as UP, but its link is an on-demand link or not present at all, its protocol attribute includes the spoofing flag (an s in parentheses).

Interface

The abbreviated interface name.

Link

The physical link state of the interface:

·       UP—The link is up.

·       ADM—The link has been administratively shut down. To recover its physical state, perform the undo shutdown command.

Protocol

Protocol connection state of the interface, UP, DOWN, or UP(s).

Main IP

The main IP address of the interface.

Description

The description of the interface.

Cause

The cause of a DOWN physical link. If the port has been shut down with the shutdown command, this field displays Administratively. To restore the physical state of the interface, use the undo shutdown command.

 

display vlan

Syntax

display vlan [ vlan-id1 [ to vlan-id2 ] | all | dynamic | reserved | static ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

vlan-id1: Displays information about a VLAN specified by VLAN ID ranging from 1 to 4094.

vlan-id1 to vlan-id2: Displays information about VLANs specified by a VLAN ID range.

all: Displays information about all VLANs.

dynamic: Displays the number of dynamic VLANs and the ID of each dynamic VLAN.

reserved: Displays information of the reserved VLANs.

static: Displays the number of static VLANs and the ID of each static VLAN. Static VLANs refer to VLANs manually created.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display vlan command to display VLAN information.

Related commands: vlan.

Examples

# Display information about VLAN 2.

<Sysname> display vlan 2

VLAN ID: 2

 VLAN Type: static

 Route Interface: configured

 IP Address: 192.168.1.101

 Subnet Mask: 255.255.255.0

 Description: VLAN 0002

 Name: VLAN 0002

 Tagged   Ports: none

 Untagged Ports:

    GigabitEthernet3/0/18

Table 2 Output description

Field

Description

VLAN Type

VLAN type, static or dynamic.

Route interface

Indicates whether the VLAN interface is configured or not.

IP Address

Primary IP address of the VLAN interface (available only when an IP address is configured for the VLAN interface). To display secondary IP addresses, use the display interface vlan-interface command in any view or the display this command in VLAN interface view.

Subnet Mask

Subnet mask of the primary IP address (available only when an IP address is configured for the VLAN interface).

Description

VLAN description.

Name

Name configured for the VLAN.

Tagged Ports

Ports through which VLAN packets are sent tagged.

Untagged Ports

Ports through which VLAN packets are sent untagged.

 

interface vlan-interface

Syntax

interface vlan-interface vlan-interface-id

undo interface vlan-interface vlan-interface-id

View

System view

Default level

2: System level

Parameters

vlan-interface-id: Specifies a VLAN interface number, ranging from 1 to 4094.

Description

Use the interface vlan-interface command to create a VLAN interface and enter its view or to enter the view of an existing VLAN interface.

Create the VLAN before you create the VLAN interface.

Use the undo interface vlan-interface command to remove the specified VLAN interface.

Use the ip address command in VLAN interface view to configure an IP address for a VLAN interface that will perform IP routing.

Related commands: display interface vlan-interface.

Examples

# Create VLAN-interface 2.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] quit

[Sysname] interface vlan-interface 2

[Sysname-Vlan-interface2]

ip address

Syntax

ip address ip-address { mask | mask-length } [ sub ]

undo ip address [ ip-address { mask | mask-length } [ sub ] ]

View

VLAN interface view

Default level

2: System level

Parameters

ip-address: Specifies an IP address in dotted decimal format.

mask: Specifies a subnet mask in dotted decimal notation.

mask-length: Specifies the number of consecutive 1s in the subnet mask, ranging from 0 to 32.

sub: Indicates that the address is a secondary IP address.

Description

Use the ip address command to assign an IP address and subnet mask to a VLAN interface.

Use the undo ip address command to remove the IP address and subnet mask for a VLAN interface.

By default, no IP address is assigned to any VLAN interface.

To connect a VLAN to multiple subnets, assign one primary IP address and multiple (127 at most) secondary IP addresses to a VLAN interface.

When you configure IP addresses for a VLAN interface, follow these guidelines:

·           An interface can have only one primary IP address. When you add a primary IP address, it replaces the existing one.

·           Remove all secondary IP addresses before you remove the primary IP address.

·           To remove all IP addresses, use the undo ip address command without any parameter.

·           To remove the primary IP address, use the undo ip address ip-address { mask | mask-length } command.

·           To remove a secondary IP address, use the undo ip address [ ip-address { mask | mask-length } [ sub ] ] command.

Related commands: display ip interface (Layer 3—IP Services Command Reference).

Examples

# Specify the IP address as 1.1.0.1, the subnet mask as 255.255.255.0 for VLAN-interface 1.

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] ip address 1.1.0.1 255.255.255.0

mtu

Syntax

mtu size

undo mtu

View

VLAN interface view

Default level

2: System level

Parameters

size: Sets the maximum Transmission Unit (MTU), ranging from 64 to 9198 bytes.

Description

Use the mtu command to set the MTU for a VLAN interface.

Use the undo mtu command to restore the default.

By default, the MTU of a VLAN interface is 1500 bytes.

Related commands: display interface vlan-interface.

Examples

# Set the MTU to 1492 bytes for VLAN-interface 1.

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] mtu 1492

name

Syntax

name text

undo name

View

VLAN view

Default level

2: System level

Parameters

text: Specifies a VLAN name, a string of 1 to 32 characters. Valid characters and symbols include case-sensitive letters, digits, special characters (including ~ ! @ # $ % ^ & * ( ) - _ + = { } [ ] | \ : ; " ' < > , . /), and spaces.

Description

Use the name command to configure a name for the VLAN.

Use the undo name command to restore the default name of the VLAN.

The default name of a VLAN is its VLAN ID. For example, VLAN 0001.

You can use VLAN names, rather than VLAN IDs, to distinguish a large number of VLANs.

Examples

# Configure the name of VLAN 2 as test vlan.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] name test vlan

reset counters interface vlan-interface

Syntax

reset counters interface vlan-interface [ vlan-interface-id ]

View

User view

Default level

2: System level

Parameters

vlan-interface-id: Specifies a VLAN interface number.

Description

Use the reset counters interface vlan-interface command to clear the statistics on a VLAN interface.

Before collecting the traffic statistics within a specific period of time on an interface, you need to clear the existing statistics first.

·           If the vlan-interface-id argument is not specified, this command clears the statistics of all VLAN interfaces.

·           If the vlan-interface-id argument is specified, this command clears the statistics of the specified VLAN interface.

Related commands: display interface vlan-interface.

Examples

# Clear the statistics on VLAN interface-2.

<Sysname> reset counters interface vlan-interface 2

shutdown

Syntax

shutdown

undo shutdown

View

VLAN interface view

Default level

2: System level

Parameters

None

Description

Use the shutdown command to shut down a VLAN interface.

Use the undo shutdown command to bring up a VLAN interface.

By default, a VLAN interface is down.

After you use the undo shutdown command to bring up a VLAN interface, the VLAN interface is in down state if all ports in the VLAN are down, and the VLAN interface is in up state if any port in the VLAN is up.

You can use the undo shutdown command to bring up a VLAN interface after you have configured related parameters and protocols for the VLAN interface. You can shut down a failed VLAN interface with the shutdown command and then bring it up with the undo shutdown command to see if it recovers.

In a VLAN, the state of any Ethernet port is independent of the state of the VLAN interface.

Examples

# Shut down VLAN interface 2 and then cancel the action of shutting down VLAN interface 2.

<Sysname> system-view

[Sysname] interface Vlan-interface 2

[Sysname-Vlan-interface2] shutdown

[Sysname-Vlan-interface2] undo shutdown

vlan

Syntax

vlan { vlan-id1 [ to vlan-id2 ] | all }

undo vlan { vlan-id1 [ to vlan-id2 ] | all }

View

System view

Default level

2: System level

Parameters

vlan-id1, vlan-id2: Specifies a VLAN ID, ranging from 1 to 4094.

vlan-id1 to vlan-id2: Specifies a VLAN range.

all: Creates or removes all VLANs except the default VLAN (VLAN 1).

Description

Use the vlan vlan-id command to create a VLAN and enter its view or enter the view of an existing VLAN.

Use the vlan vlan-id1 to vlan-id2 command to create VLANs ranging from vlan-id1 to vlan-id2.

Use the undo vlan command to remove VLANs.

You cannot create or remove the default VLAN (VLAN 1).

You cannot use the undo vlan command to remove the following VLANs:

·           VLANs configured with QoS policies

·           Control VLANs configured for Smart Link

·           VLANs reserved for RRPP

·           Remote probe VLANs configured for port mirroring

·           Voice VLANs

To remove these VLANs, remove related configurations first.

 

 

NOTE:

The switch does not support VLAN 4094 when it works in hybrid mode. For more information about system working modes, see Fundamentals Configuration Guide.

 

Related commands: display vlan.

Examples

# Enter VLAN 2 view.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2]

# Create VLAN 4 through VLAN 100.

<Sysname> system-view

[Sysname] vlan 4 to 100

Please wait............. Done.

Port-based VLAN configuration commands

display port

Syntax

display port { hybrid | trunk } [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

hybrid: Displays hybrid ports.

trunk: Displays trunk ports.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display port command to display information about the hybrid or trunk ports on the switch, including the port names, PVIDs, and allowed VLAN IDs.

Examples

# Display information about the hybrid ports in the system.

<Sysname> display port hybrid

Interface            PVID  VLAN passing

GE3/0/3              2222  Tagged:  5, 15-20

                           Untagged:1, 10-12

# Display information about the trunk ports in the system.

<Sysname> display port trunk

Interface            PVID  VLAN passing

GE3/0/3              2222  1, 5

Table 3 Output description

Field

Description

Interface

Port name.

PVID

Default VLAN ID of the port.

VLAN passing

VLANs for which the port allows packets to pass.

Tagged

VLANs for which the port sends packets without removing VLAN tags.

Untagged

VLANs for which the port sends packets after removing VLAN tags.

 

port

Syntax

port interface-list

undo port interface-list

View

VLAN view

Default level

2: System level

Parameters

interface-list: Specifies an Ethernet port list, in the format of interface-list = { interface-type interface-number [ to interface-type interface-number ] }&<1-10>, where interface-type interface-number represents the port type and port number and &<1-10> indicates that you can specify up to 10 ports or port ranges.

Description

Use the port command to assign the specified access ports to the VLAN.

Use the undo port command to remove the specified access ports from the VLAN.

By default, all ports are in VLAN 1.

This command is only applicable on access ports.

By default, all ports are access ports. However, you can manually configure the port type. For more information, see “port link-type.”

You cannot assign aggregate interfaces to a VLAN.

Related commands: display vlan.

Examples

# Assign GigabitEthernet 3/0/1 through GigabitEthernet 3/0/3 to VLAN 2.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] port gigabitethernet 3/0/1 to gigabitethernet 3/0/3

port access vlan

Syntax

port access vlan vlan-id

undo port access vlan

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

vlan-id: Specifies a VLAN ID, ranging from 1 to 4094. Make sure that the VLAN specified by the VLAN ID already exists.

Description

Use the port access vlan command to assign the access ports to the specified VLAN.

Use the undo port access vlan command to restore the default.

By default, all access ports belong to VLAN 1.

You can assign an access port to only one VLAN.

In Ethernet interface view, this command applies only to the port. In port group view, this command applies to all ports in the port group. For more information about port groups, see Interface Configuration Guide. In Layer 2 aggregate interface view, this command applies to the aggregate interface and its aggregation member ports. If the system fails apply the configuration to the aggregate interface, it stops applying the configuration to the aggregation member ports. If the system fails to apply the configuration to an aggregation member port, it skips the port and moves to the next member port. For more information about Layer 2 aggregate interfaces, see Layer 2—LAN Switching Configuration Guide.

Examples

# Assign GigabitEthernet 3/0/1 to VLAN 3.

<Sysname> system-view

[Sysname] vlan 3

[Sysname-vlan3] quit

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] port access vlan 3

port hybrid pvid

Syntax

port hybrid pvid vlan vlan-id

undo port hybrid pvid

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

vlan-id: Specifies a VLAN ID, ranging from 1 to 4094.

Description

Use the port hybrid pvid command to configure the PVID of the hybrid port.

Use the undo port hybrid pvid command to restore the default.

By default, the PVID of a hybrid port is VLAN 1.

You can use a nonexistent VLAN as the PVID for a hybrid port. If you remove the PVID of a hybrid port with the undo vlan command, it does not affect the setting of the PVID on the port.

In Ethernet interface view, this command applies only to the port. In port group view, this command applies to all ports in the port group. For more information about port groups, see Interface Configuration Guide. In Layer 2 aggregate interface view, this command applies to the aggregate interface and its member ports. If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to the aggregation member ports. If the system fails to apply the configuration to an aggregation member port, it skips the port and moves to the next member port. For more information about Layer 2 aggregate interfaces, see Layer 2—LAN Switching Configuration Guide.

H3C recommends setting the same PVID for the local hybrid port and the remote hybrid port.

You must use the port hybrid vlan command to configure the hybrid port to allow and forward packets from the PVID.

Related commands: port link-type and port hybrid vlan.

Examples

# Configure VLAN 100 as the PVID of the hybrid port GigabitEthernet 3/0/1.

<Sysname> system-view

[Sysname] vlan 100

[Sysname-vlan100] quit

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] port link-type hybrid

[Sysname-GigabitEthernet3/0/1] port hybrid pvid vlan 100

# Configure VLAN 100 as the PVID of the hybrid Layer 2 aggregate interface Bridge-Aggregation 1.

<Sysname> system-view

[Sysname] interface bridge-aggregation 1

[Sysname-Bridge-Aggregation1] port link-type hybrid

[Sysname-Bridge-Aggregation1] port hybrid pvid vlan 100

port hybrid vlan

Syntax

port hybrid vlan vlan-id-list { tagged | untagged }

undo port hybrid vlan vlan-id-list

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

vlan-id-list: Specifies a list of VLANs in the format of [ vlan-id1 [ to vlan-id2 ] ]&<1-10>, where vlan-id ranges from 1 to 4094 and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges. Make sure that the specified VLANs already exist.

tagged: Configures the ports to send packets of the specified VLANs without removing VLAN tags.

untagged: Configures the ports to send packets of the specified VLANs after removing VLAN tags.

Description

Use the port hybrid vlan command to assign the hybrid ports to the specified VLANs.

Use the undo port hybrid vlan command to remove the hybrid ports from the specified VLANs.

By default, a hybrid port only allows packets from VLAN 1 to pass through untagged.

A hybrid port can carry multiple VLANs. If you execute the port hybrid vlan command multiple times, the hybrid port carries the set of VLANs specified by vlan-id-list in each execution.

In Ethernet interface view, this command applies only to the port. In port group view, this command applies to all ports in the port group. For more information about port groups, see Interface Configuration Guide. In Layer 2 aggregate interface view, this command applies to the aggregate interface and its member ports. If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to the aggregation member ports. If the system fails to apply the configuration to an aggregation member port, it skips the port and moves to the next member port. For more information about Layer 2 aggregate interfaces, see Layer 2—LAN Switching Configuration Guide.

Related commands: port link-type.

Examples

# Assign the hybrid port GigabitEthernet 3/0/1 to VLAN 2, VLAN 4, and VLAN 50 through VLAN 100, and configure GigabitEthernet 3/0/1 to send packets of these VLANs tagged.

<Sysname> system-view

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] port link-type hybrid

[Sysname-GigabitEthernet3/0/1] port hybrid vlan 2 4 50 to 100 tagged

# Assign hybrid ports in port group 2 to VLAN 2, and configure these hybrid ports to send packets of VLAN 2 untagged.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] quit

[Sysname] port-group manual 2

[Sysname-port-group-manual-2] group-member gigabitethernet 3/0/1 to gigabitethernet 3/0/6

[Sysname-port-group-manual-2] port link-type hybrid

[Sysname-port-group-manual-2] port hybrid vlan 2 untagged

# Assign the hybrid Layer 2 aggregate interface Bridge-aggregation 1 and its member ports to VLAN 2, and configure them to send packets of VLAN 2 untagged.

<Sysname> system-view

[Sysname] interface bridge-aggregation 1

[Sysname-Bridge-Aggregation1] port link-type hybrid

[Sysname-Bridge-Aggregation1] port hybrid vlan 2 untagged

port link-type

Syntax

port link-type { access | hybrid | trunk }

undo port link-type

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

access: Configures the link type of a port as access.

hybrid: Configures the link type of a port as hybrid.

trunk: Configures the link type of a port as trunk.

Description

Use the port link-type command to configure the link type of a port.

Use the undo port link-type command to restore the default link type of a port.

By default, any port is an access port.

To change the link type of a port from trunk to hybrid or vice versa, you must set the link type to access.

After you change the link type of an interface with the port link-type command, the loopback detection action configured on the interface with the loopback-detection action command automatically restores the default.

In Ethernet interface view, this command applies only to the port. In port group view, this command applies to all ports in the port group. For more information about port groups, see Interface Configuration Guide. In Layer 2 aggregate interface view, this command applies to the aggregate interface and its member ports. If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to the aggregation member ports. If the system fails to do apply the configuration to an aggregation member port, it skips the port and moves to the next member port.

Examples

# Configure GigabitEthernet 3/0/1 as a trunk port.

<Sysname> system-view

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] port link-type trunk

# Configure all the ports in the manual port group group1 as hybrid ports.

<Sysname> system-view

[Sysname] port-group manual group1

[Sysname-port-group manual group1] group-member gigabitethernet 3/0/1

[Sysname-port-group manual group1] group-member gigabitethernet 3/0/2

[Sysname-port-group manual group1] port link-type hybrid

# Configure Layer 2 aggregate interface Bridge-aggregation 1 and its member ports as hybrid ports.

<Sysname> system-view

[Sysname] interface bridge-aggregation 1

[Sysname-Bridge-Aggregation1] port link-type hybrid

port trunk permit vlan

Syntax

port trunk permit vlan { vlan-id-list | all }

undo port trunk permit vlan { vlan-id-list | all }

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

vlan-id-list: Specifies a list of VLANs in the format of [vlan-id1 [ to vlan-id2 ] ]&<1-10>, where vlan-id ranges from 1 to 4094 and &<1-10> indicates that you can specify up to 10 VLAN IDs or VLAN ID ranges.

all: Permits all VLANs to pass through the trunk ports. On GVRP-enabled trunk ports, you must configure the port trunk permit vlan all command to make sure that the traffic of all dynamically registered VLANs can pass through. To prevent unauthorized VLAN users from accessing restricted resources through a GVRP-disabled port, do not use the port trunk permit vlan all command on the port.

Description

Use the port trunk permit vlan command to assign the trunk ports to the specified VLANs.

Use the undo port trunk permit vlan command to remove the trunk ports from the specified VLANs.

By default, a trunk port allows only packets from VLAN 1 to pass through.

A trunk port can carry multiple VLANs. If you execute the port trunk permit vlan command multiple times, the trunk port carries the set of VLANs specified by vlan-id-list in each execution.

The port trunk permit vlan all command can be ineffective to super VLANs or voice VLANs. If you are prompted with a configuration error message when using this command, use the display this command to view the execution result.

On a trunk port, only traffic of the PVID can pass through untagged.

In Ethernet interface view, this command applies only to the port. In port group view, this command applies to all ports in the port group. In Layer 2 aggregate interface view, this command applies to the Layer 2 aggregate interface and all its member ports. If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to the aggregation member ports. If the system fails to apply the configuration to an aggregation member port, it skips the port and moves to the next member port.

Related commands: port link-type.

Examples

# Assign the trunk port GigabitEthernet 3/0/1 to VLAN 2, VLAN 4, and VLAN 50 through VLAN 100.

<Sysname> system-view

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] port link-type trunk

[Sysname-GigabitEthernet3/0/1] port trunk permit vlan 2 4 50 to 100

port trunk pvid

Syntax

port trunk pvid vlan vlan-id

undo port trunk pvid

View

Ethernet interface view, port group view, Layer 2 aggregate interface view

Default level

2: System level

Parameters

vlan-id: Specifies a VLAN ID, ranging from 1 to 4094

Description

Use the port trunk pvid command to configure the PVID for the trunk port.

Use the undo port trunk pvid command to restore the default.

By default, the PVID of a trunk port is VLAN 1.

You can use a nonexistent VLAN as the PVID for a trunk port. If you remove the PVID of a trunk port with the undo vlan command, it does not affect the setting of the PVID on the port.

To ensure correct packet transmission, configure the same PVID for the local trunk port and the remote trunk port.

You must use the port trunk permit vlan command to configure the trunk port to allow and forward packets from the PVID.

In Ethernet interface view, this command applies only to the port. In port group view, this command applies to all ports in the port group. In Layer 2 aggregate interface view, this command applies to the aggregate interface and its member ports. If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to the aggregation member ports. If the system fails to apply the configuration to an aggregation member port, it skips the port and moves to the next member port.

Related commands: port link-type and port trunk permit vlan.

Examples

# Configure VLAN 100 as the PVID of the trunk port GigabitEthernet 3/0/1.

<Sysname> system-view

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] port link-type trunk

[Sysname-GigabitEthernet3/0/1] port trunk pvid vlan 100

# Configure VLAN 100 as the PVID of Layer 2 aggregate interface Bridge-Aggregation 1.

<Sysname> system-view

[Sysname] interface bridge-aggregation 1

[Sysname-Bridge-Aggregation1] port link-type trunk

[Sysname-Bridge-Aggregation1] port trunk pvid vlan 100

MAC address-based VLAN configuration commands

display mac-vlan

Syntax

display mac-vlan { all | dynamic | mac-address mac-address | static | vlan vlan-id } [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

all: Displays all the MAC address-to-VLAN entries.

dynamic: Displays dynamically configured MAC address-to-VLAN entries.

mac-address mac-address: Displays the MAC address-to-VLAN entry containing the specified MAC address.

static: Displays the statically configured MAC address-to-VLAN entries.

vlan vlan-id: Displays the MAC address-to-VLAN entries associated with the specified VLAN.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display mac-vlan command to display the specified MAC address-to-VLAN entries.

Examples

# Display all the MAC address-to-VLAN entries.

<Sysname> display mac-vlan all

  The following MAC VLAN addresses exist:

  S:Static  D:Dynamic

  MAC ADDR         MASK             VLAN ID   PRIO   STATE

  --------------------------------------------------------

  00e0-4c90-4880   ffff-ffff-ffff   9         0      S

 

  Total MAC VLAN address count:1

Table 4 Output description

Field

Description

S: Static

The character S stands for the MAC address-to-VLAN entries that are configured statically.

D: Dynamic

The character D stands for the MAC address-to-VLAN entries that are configured dynamically.

MAC ADDR

MAC address of a MAC address-to-VLAN entry.

MASK

Mask of the MAC address of a MAC address-to-VLAN entry.

VLAN ID

VLAN ID of a MAC address-to-VLAN entry.

PRIO

802.1p priority corresponding to the MAC address of a MAC address-to-VLAN entry.

STATE

The state of a MAC address-to-VLAN entry:

·       SIndicating that the MAC address-to-VLAN entry is configured statically.

·       DIndicating that the MAC address-to-VLAN entry is configured automatically through the authentication server

·       S&DIndicating that the MAC address-to-VLAN entry is configured both statically and dynamically

 

display mac-vlan interface

Syntax

display mac-vlan interface [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display mac-vlan interface command to display all the ports with MAC-based VLAN enabled.

Related commands: mac-vlan enable.

Examples

# Display all the interfaces with MAC-based VLAN enabled.

<Sysname> display mac-vlan interface

MAC VLAN is enabled on following ports:

---------------------------------------

GigabitEthernet3/0/1  GigabitEthernet3/0/2

mac-vlan enable

Syntax

mac-vlan enable

undo mac-vlan enable

View

Layer 2 Ethernet port view

Default level

2: System level

Parameters

None

Description

Use the mac-vlan enable command to enable MAC-based VLAN on a port.

Use the undo mac-vlan enable command to disable MAC-based VLAN on a port.

By default, MAC-based VLAN is disabled on a port.

Examples

# Enable MAC-based VLAN on GigabitEthernet 3/0/1.

<Sysname> system-view

[Sysname] interface GigabitEthernet3/0/1

[Sysname–GigabitEthernet3/0/1] mac-vlan enable

mac-vlan mac-address

Syntax

mac-vlan mac-address mac-address vlan vlan-id [ priority pri ]

undo mac-vlan { all | mac-address mac-address | vlan vlan-id }

View

System view

Default level

2: System level

Parameters

mac-address mac-address: Specifies a MAC address.

vlan vlan-id: Specifies a VLAN ID, ranging from 1 to 4094.

priority pri: Specifies the 802.1p priority value corresponding to the specified MAC address. The value ranges from 0 to 7, and the default value is 0.

 

 

NOTE:

You can use this command to configure the 802.1p priorities, but they will not take effect. Packets are forwarded based on the default priorities of MAC addresses.

 

all: Removes all the static MAC address-to-VLAN entries.

Description

Use the mac-vlan mac-address command to associate the specified VLAN and priority value with the specified MAC addresses.

Use the undo mac-vlan command to remove the association.

Examples

# Associate a single MAC address 0-1-1 with VLAN 100 and 802.1p priority 7.

<Sysname> system-view

[Sysname] mac-vlan mac-address 0-1-1 vlan 100 priority 7

Protocol-based VLAN configuration commands

display protocol-vlan interface

Syntax

display protocol-vlan interface { interface-type interface-number1 [ to interface-type interface-number2 ] | all } [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

2: System level

Parameters

interface-type interface-number1: Specifies an interface by its type and number.

interface-type interface-number1 to interface-type interface-number2: Specifies an interface range.

all: Displays information about protocol-based VLANs on all ports.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display protocol-vlan interface command to display information about protocol-based VLANs for the specified ports.

Examples

# Display protocol-based VLAN information on GigabitEthernet 3/0/1.

<Sysname> display protocol-vlan interface gigabitEthernet3/0/1

 Interface: GigabitEthernet3/0/1

   VLAN ID   Protocol Index      Protocol Type

 ======================================================

       2          0               at

       3          0               ipv4

Table 5 Output description

Field

Description

Interface

Interface of which you want to view the information.

VLAN ID

ID of the protocol-based VLAN bound with the port.

Protocol Index

Protocol template index.

Protocol Type

Protocol type specified by the protocol template.

 

display protocol-vlan vlan

Syntax

display protocol-vlan vlan { vlan-id1 [ to vlan-id2 ] | all } [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

2: System level

Parameters

vlan-id1: Specifies a protocol-based VLAN ID, ranging from 1 to 4094.

vlan-id1 to vlan-id2: Displays protocol-based VLAN information of a VLAN range from vlan-id1 to vlan-id2. The vlan-id2 argument specifies a protocol-based VLAN ID ranging from 1 to 4094, but you must make sure that its value is greater than or equal to that of vlan-id1.

all: Displays information about all protocol-based VLANs.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display protocol-vlan vlan command to display the protocols and protocol indexes configured on the specified VLANs.

Related commands: display vlan.

Examples

# Display the protocols and protocol indexes configured on all protocol-based-VLANs.

<Sysname> display protocol-vlan vlan all

 VLAN ID:2

    Protocol Index      Protocol Type

 ======================================================

          0              ipv4

          3              at

 VLAN ID:3

    Protocol Index      Protocol Type

 ======================================================

          0              ipv4

          1              ipx snap

For more information about the command output fields, see Table 5.

port hybrid protocol-vlan

Syntax

port hybrid protocol-vlan vlan vlan-id { protocol-index [ to protocol-end ] | all }

undo port hybrid protocol-vlan { vlan vlan-id { protocol-index [ to protocol-end ] | all } | all }

View

Ethernet interface view, port group view, Layer 2 aggregate interface view, Layer 2 VE interface view

Default level

2: System level

Parameters

vlan vlan-id: Specifies a VLAN ID, ranging from 1 to 4094.

protocol-index: Protocol index, specified by the users or assigned by the system automatically when the protocol-based VLAN is created. The value ranges from 0 to 11. You can use the display protocol-vlan vlan all command to display the protocol indexes.

to protocol-end: Specifies the end protocol index. The protocol-end argument must be greater than or equal to the beginning protocol index.

all: Specifies all protocols bound with vlan-id.

Description

Use the port hybrid protocol-vlan command to associate the hybrid ports with a protocol-based VLAN.

Use the undo port hybrid protocol-vlan command to remove the association.

Before issuing this command, make sure that you have made the following configurations:

·           Create a VLAN and associate it with specified protocols.

·           Configure the link type as hybrid.

·           Configure the port to allow the protocol-based VLAN to pass through.

In Ethernet interface view, this command applies only to the port. In port group view, this command applies to all ports in the port group. For more information about port groups, see Interface Configuration Guide. In Layer 2 aggregate interface view, this command applies to the Layer 2 aggregate interface and all its member ports. After you perform the configuration, the system starts applying the configuration to the aggregate interface and its aggregation member ports. If the system fails to do that on the aggregate interface, it stops applying the configuration to the aggregation member ports. If it fails to do that on an aggregation member port, it simply skips the port and moves to the next port.

Related commands: display protocol-vlan interface.

Examples

# Associate the hybrid port GigabitEthernet3/0/1 with protocol 0 (AppleTalk) in VLAN 2.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] protocol-vlan at

[Sysname-vlan2] quit

[Sysname] interface GigabitEthernet3/0/1

[Sysname-GigabitEthernet3/0/1] port link-type hybrid

[Sysname-GigabitEthernet3/0/1] port hybrid vlan 2 untagged

 Please wait... Done

[Sysname-GigabitEthernet3/0/1] port hybrid protocol-vlan vlan 2 0

# Associate the hybrid Layer 2 aggregate interface Bridge-aggregation 1 with protocol 0 in VLAN 2, assuming that Bridge-aggregation 1 does not have member ports.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] protocol-vlan at

[Sysname-vlan2] quit

[Sysname] interface bridge-aggregation 1

[Sysname-Bridge-Aggregation1] port link-type hybrid

[Sysname-Bridge-Aggregation1] port hybrid vlan 2 untagged

 Please wait... Done

[Sysname-Bridge-Aggregation1] port hybrid protocol-vlan vlan 2 0

# Associate the hybrid Layer 2 aggregate interface Bridge-aggregation 1 with protocol 0 in VLAN 2. Among the member ports of the aggregation group corresponding to Bridge-aggregation 1, GigabitEthernet6/0/2 is an access port and GigabitEthernet6/0/3 is a trunk port.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] protocol-vlan at

[Sysname-vlan2] quit

[Sysname] interface bridge-aggregation 1

[Sysname-Bridge-Aggregation1] port link-type access

 Please wait... Done.

 Configuring GigabitEthernet6/0/2... Done.

 Configuring GigabitEthernet6/0/3... Done.

[Sysname-Bridge-Aggregation1] port link-type hybrid

[Sysname-Bridge-Aggregation1] port hybrid vlan 2 untagged

 Please wait... Done.

 Configuring GigabitEthernet6/0/2... Done.

 Configuring GigabitEthernet6/0/3... Done.

[Sysname-Bridge-Aggregation1] port hybrid protocol-vlan vlan 2 0

protocol-vlan

Syntax

protocol-vlan [ protocol-index ] { at | ipv4 | ipv6 | ipx { ethernetii | llc | raw | snap } | mode { ethernetii etype etype-id | llc { dsap dsap-id [ ssap ssap-id ] | ssap ssap-id } | snap etype etype-id } }

undo protocol-vlan { protocol-index [ to protocol-end ] | all }

View

VLAN view

Default level

2: System level

Parameters

at: Specifies the AppleTalk based VLAN.

ipv4: Specifies the IPv4 based VLAN.

ipv6: Specifies the IPv6 based VLAN.

ipx: Specifies the IPX based VLAN. The keywords ethernetii, llc, raw, and snap are encapsulation formats for IPX.

mode: Configures a user-defined protocol template for the VLAN, which could also have four encapsulation formats, namely, ethernetii, llc, raw, and snap.

ethernetii etype etype-id: Matches Ethernet II encapsulation format and the corresponding protocol type values. The etype-id argument is the protocol type ID of inbound packets, which ranges from 0x0600 to 0xffff (excluding 0x0800, 0x809b, 0x8137, and 0x86dd).

llc: Matches the llc encapsulation format.

dsap dsap-id: Specifies the destination service access point, which ranges from 00 to 0xff.

ssap ssap-id: Specifies the source service access point, which ranges from 00 to 0xff.

snap etype etype-id: Matches SNAP encapsulation format and the corresponding protocol type values. The etype-id argument is the Ethernet type of inbound packets, which ranges from 0x0600 to 0xffff (excluding ipx snap under the snap encapsulation format).

protocol-index: Protocol index, which specifies the protocol template to be bound with the VLAN. The system will automatically assign an index if this parameter is not specified.

to protocol-end: Specifies the end protocol index. The protocol-end argument must be greater than or equal to the protocol-index argument.

all: Specifies to remove all the protocols bound with the VLAN.

Description

Use the protocol-vlan command to configure the VLAN as a protocol-based VLAN and configure the protocol template for the VLAN.

Use the undo protocol-vlan command to remove the configured protocol template.

By default, no VLAN is bound with any protocol template.

When you use the mode keyword to configure a user-defined protocol template, do not set etype-id in ethernetii etype etype-id to 0x0800, 0x809B, 0x8137, or 0x86DD. Otherwise, the encapsulation format of the matching packets will be the same as that of the IPv4, AppleTalk, IPX, and IPv6 packets respectively.

Do not configure both the dsap-id and ssap-id arguments in the protocol-vlan command as 0xE0 or 0xFF when you configure the user-defined template for llc encapsulation. Otherwise, the encapsulation format of the matching packets will be the same as that of the ipx llc or ipx raw packets respectively. When either of the dsap-id and ssap-id arguments is configured, the system assigns 0XAA to the other argument.

When you use the mode keyword to configure a user-defined protocol template, do not set etype-id in snap etype etype-id to 0x8137. Otherwise, the template format will be the same as that of the IPX protocol. You can set etype-id to 0x0800, 0x809B, or 0x86DD, corresponding to IPv4, AppleTalk, and IPv6 respectively.

Related commands: display protocol-vlan vlan.

Examples

# Configure VLAN 3 as an IPv4-based VLAN.

<Sysname> system-view

[Sysname] vlan 3

[Sysname-vlan3] protocol-vlan ipv4

 

CAUTION

CAUTION:

IP uses ARP for address resolution in Ethernet. To prevent communication failure, configure the IP and ARP templates in the same VLAN and associate them with the same port.

 

# Create an ARP protocol template for VLAN 3 (ARP code is 0x0806) to make VLAN 3 transmit ARP packets.

·           To use Ethernet encapsulation, use the command:

[Sysname-vlan3] protocol-vlan mode ethernetii etype 0806

·           To use 802.3 encapsulation, use the command:

[Sysname-vlan3] protocol-vlan mode snap etype 0806


display supervlan

Syntax

display supervlan [ supervlan-id ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

supervlan-id: Specifies a super VLAN ID, ranging from 1 to 4094.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display supervlan command to display the mapping between a super VLAN and sub-VLANs, and to display information about these VLANs.

Related commands: supervlan and subvlan.

Examples

# Display the mapping between a super VLAN and sub-VLANs.

<Sysname> display supervlan 2

 Supervlan ID :  2

 Subvlan ID :  3-5

 

 VLAN ID: 2

 VLAN Type: static

 It is a Super VLAN.

 Route Interface: configured

 IP Address: 10.153.17.41

 Subnet Mask: 255.255.252.0

 Description: VLAN 0002

 Name: VLAN 0002

 Tagged   Ports: none

 Untagged Ports: none

 

 VLAN ID: 3

 VLAN Type: static

 It is a Sub VLAN.

 Route Interface: configured

 IP Address: 10.153.17.41

 Subnet Mask: 255.255.252.0

 Description: VLAN 0003

 Name: VLAN 0003

 Tagged   Ports: none

 Untagged Ports:

             GigabitEthernet3/0/3

 

 VLAN ID: 4

 VLAN Type: static

 It is a Sub VLAN.

 Route Interface: configured

 IP Address: 10.153.17.41

 Subnet Mask: 255.255.252.0

 Description: VLAN 0004

 Tagged   Ports: none

 Name: VLAN 0004

 Untagged Ports:

             GigabitEthernet3/0/4

 

 VLAN ID: 5

 VLAN Type: static

 It is a Sub VLAN.

 Route Interface: configured

 IP Address: 10.153.17.41

 Subnet Mask: 255.255.252.0

 Description: VLAN 0005

 Name: VLAN 0005

 Tagged   Ports: none

 Untagged Ports:

             GigabitEthernet3/0/5

Table 6 Output description

Field

Description

VLAN Type

VLAN type, static or dynamic.

Route Interface

Indicates whether a VLAN interface is configured or not for the sub-VLAN or super VLAN.

IP Address

The IP address of the VLAN interface configured for a sub-VLAN or super VLAN.

Subnet Mask

The subnet mask of the VLAN interface configured for a sub-VLAN or super VLAN.

Tagged   Ports

Ports through which VLAN packets are sent tagged.

Untagged Ports

Ports through which VLAN packets are sent untagged.

 

subvlan

Syntax

subvlan vlan-list

undo subvlan [ vlan-list ]

View

VLAN view

Default level

2: System level

Parameters

vlan-list: Specifies a sub-VLAN list, in the format of vlan-list = { vlan-id [ to vlan-id2 }&<1-10>, where vlan-id represents the sub-VLAN ID and ranges from 1 to 4094 and &<1-10> indicates that you can specify up to 10 sub-VLAN IDs or sub-VLAN ID ranges.

Description

Use the subvlan command to associate the super VLAN with sub-VLANs specified by vlan-list.

Use the undo subvlan command to remove the association.

Make sure that the sub-VLANs already exist before associating them with a super VLAN.

You can add/remove a port to/from a sub-VLAN already associated with a super VLAN.

·           If you use the undo subvlan command without vlan-list specified, you will remove the association between the specified super VLAN and all its sub-VLANs.

·           If you use the undo subvlan command with vlan-list specified, you will remove only the association between the super VLAN and the sub-VLANs specified by vlan-list.

You cannot create a VLAN interface for a sub-VLAN.

Related commands: display supervlan.

Examples

# Associate VLAN 10 (the super VLAN) with VLAN 3, VLAN 4, VLAN 5, and VLAN 9 (the sub-VLANs).

<Sysname> system-view

[Sysname] vlan 10

[Sysname-vlan10] subvlan 3 to 5 9

supervlan

Syntax

supervlan

undo supervlan

View

VLAN view

Default level

2: System level

Parameters

None

Description

Use the supervlan command to configure the VLAN as a super VLAN.

Use the undo supervlan command to remove the super VLAN configuration for the VLAN.

Related commands: display supervlan.

Examples

# Configure VLAN 2 as a super VLAN.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] supervlan


Voice VLAN configuration commands

display voice vlan oui

Syntax

display voice vlan oui [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display voice vlan oui command to display the supported organizationally unique identifier (OUI) addresses, the OUI address masks, and the description strings.

Related commands: voice vlan mac-address.

 

 

NOTE:

In general, as the first 24 bits of a MAC address (in binary format), an OUI address is a globally unique identifier assigned to a vendor by IEEE. OUI addresses mentioned in this document, however, are different from those in common sense. OUI addresses in this document are used to determine whether a received packet is a voice packet. They are the results of the AND operation of the two arguments mac-address and oui-mask in the voice vlan mac-address command.

 

Examples

# Display the supported OUI addresses, and their masks and descriptions.

<Sysname> display voice vlan oui

Oui Address     Mask            Description

0001-e300-0000  ffff-ff00-0000  Siemens phone

0003-6b00-0000  ffff-ff00-0000  Cisco phone

0004-0d00-0000  ffff-ff00-0000  Avaya phone

0060-b900-0000  ffff-ff00-0000  Philips/NEC phone

00d0-1e00-0000  ffff-ff00-0000  Pingtel phone

00e0-7500-0000  ffff-ff00-0000  Polycom phone

00e0-bb00-0000  ffff-ff00-0000  3com phone 

Table 7 Output description

Field

Description

Oui Address

OUI addresses supported.

Mask

Masks of the OUI addresses supported.

Description

Description strings of the OUI addresses supported.

 

display voice vlan state

Syntax

display voice vlan state [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use the display voice vlan state command to display voice VLAN configuration.

Related commands: voice vlan enable, voice vlan qos, and voice vlan qos trust.

Examples

# Display voice VLAN configurations.

<Sysname> display voice vlan state

 Maximum of Voice VLANs: 128

 Current Voice VLANs: 2

 Voice VLAN security mode: Security

 Voice VLAN aging time: 1440 minutes

 Voice VLAN enabled port and its mode:

PORT                        VLAN       MODE        COS        DSCP

--------------------------------------------------------------------

GigabitEthernet5/0/3        2          MANUAL      4          40 

Table 8 Output description

Field

Description

Maximum of Voice VLANs

Maximum number of voice VLANs supported by the system.

Current Voice VLANs

Number of existing voice VLANs.

Voice VLAN security mode

Security mode of the voice VLAN: Security for security mode; Normal for normal mode.

Voice VLAN aging time

Aging time of the voice VLAN.

Voice VLAN enabled port and its mode

Voice VLAN-enabled port and its voice VLAN assignment mode.

PORT

Voice VLAN-enabled port name.

VLAN

ID of the voice VLAN enabled on the port.

MODE

Voice VLAN assignment mode of the port: manual or automatic.

COS

QoS priority settings of voice VLAN packets.

DSCP

 

voice vlan aging

Syntax

voice vlan aging minutes

undo voice vlan aging

View

System view

Default level

2: System level

Parameters

minutes: Sets the voice VLAN aging time, ranging from 5 to 43200 minutes.

Description

Use the voice vlan aging command to configure the voice VLAN aging time.

Use the undo voice vlan aging command to restore the default.

By default, the voice VLAN aging time is 1440 minutes.

When a port in automatic voice VLAN assignment mode receives a voice packet, the system decides whether to assign the port to the voice VLAN based on the source MAC address of the voice packet. Upon assigning the port to the voice VLAN, the system starts the aging timer. If no voice packets are received on the port until the aging time expires, the system automatically removes the port from the voice VLAN. This aging time applies only to the ports in automatic voice VLAN assignment mode.

Related commands: display voice vlan state.

Examples

# Configure the voice VLAN aging time as 100 minutes.

<Sysname> system-view

[Sysname] voice vlan aging 100

voice vlan enable

Syntax

voice vlan vlan-id enable

undo voice vlan [ vlan-id ] enable

View

Ethernet interface view

Default level

2: System level

Parameters

vlan-id: Specifies a voice VLAN, ranging from 2 to 4094.

Description

Use the voice vlan enable command to enable the voice VLAN feature and configure a VLAN as the voice VLAN for the Ethernet port.

Use the undo voice vlan enable command to disable the voice VLAN feature on an Ethernet port.

By default, the voice VLAN feature is disabled on ports.

You can enable the voice VLAN feature on a hybrid or trunk port operating in automatic voice VLAN assignment mode, but not on an access port operating in automatic voice VLAN assignment mode.

Examples

# Enable the voice VLAN feature on GigabitEthernet 3/0/1.

<Sysname> system-view

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] voice vlan 2 enable

voice vlan mac-address

Syntax

voice vlan mac-address mac-address mask oui-mask [ description text ]

undo voice vlan mac-address oui

View

System view

Default level

2: System level

Parameters

mac-address: Specifies a source MAC address of voice traffic, in the format of H-H-H. For example, 1234-1234-1234.

mask oui-mask: Specifies the valid length of the OUI address by a mask in the format of H-H-H, formed by consecutive 1s and 0s, for example, FFFF-0000-0000. To filter the voice device of a specific vendor, set the mask to FFFF-FF00-0000.

description text: Specifies a string that describes the OUI address. The string is of 1 to 30 case-sensitive characters.

oui: Specifies the OUI address you want to remove, in the format of H-H-H. For example, 1234-1200-0000. An OUI address is the logic AND result of mac-address and oui-mask. An OUI address cannot be a broadcast address, a multicast address, or an all-zero address. You can use the display voice vlan oui command to display the OUI addresses.

Description

Use the voice vlan mac-address command to allow packets carrying the specified OUI address to pass through.

Use the undo voice vlan mac-address command to prohibit packets carrying the specified OUI address from passing through.

The system supports up to 16 OUI addresses.

By default, the system is configured with the default OUI addresses, as illustrated in Table 9. You can remove the default OUI addresses and then add recognizable OUI addresses manually.

Table 9 Default OUI addresses

Number

OUI

Description

1

0001-e300-0000

Siemens phone

2

0003-6b00-0000

Cisco phone

3

0004-0d00-0000

Avaya phone

4

00d0-1e00-0000

Pingtel phone

5

0060-b900-0000

Philips/NEC phone

6

00e0-7500-0000

Polycom phone

7

00e0-bb00-0000

3com phone

 

Related commands: display voice vlan oui.

Examples

# Add a recognizable OUI address 1234-1200-0000 by specifying the MAC address as 1234-1234-1234 and the mask as fff-ff00-0000, and configure its description string as PhoneA.

<Sysname> system-view

[Sysname] voice vlan mac-address 1234-1234-1234 mask ffff-ff00-0000 description PhoneA

voice vlan mode auto

Syntax

voice vlan mode auto

undo voice vlan mode auto

View

Ethernet interface view

Default level

2: System level

Parameters

None

Description

Use the voice vlan mode auto command to configure the port to operate in automatic voice VLAN assignment mode.

Use the undo voice vlan mode auto command to configure the port to operate in manual voice VLAN assignment mode.

By default, a port operates in automatic voice VLAN assignment mode.

The voice VLAN modes of different ports are independent of one another.

To make voice VLAN take effect on a port which is enabled with voice VLAN and operates in manual voice VLAN assignment mode, you need to assign the port to the voice VLAN manually.

Examples

 # Configure GigabitEthernet 3/0/1 to operate in manual voice VLAN assignment mode.

<Sysname> system-view

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] undo voice vlan mode auto

voice vlan qos

Syntax

voice vlan qos cos-value dscp-value

undo voice vlan qos

View

Interface view

Default level

2: System level

Parameters

cos-value: Sets the CoS precedence value for voice VLAN traffic, ranging from 0 to 7. The default value is 6.

dscp-value: Sets the DSCP value for voice VLAN traffic, ranging from 0 to 63. The default value is 46.

Description

Use the voice vlan qos command to configure the interface to modify the CoS and DSCP values marked for incoming traffic of the voice VLAN into specified values.

Use the undo voice vlan qos command to restore the default.

By default, an interface modifies the CoS value and the DSCP value marked for voice VLAN traffic into 6 and 46 respectively.

Configure or modify the QoS priority settings for voice VLAN traffic on an interface before enabling voice VLAN on the interface. If the configuration order is reversed, your priority settings will fail.

The voice vlan qos command and the voice vlan qos trust command can overwrite the other. After you execute the two commands on a port multiple times, the one that was last executed takes effect.

Related commands: voice vlan qos trust.

Examples

# Configure interface GigabitEthernet 3/0/1 to modify the CoS value and the DSCP value marked for voice VLAN packets into 5 and 45 respectively.

<Sysname> system-view

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] voice vlan qos 5 45

voice vlan qos trust

Syntax

voice vlan qos trust

undo voice vlan qos

View

Interface view

Default level

2: System level

Parameters

None

Description

Use the voice vlan qos trust command to configure the interface to trust the priority settings carried in incoming voice traffic. With this command configured, an interface keeps the CoS and DSCP values marked for incoming voice traffic unchanged.

Use the undo voice vlan qos command to restore the default.

By default, an interface modifies the CoS value and the DSCP value marked for voice VLAN traffic into 6 and 46 respectively.

Configure or modify the QoS priority trust mode for voice VLAN traffic on an interface before enabling voice VLAN on the interface. If the configuration order is reversed, your priority trust setting will fail.

The voice vlan qos command and the voice vlan qos trust command can overwrite the other. After you execute the two commands on a port multiple times, the one that was last executed takes effect.

Related commands: voice vlan qos.

Examples

# Configure interface GigabitEthernet 3/0/1 to trust the priority settings carried in incoming voice VLAN traffic.

<Sysname> system-view

[Sysname] interface gigabitethernet 3/0/1

[Sysname-GigabitEthernet3/0/1] voice vlan qos trust

voice vlan security enable

Syntax

voice vlan security enable

undo voice vlan security enable

View

System view

Default level

2: System level

Parameters

None

Description

Use the voice vlan security enable command to enable voice VLAN security mode.

Use the undo voice vlan security enable command to disable voice VLAN security mode.

By default, voice VLAN security mode is enabled.

After you enable the security mode for a voice VLAN, only voice traffic can be transmitted in the voice VLAN. The switch matches the source MAC addresses of the packets against the supported OUI addresses to determine whether they are voice traffic and filters all non-voice traffic, guaranteeing high priority and high quality for voice traffic. On the other hand, when a voice VLAN operates in common mode, other data traffic is also allowed to be transmitted in the voice VLAN.

Examples

# Disable voice VLAN security mode.

<Sysname> system-view

[Sysname] undo voice vlan security enable

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网