03-Layer 2 Command Reference

HomeSupportReference GuidesCommand ReferencesH3C WX Series Access Controllers Command References(R3308 R2308)-6W10703-Layer 2 Command Reference
03-VLAN Commands
Title Size Download
03-VLAN Commands 152.75 KB

VLAN configuration commands

default

Syntax

default

View

VLAN interface view

Default level

2: System level

Parameters

None

Description

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

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 English letters (A to Z, a to z), digits (0 to 9), special English characters, 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 device 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 description to change the description of the current VLAN or VLAN interface.

Use undo description 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-interface1 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 device.

Examples

# Change the description of VLAN 2 to sales-private.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] description sales-private

# Change the description of VLAN-interface 2 to 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 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 display interface vlan-interface 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 do not specify the VLAN interface number, this command displays information about all VLAN interfaces.

Related commands: reset counters interface vlan-interface.

Examples

# Display information for VLAN-interface 2.

<Sysname> display interface vlan-interface 2

Vlan-interface2 current state: DOWN

Line protocol current state: DOWN

Description: Vlan-interface2 Interface

The Maximum Transmit Unit is 1500

Internet protocol processing : disabled

IP Packet Frame Type: PKTFMT_ETHNT_2,  Hardware Address: 000f-e249-8050

IPv6 Packet Frame Type: PKTFMT_ETHNT_2,  Hardware Address: 000f-e249-8050

Last clearing of counters:  Never

# 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 Command output

Field

Description

Vlan-interface2 current state

The physical state of a VLAN interface:

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

·     DOWN—The administrative sate of the VLAN interface is up, but its physical sate is down. The VLAN corresponding to this interface does not contain any physical port in 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 a VLAN interface:

·     DOWN—The protocol state of this VLAN interface is down.

·     UP—The protocol state of this VLAN interface is up.

Description

The description string of a VLAN interface.

The Maximum Transmit Unit

The MTU of a VLAN interface.

Internet protocol processing : disabled

The current interface is not capable of processing IP packets. This information is displayed when the interface is not configured with an IP address.

Internet Address is 192.168.1.54/24 Primary

The primary IP address of the interface is 192.168.1.54/24. This information is displayed only if the primary IP address is configured for the interface.

Internet Address is 6.4.4.4/24 Sub

The secondary IP address of the interface is 6.4.4.4/24. This information is displayed only if a secondary IP address is configured for the interface.

IP Packet Frame Type

The IPv4 outgoing frame format.

Hardware address

The MAC address corresponding to a VLAN interface.

IPv6 Packet Frame Type

The IPv6 outgoing frame format.

Last clearing of counters

The 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 current interface since the device's startup.

The brief information of interface(s) under route mode

Brief information about Layer 3 interfaces.

Link: ADM - administratively down; Stby - standby

The link layer state of the interface:

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

·     Stby—The interface is operating as a standby interface. To see the main interface, use the display standby state command.

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, which can be 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 mac-vlan

Syntax

display mac-vlan { all | dynamic | mac-address mac-address [ mask mac-mask ] | 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.

mask mac-mask: Displays the MAC address-to-VLAN entries with their MAC addresses in the specified range.

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 display mac-vlan to display the specified MAC address-to-VLAN entries.

If mac-address mac-addr is specified but mask is not specified, only the MAC address-to-VLAN entry containing the specified MAC address is displayed.

Examples

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

<Sysname> display mac-vlan all

The following MAC-VLAN address exist:

S: Static   D: Dynamic

MAC ADDR           MASK                    VLAN ID   PRIO    STATE

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

0008-0001-0000     FFFF-FF00-0000          5         3       S

0002-0001-0000     FFFF-FFFF-FFFF          5         3       S&D

 

Total MAC VLAN address count:2

Table 2 Command output

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:

·     S—The MAC address-to-VLAN entry is configured statically.

·     D—The MAC address-to-VLAN entry is configured automatically through the authentication server.

·     S&D—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 display mac-vlan interface 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:

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

GigabitEthernet1/0/1  GigabitEthernet1/0/2  GigabitEthernet1/0/3

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 display port to display information about the hybrid or trunk ports on the device, including the port names, port VLAN IDs (PVIDs), and allowed VLAN IDs.

Examples

# Display information about the hybrid ports in the system.

<Sysname> display port hybrid

Interface            PVID  VLAN passing

GE1/0/2              1     Tagged:  2, 4

                           Untagged:1

# Display information about the trunk ports in the system.

<Sysname> display port trunk

Interface            PVID  VLAN passing

GE1/0/1              1     1-3

Table 3 Command output

Field

Description

Interface

Port name.

PVID

Port VLAN ID of the port.

VLAN passing

VLANs from which packets are allowed to pass through the port.

Tagged

VLANs from which tagged packets are required to pass through the port.

Untagged

VLANs from which untagged packets are required to pass through the port.

 

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 the information of a VLAN specified by VLAN ID, ranging from 1 to 4094.

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

all: Displays all current VLAN information except for the reserved VLANs.

dynamic: Displays the number of dynamic VLANs and the ID of each dynamic VLAN. The dynamic VLANs are generated through GVRP or those distributed by a RADIUS server.

reserved: Displays information of the reserved VLANs. Protocol modules determine which VLANs are reserved VLANs according to function implementation, and reserved VLANs serve protocol modules. You cannot do any configuration on reserved VLANs.

static: Displays the number of static VLANs and the ID of each static VLAN. The static VLANs are 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 display vlan to display VLAN information.

Related commands: vlan.

Examples

# Display VLAN 2 information.

<Sysname> display vlan 2

VLAN ID: 2

 VLAN Type: static

 Route interface: not configured

 IP Address: 1.1.1.1

 Subnet Mask: 255.255.255.0

 Description: VLAN 0002

 Name: VLAN 0002

 Tagged   Ports: none

 Untagged Ports: 

    GigabitEthernet1/0/1  GigabitEthernet1/0/2  GigabitEthernet1/0/3

Table 4 Command output

Field

Description

VLAN Type

VLAN type, static or dynamic.

Route interface

Indicates whether a VLAN interface is configured for the VLAN (not configured or configured).

IP Address

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

Subnet Mask

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

Description

Description of the VLAN.

Name

Name configured for the VLAN.

Tagged Ports

Ports through which packets of the VLAN are sent tagged.

Untagged Ports

Ports through which packets of the VLAN 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. Support for the maximum number of VLANs varies with your device models. For more information, see About the WX Series Access Controllers Command References.

Description

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

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

You must create the VLAN before you create the VLAN interface.

To configure an IP address for a VLAN interface to perform IP routing, use the ip address command in VLAN interface view.

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 notation.

mask: Specifies a subnet mask in dotted decimal notation.

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

sub: Indicates the address is a secondary IP address.

Description

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

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

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

Related commands: display ip interface (Layer 3 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

mac-vlan enable

Syntax

mac-vlan enable

undo mac-vlan enable

View

WLAN-ESS interface view, Layer 2 Ethernet port view

Default level

2: System level

Parameters

None

Description

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

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

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

Examples

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

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

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

mac-vlan mac-address

Syntax

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

undo mac-vlan { all | mac-address mac-address [ mask mac-mask ] | vlan vlan-id }

View

System view

Default level

2: System level

Parameters

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

mask mac-mask: Specifies a mask for the MAC address in the format of H-H-H. The mac-mask argument is comprised of the high-order part (all the binary bits of which are 1s) and the low-order part (all the binary bits of which are 0s). By default, the hexadecimal digits of this argument are all Fs.

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

priority pri: Specifies the 802.1p priority value corresponding to the specified MAC address. The pri argument ranges from 0 to 7.

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

Description

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

Use undo mac-vlan to remove the association.

Two MAC address-to-VLAN entry tables exist in a device. One table contains the MAC address-to-VLAN entries configured with the mask keyword specified. A MAC address-to-VLAN entry of this type describes the relationship between a group of MAC addresses and a VLAN, and a priority value. Another table contains the MAC address-to-VLAN entries configured without the mask keyword specified. A MAC address-to-VLAN entry of this type describes the relationship between a single MAC address and a VLAN, and a priority value. The system adds/removes MAC address-to-VLAN entries to/from the two tables according to the configuration.

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

# Associate the MAC addresses with the high-order six hexadecimal digits being 111122 with VLAN 100 and 802.1p priority 4.

<Sysname> system-view

[Sysname] mac-vlan mac-address 1111-2222-3333 mask ffff-ff00-0000 vlan 100 priority 4

mtu

Syntax

mtu size

undo mtu

View

VLAN interface view

Default level

2: System level

Parameters

size: Sets the maximum transmission unit (MTU). The value range for this argument may vary depending on your device model. For more information, see About the WX Series Access Controllers Command References.

Description

Use mtu to set the MTU for a VLAN interface.

Use undo mtu 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. Spaces and special characters can be included in the name.

Description

Use name to configure a name for the current VLAN.

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

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

When 802.1X or MAC address authentication is configured on a switch, you can use a RADIUS server to issue VLAN configuration to ports that have passed the authentication. Some servers can send IDs or names of the issued VLANs to the switch. When there are a large number of VLANs, you can use VLAN names rather than VLAN IDs to better locate VLANs.

Examples

# Configure the name of VLAN 2 as Test VLAN.

<Sysname> system-view

[Sysname] vlan 2

[Sysname-vlan2] name Test VLAN

port

Syntax

port interface-list

undo port interface-list

View

VLAN view

Default level

2: System level

Parameters

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

Description

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

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

By default, all ports are in VLAN 1.

This command is only applicable on access ports.

All ports are access ports by default. However, you can manually configure the port type. For more information, see "port link-type."

You cannot assign a Layer 2 aggregate interface to the current VLAN.

Related commands: display vlan.

Examples

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

<Sysname> system-view

[Sysname] vlan 2

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

port access vlan

Syntax

port access vlan vlan-id

undo port access vlan

View

WLAN-ESS interface 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 port access vlan to assign the current access ports to the specified VLAN.

Use undo port access vlan to restore the default.

By default, all access ports belong to VLAN 1.

The configuration made in WLAN-ESS or Ethernet interface view applies only to the port.

The configuration made in port group view applies to all ports in the port group.

The configuration made in Layer 2 aggregate interface view applies to the aggregate interface and its aggregation member ports.

·     If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to 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.

Examples

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

<Sysname> system-view

[Sysname] vlan 3

[Sysname-vlan3] quit

[Sysname] interface gigabitethernet 1/0/1

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

# Assign Layer 2 aggregate interface Bridge-aggregation 1 and its member ports to VLAN 3.

<Sysname> system-view

[Sysname] vlan 3

[Sysname-vlan3] quit

[Sysname] interface bridge-aggregation 1

[Sysname-Bridge-Aggregation1] port access vlan 3

port hybrid pvid

Syntax

port hybrid pvid vlan vlan-id

undo port hybrid pvid

View

WLAN-ESS interface 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 port hybrid pvid to configure the port VLAN ID (PVID) of the hybrid port.

Use undo port hybrid pvid 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. Removing the PVID of a hybrid port with the undo vlan command does not affect the setting of the PVID on the port.

The configuration made in WLAN-ESS or Ethernet interface view applies only to the port.

The configuration made in port group view applies to all ports in the port group.

The configuration made in Layer 2 aggregate interface view applies to the aggregate interface and its aggregation member ports.

·     If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to 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.

H3C recommends that you set the same PVID for the local and remote hybrid ports.

After configuring the PVID for a hybrid port, you must use the port hybrid vlan command to configure the hybrid port to allow packets from the PVID to pass through, so that the port can 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 1/0/1.

<Sysname> system-view

[Sysname] vlan 100

[Sysname-vlan100] quit

[Sysname] interface gigabitethernet 1/0/1

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

[Sysname-GigabitEthernet1/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

WLAN-ESS interface 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 that the hybrid ports will be assigned to, 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 the packets of the specified VLANs with the tags kept.

untagged: Configures the port to send the packets of the specified VLANs with the tags removed.

Description

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

Use undo port hybrid vlan to remove the current 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 VLANs the hybrid port carries are the set of VLANs specified by vlan-id-list in each execution.

The configuration made in WLAN-ESS or Ethernet interface view applies only to the port.

The configuration made in port group view applies to all ports in the port group.

The configuration made in Layer 2 aggregate interface view applies to the aggregate interface and its aggregation member ports.

·     If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to 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 hybrid port GigabitEthernet 1/0/1 to VLAN 2, VLAN 4, and VLAN 50 through VLAN 100, and configure GigabitEthernet 1/0/1 to send packets of these VLANs with tags kept.

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

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

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

port link-type

Syntax

port link-type { access | hybrid | trunk }

undo port link-type

View

WLAN-ESS interface 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 port link-type to configure the link type of a port.

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

By default, any port is an access port.

The configuration made in WLAN-ESS or Ethernet interface view applies only to the port.

The configuration made in port group view applies to all ports in the port group.

The configuration made in Layer 2 aggregate interface view applies to the aggregate interface and its aggregation member ports.

·     If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to 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.

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

Examples

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

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/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 1/0/1

[Sysname-port-group manual group1] group-member gigabitethernet 1/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 that the trunk ports will be assigned to, 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 be 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 port trunk permit vlan to assign the current trunk ports to the specified VLANs.

Use undo port trunk permit vlan 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 VLANs the trunk port carries are the set of VLANs specified by vlan-id-list in each execution.

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

The configuration made in Ethernet interface view applies only to the port.

The configuration made in port group view applies to all ports in the port group.

The configuration made in Layer 2 aggregate interface view applies to the aggregate interface and its aggregation member ports.

·     If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to 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 1/0/1 to VLAN 2, VLAN 4, and VLAN 50 through VLAN 100.

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

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

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

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

# Assign the trunk Layer 2 aggregate interface Bridge-Aggregation 1 to VLAN 2.

<Sysname> system-view

[Sysname] interface bridge-aggregation 1

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

[Sysname-Bridge-Aggregation1] port trunk permit vlan 2

 Please wait... Done.

 Configuring GigabitEthernet1/0/1... Done.

 Configuring GigabitEthernet1/0/2... Done.

 Configuring GigabitEthernet1/0/3... Done.

The output shows that GigabitEthernet 1/0/1, GigabitEthernet 1/0/2, and GigabitEthernet 1/0/3 are the member ports of the aggregation group corresponding to Bridge-aggregation 1.

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 port trunk pvid to configure the PVID for the trunk port.

Use undo port trunk pvid 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. Removing the PVID of a trunk port with the undo vlan command does not affect the setting of the PVID on the port.

The configuration made in Ethernet interface view applies only to the port.

The configuration made in port group view applies to all ports in the port group.

The configuration made in Layer 2 aggregate interface view applies to the aggregate interface and its aggregation member ports.

·     If the system fails to apply the configuration to the aggregate interface, it stops applying the configuration to 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.

The local and remote trunk ports must use the same PVID for the traffic of the PVID to be transmitted properly.

After configuring the PVID for a trunk port, you must use the port trunk permit vlan command to configure the trunk port to allow packets from the PVID to pass through, so that the port can forward packets from the PVID.

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

Examples

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

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

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

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

# Configure VLAN 100 as the PVID of the trunk 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

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 reset counters interface vlan-interface to clear the statistics on a VLAN interface.

Before collecting the traffic statistics within a specific period of time on an interface, you must 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 shutdown to shut down a VLAN interface.

Use undo shutdown to bring up a VLAN interface.

By default, a VLAN interface is up except when all ports in the VLAN are down.

You can use the undo shutdown command to bring up a VLAN interface after configuring related parameters and protocols for the VLAN interface. When a VLAN interface fails, you can shut down the interface with the shutdown command and then bring it up with the undo shutdown command. In this way, the interface may resume.

The state of any Ethernet port in a VLAN is independent of the VLAN interface state.

Examples

# Shut down VLAN-interface 2 and then bring it up.

<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 reserved VLANs. The keyword is not supported when the maximum number of VLANs that can be created on a device is less than 4094.

Description

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

Use vlan vlan-id1 to vlan-id2 to create a range of VLANs specified by vlan-id1 to vlan-id2, except reserved VLANs.

Use undo vlan to remove the specified VLANs.

As the default VLAN, VLAN 1 cannot be created or removed.

You cannot create or remove reserved VLANs reserved for specific functions.

For dynamic VLANs, you must remove the related configurations first, because you cannot use the undo vlan command to directly remove them.

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.

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