H3C S3600 Series Ethernet Switches Command Manual-Release 1510(V1.04)

HomeSupportSwitchesH3C S3600 Switch SeriesReference GuidesCommand ReferencesH3C S3600 Series Ethernet Switches Command Manual-Release 1510(V1.04)
04-VLAN Command
Title Size Download
04-VLAN Command 94 KB

Chapter 1  VLAN Configuration Commands

1.1  VLAN Configuration Commands

1.1.1  description

Syntax

description text

undo description

View

VLAN view, VLAN interface view

Parameter

text: String to describe the current VLAN or VLAN interface.

l           In the range of 1 to 32 characters when describing the current VLAN.

l           In the range of 1 to 80 characters when describing the current VLAN interface.

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 command: display vlan, and display interface Vlan-interface.

Example

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

<H3C> system-view

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

[H3C] vlan 1

[H3C-vlan1] description RESEARCH

1.1.2  display interface Vlan-interface

Syntax

display interface Vlan-interface [ vlan-id ]

View

Any view

Parameter

vlan-id: ID of the specific VLAN interface.

Description

Use the display interface Vlan-interface command to display the information about the VLAN interface, including:

l           Physical state and link state of the VLAN interface

l           Format of the sent frames

l           MAC address, IP address and subnet mask of the VLAN interface

l           Description string and MTU of 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 command: interface Vlan-interface.

Example

# Display the information about VLAN-interface2.

<H3C> display interface Vlan-interface 2

Vlan-interface2 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-interface2 Interface

The Maximum Transmit Unit is 1500

Table 1-1 Description on the fields of the display interface Vlan-interface command

Field

Description

Vlan-interface2 current state

Current state of the VLAN interface

Line protocol current state

Current state of the Line 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 on the VLAN interface

The Maximum Transmit Unit

Maximum transmission unit (MTU)

 

1.1.3  display vlan

Syntax

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

View

Any view

Parameter

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

to: Specifies multiple contiguous VLAN IDs.

all: Displays the information about all the VLANs.

dynamic: Displays the VLANs created dynamically.

static: Displays the VLANs created statically.

Description

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

If the vlan-id argument or the all keyword is specified, the information about the specified VLANs or the all VLANs is displayed, including:

l           VLAN ID

l           VLAN type (dynamic or static)

l           Whether the routing function is enabled (If yes, the primary IP address and mask are displayed)

l           VLAN description

l           Member ports

If no argument/keyword is specified, this command displays the amount and VLAN IDs of all the existing VLANs. If the dynamic or static keyword is specified, this command displays the amount and VLAN IDs of the VLANs that are created dynamically or statically.

Related command: vlan.

Example

# Display the information about VLAN 1.

<H3C> display vlan 1

 VLAN ID: 1

 VLAN Type: static

 Route Interface: configured

 IP Address: 192.168.0.39

 Subnet Mask: 255.255.255.0

 Description: VLAN 0001

 Name: VLAN 0001

 Tagged   Ports: none  

 Untagged Ports:

  Ethernet1/0/1         Ethernet1/0/2         Ethernet1/0/3

  Ethernet1/0/4         Ethernet1/0/5         Ethernet1/0/6

  Ethernet1/0/7         Ethernet1/0/8         Ethernet1/0/9

  Ethernet1/0/10        Ethernet1/0/11        Ethernet1/0/12

  Ethernet1/0/13        Ethernet1/0/14        Ethernet1/0/15

  Ethernet1/0/16        Ethernet1/0/17        Ethernet1/0/18

  Ethernet1/0/19        Ethernet1/0/20        Ethernet1/0/21

  Ethernet1/0/22        Ethernet1/0/23        Ethernet1/0/24

Table 1-2 Description on the fields of the display vlan command

Field

Description

VLAN ID

VLAN ID

VLAN Type

VLAN type (dynamic or static)

Route Interface

Whether the routing interface function is enable for this VLAN

IP Address

IP address

Subnet Mask

Subnet mask

Description

Description on the VLAN

Name

VLAN name

Tagged Ports

Ports packets transmitted through which are tagged

Untagged Ports

Port packets transmitted through which are untagged

 

1.1.4  interface Vlan-interface

Syntax

interface Vlan-interface vlan-id

undo interface Vlan-interface vlan-id

View

System view

Parameter

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 or enter VLAN interface view.

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

Related command: display interface Vlan-interface.

Example

# Enter VLAN-interface1 view

<H3C> system-view

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

[H3C] interface Vlan-interface 1

[H3C-Vlan-interface1]

1.1.5  name

Syntax

name text

undo name

View

VLAN view

Parameter

text: String that refers to the name of the current VLAN, in the range of 1 character to 32 characters. It can contain special characters and space.

Parameter

Use the name command to assign a name to a 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”.

Example

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

<H3C> system-view

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

[H3C] vlan 2

[H3C-vlan2] name test vlan

1.1.6  shutdown

Syntax

shutdown

undo shutdown

View

VLAN interface view

Parameter

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’s management state is enabled. In this case, the physical state of the VLAN interface is affected by the ports state in the VLAN. When all the Ethernet ports of a VLAN are down, the VLAN interface of the VLAN is down, that is, the VLAN interface is disabled; when one or more Ethernet ports of a VLAN are up, the VLAN interface of the VLAN is up, that is, the VLAN interface is enabled.

If you disable the VLAN interface’s management state, the VLAN interface will always be down, regardless of the states 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 Ethernet ports belonging to this VLAN.

Example

# Disable the VLAN-interface2.

<H3C> system-view

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

[H3C] interface Vlan-interface 2

[H3C-Vlan-interface2] shutdown

1.1.7  vlan

Syntax

vlan vlan-id

undo vlan vlan-id

View

System view

Parameter

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 a VLAN.

 

  Caution:

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.

 

Example

# Enter VLAN 1 view.

<H3C> system-view

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

[H3C] vlan 1

[H3C-vlan1]

# Remove VLAN 5.

<H3C> system-view

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

[H3C] undo vlan 5

1.1.8  vlan to

Syntax

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

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

View

System view

Parameter

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: Specifies all VLANs.

Description

Use the vlan to command to create multiple VLANs in batch.

Use the undo vlan to command to remove multiple VLANs in batch.

 

  Caution:

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

 

Example

# Create VLAN 4 through VLAN 100.

<H3C> system-view

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

[H3C] vlan 4 to 100

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

# Remove VLAN 2 through VLAN 9 in batch, in which VLAN 5 is a Voice VLAN.

<H3C> system-view

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

[H3C] undo vlan 2 to 9

 Note:The VLAN kept by protocol, the voice VLAN,  the default VLAN, the manageme

nt VLAN and the remote probe VLAN will not be deleted!

 Please wait... Done.

[H3C] display vlan

The following VLANs exist:

  1(default), 5

1.2  Port-Based VLAN Configuration Commands

1.2.1  port

Syntax

port interface-list

undo port interface-list

View

VLAN view

Parameter

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.

Parameter

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.

 

  Caution:

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 the configuration procedure, refer to the section “Port Basic Configuration” in H3C S3600 Series Ethernet Switches  Operation Manual-Release 1510.

 

Related command: display vlan.

Example

# Add Ethernet1/0/2 through Ethernet1/0/4 to VLAN 2.

<H3C> system-view

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

[H3C] vlan 2

[H3C-vlan2] port Ethernet 1/0/2 to Ethernet 1/0/4

1.3  Protocol-Based VLAN Configuration Commands

1.3.1  display protocol-vlan interface

Syntax

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

View

Any view

Parameter

interface-type interface-number [ to interface-type interface-number ]: Specifies the port number of the protocol to be displayed. If you do not use the to keyword, only one port is specified. If you use the to keyword, multiple contiguous ports are specified. 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.

Example

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

<H3C> display protocol-vlan interface Ethernet1/0/1 to Ethernet1/0/2

Interface: Ethernet1/0/1

VLAN ID  Protocol-Index     Protocol-type

   50               0                  ip

   80               1                  ip

   100          0                  ip

   100          1                  ipx ethernetii

Interface: Ethernet1/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

1.3.2  display protocol-vlan vlan

Syntax

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

View

Any view

Parameter

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 all VLANs.

Description

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

Related command: display vlan.

Example

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

<H3C> 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

1.3.3  port hybrid protocol-vlan 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 }

View

Ethernet port view

Parameter

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

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

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

all: Specifies all protocols.

Description

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

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

 

&  Note:

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 switch 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 switch will remove the existing indexes when it prompts errors.

 

Related command: display protocol-vlan interface.

Example

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

<H3C> system-view

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

[H3C] interface Ethernet 1/0/1

[H3C-Ethernet1/0/1] port hybrid protocol-vlan vlan 3 0 to 4

1.3.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-end ] | all }

View

VLAN view

Parameter

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: Ethernet II encapsulation format.

etype-id: Protocol type of the packet, in the range of 600 to FFFF.

llc: LLC encapsulation format.

dsap-id: Destination service access point. This argument ranges from 0 to FF.

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

snap: SNAP encapsulation format.

etype-id: Protocol type of the packet, in the range of 600 to FFFF.

protocol-index: Beginning protocol index ranging from 0 to 4. 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-end: End protocol index ranging from 0 to 4. Note that this argument must be larger than or equal to the protocol-index argument.

all: Specifies all the protocol indexes.

 

&  Note:

When you use the mode keyword to configure protocol-based VLANs, if you set the etype-id arguments of Ethernet II or SNAP packets to 0x0800, 0x089b, or 0x8137, the matched packets have the same format as that of IP, IPX, and Appletalk packets respectively. In order that two commands do not configure the same protocol repetitively, the switch will prompt you that you cannot specify the etype-id arguments of Ethernet II and 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 command: display protocol-vlan vlan.

Example

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

<H3C> system-view

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

[H3C] vlan 3

[H3C-vlan3] protocol-vlan ip

 

  Caution:

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.

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

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

[H3C-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 Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网