H3C WX3000 Series Unified Switches Switching Engine Command Reference-6W103

HomeSupportWirelessH3C WX3000 Series Unified SwitchesReference GuidesCommand ReferencesH3C WX3000 Series Unified Switches Switching Engine Command Reference-6W103
04-VLAN Command
Title Size Download
04-VLAN Command 85.07 KB

VLAN Configuration Commands

description

Syntax

description text

undo description

View

VLAN view, VLAN interface view

Parameters

text: Case sensitive character string to describe the current VLAN or VLAN interface. Special characters and spaces are allowed.

It has:

l          1 to 32 characters for a VLAN description.

l          1 to 80 characters for a VLAN interface description.

Description

Use the description command to assign a description string to the current VLAN or VLAN interface.

Use the undo description command to restore the default description string.

By default, the description string of the current VLAN is its VLAN ID, such as “VLAN 0001”; the description string of the current VLAN interface is its name, such as “Vlan-interface 1 Interface”.

Related commands: display vlan, and display interface Vlan-interface.

Examples

# Specify the description string of VLAN 1 as “RESEARCH”.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] vlan 1

[device-vlan1] description RESEARCH

display interface vlan-interface

Syntax

display interface vlan-interface [ vlan-id ]

View

Any view

Parameters

vlan-id: ID of the specific VLAN interface.

Description

Use the display interface Vlan-interface command to display the information about the VLAN interface.

If the vlan-id argument is specified, the information about the specified VLAN interface is displayed; if the vlan-id argument is not specified, the information about all the created VLAN interfaces is displayed.

Related commands: interface Vlan-interface.

Examples

# Display the information about VLAN-interface1.

<device> display interface Vlan-interface 1

Vlan-interface1 current state : DOWN

Line protocol current state : DOWN

IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 000f-e207-4101

Internet Address is 10.1.1.1/24 Primary

Description : Vlan-interface1 Interface

The Maximum Transmit Unit is 1500

Table 1-1 display interface Vlan-interface command output description

Field

Description

Vlan-interface1 current state

Current state of the VLAN interface

Line protocol current state

Current state of the link protocol

IP Sending Frames' Format

Format of the frames that IP sends

Hardware address

MAC address corresponding to the VLAN interface

Internet Address

IP address corresponding to the VLAN interface

Description

Description string of the VLAN interface

The Maximum Transmit Unit

Maximum transmission unit (MTU)

 

display vlan

Syntax

display vlan [ vlan-id [ to vlan-id ] | all | dynamic | static ]

View

Any view

Parameters

vlan-id: VLAN ID, in the range of 1 to 4094.

to: Specifies multiple contiguous VLAN IDs. The VLAN ID after to cannot be less than that before to.

all: Displays the information about all the VLANs.

dynamic: Displays information about the dynamic VLANs (which are registered through GVRP protocol).

static: Displays information about the static VLANs (which are created through manual configuration).

Description

Use the display vlan command to display the information about the specified VLANs or all VLANs.

l          If the vlan-id argument is specified, information about the specified VLAN will be displayed.

l          If the vlan-id argument is not specified, the VLAN IDs of all the existing VLANs will be displayed.

l          If the dynamic or static keyword is specified, this command displays the amount and VLAN IDs of the dynamic or static VLANs.

Related commands: vlan.

Examples

# Display the information about VLAN 1.

<device> display vlan 1

 VLAN ID: 1

 VLAN Type: static

 Route Interface: configured

 IP Address: 192.168.0.50

 Subnet Mask: 255.255.255.0

 Description: VLAN 0001

 Name: VLAN 0001

 Tagged   Ports: none  

 Untagged Ports:

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

  GigabitEthernet1/0/4         GigabitEthernet1/0/5         GigabitEthernet1/0/6

  GigabitEthernet1/0/7         GigabitEthernet1/0/8         GigabitEthernet1/0/9

  GigabitEthernet1/0/10        GigabitEthernet1/0/11        GigabitEthernet1/0/12

  GigabitEthernet1/0/13        GigabitEthernet1/0/14        GigabitEthernet1/0/15

  GigabitEthernet1/0/16        GigabitEthernet1/0/17        GigabitEthernet1/0/18

  GigabitEthernet1/0/19        GigabitEthernet1/0/20        GigabitEthernet1/0/21

  GigabitEthernet1/0/22        GigabitEthernet1/0/23        GigabitEthernet1/0/24

  GigabitEthernet1/0/29                                              

Table 1-2 display vlan command output description

Field

Description

VLAN ID

VLAN ID

VLAN Type

VLAN type (dynamic or static)

Route Interface

Whether the VLAN interface of the VLAN is configured as a route forwarding interface (Whether an IP address is assigned to the VLAN interface)

IP Address

Primary IP address of the VLAN interface

Subnet Mask

Subnet mask of the IP address of the VLAN interface

Description

Description string of the VLAN

Name

VLAN name

Tagged Ports

Ports through which packets are sent with VLAN tag kept.

Untagged Ports

Port through which packets are sent with VLAN tag stripped.

 

interface vlan-interface

Syntax

interface vlan-interface vlan-id

undo interface vlan-interface vlan-id

View

System view

Parameters

vlan-id: ID of the VLAN interface, in the range of 1 to 4,094.

Description

Use the interface vlan-interface command to create a VLAN interface and enter VLAN interface view.

Use the undo interface vlan-interface command to delete the VLAN interface.

Related commands: display interface vlan-interface.

 

l          Before you can create a VLAN interface, you must create the corresponding VLAN.

l          You can configure a maximum number of eight VLAN interfaces on the device.

 

Examples

# Enter VLAN-interface1 view

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface Vlan-interface 1

[device-Vlan-interface1]

name

Syntax

name text

undo name

View

VLAN view

Parameters

text: VLAN name, in the range of 1 character to 32 characters. It can contain special characters and spaces.

Description

Use the name command to assign a name to the current VLAN.

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

By default, the name of a VLAN is its VLAN ID, such as “VLAN 0001”.

Examples

# Specify the name of VLAN 2 as ”test vlan”.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] vlan 2

[device-vlan2] name test vlan

shutdown

Syntax

shutdown

undo shutdown

View

VLAN interface view

Parameters

None

Description

Use the shutdown command to disable the VLAN interface.

Use the undo shutdown command to enable the VLAN interface.

By default, the VLAN interface is enabled. In this case, the physical status of the VLAN interface is affected by that of the ports in the VLAN.

l          When all the Ethernet ports in the VLAN are down, the VLAN interface of the VLAN is down, that is, the VLAN interface is disabled.

l          When one or more Ethernet ports in the VLAN are up, the VLAN interface of the VLAN is up, that is, the VLAN interface is enabled.

If you disable the VLAN interface, the status of the VLAN interface will always be down, regardless of the status of the ports in the VLAN.

You can use the undo shutdown command to enable a VLAN interface when its related parameters and protocols are configured. When a VLAN interface fails, you can use the shutdown command to disable the interface, and then use the undo shutdown command to enable this interface again, which may restore the interface.

The operation of enabling/disabling a VLAN interface does not influence the status of the Ethernet ports belonging to this VLAN.

Examples

# Disable the VLAN-interface2.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface Vlan-interface 2

[device-Vlan-interface2] shutdown

vlan

Syntax

vlan vlan-id

undo vlan vlan-id

View

System view

Parameters

vlan-id: ID of the VLAN which you want to create and whose view you want to enter. This argument ranges from 1 to 4,094.

Description

Use the vlan command to enter VLAN view. If the VLAN identified by the vlan-id argument does not exist, this command creates the VLAN and then enters VLAN view.

Use the undo vlan command to remove the specified VLAN.

 

l          VLAN 1 is the default VLAN and cannot be removed.

l          When you use the undo vlan command to remove a VLAN which is the default VLAN of a trunk port or a hybrid port on the device, the configuration of the default VLAN of the trunk port or hybrid port does not change after the undo vlan command is executed, that is, the trunk port or the hybrid port will use the removed VLAN (the already non-existing VLAN) as its default VLAN.

l          The VLANs kept by protocol , voice VLAN, management VLAN and the probe VLAN for remote mirroring cannot be removed using the undo vlan command.

 

Examples

# Enter VLAN 1 view.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] vlan 1

[device-vlan1]

# Remove VLAN 5.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] undo vlan 5

vlan to

Syntax

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

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

View

System view

Parameters

vlan-id1: ID of the initial VLAN to be created, in the range of 1 to 4,094.

to: Specifies the VLAN range.

vlan-id2: ID of the terminal VLAN to be created, in the range of 1 to 4,094. The value of the argument is no smaller than that of the vlan-id1 argument

all: If the all keyword in the vlan to command is specified, all VLANs (VLAN 1 to 4094) will be created at a time. If the all keyword in the undo vlan to command is specified, all existing VLANs will be removed.

Description

Use the vlan to command to create VLANs in bulk.

Use the undo vlan to command to remove VLANs in bulk.

 

The undo vlan to command or the undo vlan all command cannot be used to remove the VLANs kept by protocol, the voice VLAN, the default VLAN (VLAN 1), the management VLAN and the probe VLAN for remote mirroring.

 

Examples

# Create VLAN 4 through VLAN 100.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] vlan 4 to 100

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

# Remove VLAN 2 through VLAN 9 in bulk, in which VLAN 5 is the voice VLAN.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] undo vlan 2 to 9

 Note:The VLAN kept by protocol, the voice VLAN,  the default VLAN, the management VLAN and the remote probe VLAN will not be deleted!

 Please wait... Done.

[device] display vlan

The following VLANs exist:

  1(default), 5

The above output information indicates that among VLAN 2 through VLAN 9, VLAN 5 (the voice VLAN) cannot be removed by the undo vlan command, while other VLANs are removed by the command successfully.

Port-Based VLAN Configuration Commands

port

Syntax

port interface-list

undo port interface-list

View

VLAN view

Parameters

interface-list: List of Ethernet ports to be added to or removed from a VLAN. You need to provide this argument in the form of interface-list = { interface-type interface-number [ to interface-type interface-number ] } &<1-10>, where:

l          interface-type is port type and interface-number is port number.

l          The port number to the right of the to keyword must be larger than or equal to the one to the left of the keyword.

l          &<1-10> means that you can provide up to 10 ports or ports lists.

Description

Use the port command to add a port or multiple ports to a VLAN.

Use the undo port command to remove a port or multiple ports from a VLAN.

 

The port command is only applicable to access ports. To add trunk ports and hybrid ports to a VLAN, you can use the port trunk permit vlan and port hybrid vlan commands in Ethernet port view. For related commands, refer to the Basic Port Configuration in H3C WX3000 Series Unified Switches Switching Engine Configuration Guide.

 

Related commands: display vlan.

Examples

# Add GigabitEthernet 1/0/2 through GigabitEthernet 1/0/4 to VLAN 2.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] vlan 2

[device-vlan2] port GigabitEthernet 1/0/2 to GigabitEthernet 1/0/4

Protocol-Based VLAN Configuration Commands

display protocol-vlan interface

Syntax

display protocol-vlan interface { interface-type interface-number [ to interface-type interface-number ] | all }

View

Any view

Parameters

interface-type interface-number [ to interface-type interface-number ]: Specifies the port on which protocol-based VLAN configuration information is displayed. If you do not use the to keyword, only one port is specified. If you use the to keyword, a range of ports are specified. The port number after to must be greater than or equal to that before to. The interface-type argument refers to the port type and the interface-number argument refers to the port number.

all: Displays the protocol-related information about all ports.

Description

Use the display protocol-vlan interface command to display the protocol information and protocol indexes configured for specified ports.

Examples

# Display protocol information and protocol index configured for GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2.

<device> display protocol-vlan interface GigabitEthernet 1/0/1 to GigabitEthernet 1/0/2

 Interface: GigabitEthernet1/0/1

     VLAN ID  Protocol-Index     Protocol-type

        50          0                ip

        80          1                ip

        100         0                ip

        100         1                ipx ethernetii

 Interface: GigabitEthernet1/0/2

     VLAN ID  Protocol-Index     Protocol-type

        50          1                ipx raw

        80          2                at

        100         3                snap etype 0x0abc

        100         4                llc dsap 0xac ssap 0xbd

display protocol-vlan vlan

Syntax

display protocol-vlan vlan { vlan-id [ to vlan-id ] | all }

View

Any view

Parameters

vlan-id: VLAN ID in the range of 1 to 4094.

to: Specifies a VLAN ID range. Make sure the vlan-id argument to the right of this keyword is larger than or equal to the argument to the left of this keyword.

all: Specifies to display information about all configured protocol-based VLANs.

Description

Use the display protocol-vlan vlan command to display the protocol information and protocol indexes configured for specified VLANs.

Related commands: display vlan.

Examples

# Display the protocol information and protocol indexes configured for VLAN 10 through VLAN 20.

<device> display protocol-vlan vlan 10 to 20

 VLAN ID: 10

 VLAN Type: Protocol-based VLAN

      Protocol-Index          Protocol-Type

             0                    ip   

             1                    ip   

             2                    ipx ethernetii

             3                    at

 VLAN ID: 15

 VLAN Type: Protocol-based VLAN

      Protocol-Index          Protocol-Type

             0                    ip  

             1                    snap etype 0x0abcd

port hybrid protocol-vlan vlan

Syntax

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

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

View

Ethernet port view

Parameters

vlan-id: VLAN ID in the range of 1 to 4094.

protocol-index: Beginning protocol index in the range of 0 to 7.

to: Specifies multiple contiguous protocol indexes.

protocol-index-end: End protocol index in the range of 0 to 7. Note that this argument must be larger than or equal to the protocol-index argument.

all: Specifies all protocol indexes. If the all keyword in the port hybrid protocol-vlan vlan command is specified, this command associates the port with all the protocol indexes of the specified protocol-based VLAN; if the all keyword in the undo port hybrid protocol-vlan vlan command is specified, the command removes the associations between the port and all the protocol indexes of the specified protocol-based VLAN.

Description

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

Use the undo port hybrid protocol-vlan vlan command to remove the association between the specified protocol-based VLAN and the port.

 

l          The port hybrid protocol-vlan vlan command can be executed on hybrid ports only.

l          Before you associate a port with the protocol-based VLAN, make sure the port belongs to the protocol-based VLAN.

l          When the undo port hybrid protocol-vlan vlan command is being executed, the device will prompt operation failure if the index of the specified protocol to be removed does not exist. If a part of the specified protocol indexes to be removed do not exist, the device will remove the existing indexes when it prompts errors.

 

Related commands: display protocol-vlan interface.

Examples

# Associate GigabitEthernet 1/0/1 with the protocols indexed from 0 to 4 of VLAN 3 (assuming that VLAN 3 is a protocol-based VLAN).

<device> system-view

System View: return to User View with Ctrl+Z.

[device] interface GigabitEthernet 1/0/1

[device-GigabitEthernet1/0/1] port hybrid protocol-vlan vlan 3 0 to 4

protocol-vlan

Syntax

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

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

View

VLAN view

Parameters

at: Specifies the VLAN to be an AppleTalk-based VLAN.

ip: Specifies the VLAN to be an IP-based VLAN.

ipx: Specifies the VLAN to be an IPX-based VLAN. The ethernetii, llc, raw and snap keywords specify the four IPX encapsulation types.

mode: Configures user-defined protocol templates.

ethernetii etype-id: Matches the Ethernet II encapsulation format and the corresponding protocol type value of the packet. The etype-id argument ranges from 0x0600 to 0xFFFF.

llc: Matches LLC encapsulation format.

dsap-id: Destination service access point. This argument ranges 0x0000 to 0x00FF.

ssap-id: Source service access point. This argument ranges from 0x0000 to 0x00FF.

snap etype-id: Matches SNAP encapsulation format and the corresponding protocol type value of the packet. The etype-id argument ranges from 0x0600 to 0xFFFF.

protocol-index: Beginning protocol index ranging from 0 to 7. Note that this argument must be less than or equal to the protocol-end argument. If you do not specify this argument, the beginning protocol index will be determined by the system.

protocol-index-end: End protocol index ranging from 0 to 7. Note that this argument must be larger than or equal to the protocol-index argument.

all: Specifies all the protocol indexes.

 

When you use the mode keyword to configure a user-defined protocol template, if you set the etype-id argument for Ethernet II or SNAP packets to 0x0800, 0x089B, or 0x8137, the matching packets have the same format as that of IP, IPX, and AppleTalk packets respectively. To prevent two commands from processing packets of the same protocol type in different ways, the device will prompt that you cannot set the etype-id argument for Ethernet II or SNAP packets to 0x0800, 0x089B, or 0x8137.

 

Description

Use the protocol-vlan command to configure the protocol template used for classifying protocol-based VLANs.

Use the undo protocol-vlan command to disable the configuration.

Related commands: display protocol-vlan vlan.

Examples

# Configure VLAN 3 as a protocol-based VLAN and assign IP packets to VLAN 3 for transmission.

<device> system-view

System View: return to User View with Ctrl+Z.

[device] vlan 3

[device-vlan3] protocol-vlan ip

 

Because the IP protocol is closely associated with the ARP protocol, you are recommended to configure the ARP protocol type when configuring the IP protocol type and associate the two protocol types with the same port, in case that ARP packets and IP packets are not assigned to the same VLAN, which will cause IP address resolution failure.

 

# Configure an ARP protocol template. The code for the ARP protocol is 0x0806.

l          Perform the following command when Ethernet encapsulation is used.

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

l          Perform the following configuration when 802.3 encapsulation format is used.

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

 

  • 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 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
新华三官网