03-VLAN Command

Download


Chapter 1  VLAN Configuration Commands

1.1  VLAN Configuration Commands

1.1.1  description

Syntax

description text

undo description

View

VLAN view

Parameter

text: Description string to be assigned to a VLAN. This argument is a string comprising 1 to 32 characters. The default description string of a VLAN is its VLAN ID, such as “VLAN 0001”.

Description

Use the description command to assign a description string to a VLAN.

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

Example

# Specify the description string of VLAN 1 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-interface 1.

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

Internet Address is 10.1.1.1/24 Primary

Description : Vlan-interface1 Interface

The Maximum Transmit Unit is 1500

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

Field

Description

Vlan-interface1 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

 

1.1.3  display vlan

Syntax

display vlan [ vlan-id1 [ to vlan-id2 ] | all | dynamic | static ]

View

Any view

Parameter

vlan-id1: Beginning VLAN ID of the VLAN ID range. The information about the VLANs with their ID within this range is to be displayed. This argument ranges from 1 to 4,094.

to: Specifies a VLAN ID range.

vlan-id2: End VLAN ID of the VLAN ID range. This argument ranges from 1 to 4,094 and need to be larger than vlan-id1.

all: Displays the information about all the VLANs.

static: Displays the information about the VLANs that are created statically.

dynamic: Displays the information about the VLANs that are created dynamically.

Parameter

Use the display vlan command to display the information about specified VLANs or all VLANs. The information displayed includes:

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 VLAN IDs of all the existing VLANs. If the dynamic or static keyword is selected, this command displays the list of the VLANs that are created dynamically or statically.

Related command: vlan.

Example

# Display the information about VLAN 2.

<H3C> display vlan 2

 VLAN ID: 2

 VLAN Type: static

 Route interface: not configured

 Description: VLAN 0001

 Name: VLAN 0003

 Tagged   Ports: none

 Untagged Ports: 

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

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 function is enable for this VLAN

Description

Description string

Name

VLAN name

Tagged Ports

The ports that tag packets when sending packets

Untagged Ports

The ports that do not tag packets when sending packets

 

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-interface 1 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 to be “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, a VLAN interface is enabled. In this scenario, a VLAN interface’s status is determined by the status of its Ethernet ports, that is, if all the Ethernet ports of the VLAN interface are down, the VLAN interface is down (disabled); if one or more Ethernet ports of the VLAN interface are up, the VLAN interface is up (enabled).

If a VLAN interface is disabled, its status is not determined by the status of its Ethernet ports.

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 all the Ethernet ports belonging to this VLAN.

Example

# Disable 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 to be created or to be configured. 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.

Note that:

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

l           If the management VLAN to be removed is not the default management VLAN, VLAN 1 becomes the management VLAN after the current management VLAN is removed.

Example

# Enter VLAN 1 view.

<H3C> system-view

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

[H3C] vlan 1

[H3C-vlan1]

# Delete VLAN 5.

[H3C-vlan1] quit

[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: Beginning VLAN ID of the VLAN ID range. VLANs with their IDs within this range are to be created. This argument ranges from 1 to 4,094.

to: Specifies the VLAN ID range.

vlan-id2: End VLAN ID of the VLAN ID range. This argument ranges from 1 to 4,094 and need to be larger than the vlan-id1 argument.

all: Specifies all VLANs.

Parameter

Use the vlan to command to create VLANs in batches.

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

Note that VLAN 1 is the default VLAN and cannot be removed.

Example

# Create VLAN 4 through 100.

<H3C> system-view

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

[H3C]vlan 4 to 100

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

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. 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 to keyword specifies a group of successive ports. The port number to the right of the to keyword need to be larger than or equal to the one to the left of the keyword.

l           &<1-10> means that you can provide up to ten Ethernet ports/Ethernet port 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.

By default, all the ports belong to the default 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. Refer to the Port Command section in H3C S3100-SI Series Ethernet Switch  Command Manual for more.

 

Example

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

<H3C> system-view

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

[H3C] vlan 2

[H3C-vlan2] port ethernet1/0/1 to ethernet1/0/4

 


Chapter 2  VLAN-VPN Configuration Commands

2.1  VLAN-VPN Configuration Commands

2.1.1  display port vlan-vpn

Syntax

display port vlan-vpn

View

Any view

Parameter

None

Description

Use the display port vlan-vpn command to display the information about VLAN VPN configuration of the current system, including current TPID value, VLAN-VPN ports, and VLAN-VPN uplink ports.

Example

# Display the VLAN-VPN configuration of the current system.

<H3C> display port vlan-vpn

VLAN-VPN TPID: 8100

Ethernet1/0/1

VLAN-VPN status: enabled

VLAN-VPN VLAN: 1

Ethernet1/0/2

VLAN-VPN status: enabled

VLAN-VPN VLAN: 1

Ethernet1/0/3

VLAN-VPN status: enabled

VLAN-VPN VLAN: 1

Ethernet1/0/4

…………………………(Omitted)

2.1.2  vlan-vpn enable

Syntax

vlan-vpn enable

undo vlan-vpn

View

Ethernet port view

Parameter

None

Description

Use the vlan-vpn enable command to enable the VLAN-VPN function for a port.

Use the undo vlan-vpn command to disable the VLAN-VPN function for a port.

With the VLAN VPN function enabled, a received packet is tagged with the default VLAN tag of the receiving port no matter whether or not the packet already carries a VLAN tag. If the packet already carries a VLAN tag, the packet becomes a dual-tagged packet. Otherwise, the packet becomes a packet carrying the default VLAN tag of the port.

 

  Caution:

l      The VLAN-VPN function is unavailable if the port has any of the protocols among GVRP, STP, NTDP, 802.1x, and MAC-authentication enabled.

l      If this port is a remote mirror reflection port, the VLAN-VPN function cannot be enabled on the port.

 

By default, the VLAN-VPN function is disabled.

Example

# Enable the VLAN-VPN function for Ethernet1/0/1 port.

<H3C> system-view

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

[H3C]interface Ethernet 1/0/1

[H3C-Ethernet1/0/1] vlan-vpn enable