No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S12700 V200R013C00 Command Reference

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
VLAN Switch Configuration Commands

VLAN Switch Configuration Commands

Command Support

Commands provided in this section and all the parameters in the commands are supported by all switch models by default, unless otherwise specified. For details, see specific commands.

display vlan-switch

Function

The display vlan-switch command displays the configuration of VLAN switching.

Format

display vlan-switch [ vlan-switch-name | interface interface-type interface-number ]

Parameters

Parameter

Description

Value

vlan-switch-name

Specifies the name of a VLAN switching entry.

The value is a string of 1 to 32 characters. When double quotation marks are used around the string, spaces are allowed in the string.

interface interface-type interface-number

  • interface-type specifies the interface type.
  • interface-number specifies the interface number.

The interface type can be Ethernet, GE, XGE, or Eth-Trunk.

Views

All views

Default Level

1: Monitoring level

Usage Guidelines

Usage Scenario

After configuring VLAN switching, you can use the display vlan-switch command to verify the configuration. This command displays the VLAN switching entry name, source interface number, source VLAN ID, destination interface number, destination VLAN ID, operation type, and VLAN switching status.

Precautions

If no parameter is specified, the display vlan-switch command displays all VLAN switching entries.

Example

# Display all VLAN switching entries.

<HUAWEI> display vlan-switch

------------------------------------------------------------------------
 Vlan-switch name: 22
      Source port: GigabitEthernet1/0/1
             VLAN: 100
       Inner VLAN: 200
 Destination port: GigabitEthernet1/0/2
        Operation: Switch
 Destination VLAN: 300
   Current status: Down
Table 5-56  Description of the display vlan-switch command output

Item

Description

Vlan-switch name

Name of a VLAN switching entry.

Source port

Inbound interface of packets.

VLAN

Source VLAN ID.

Inner VLAN

Inner VLAN ID.

Destination port

Outbound interface of packets.

Operation

Operation performed on packets.
  • Switch: changes the VLAN tag.

  • Stack: adds a VLAN tag.

  • Unchange: does not change the VLAN tag.

Destination VLAN

Destination VLAN ID.

Current status

Status of a VLAN switching entry.
  • Up: indicates that the VLAN switching entry is enabled. A VLAN switching entry is Up only when both the source interface and destination interface in the entry are Up.

  • Down: indicates that the VLAN switching entry is disabled.

vlan-switch stack-vlan

Function

Using the vlan-switch stack-vlan command, you can configure VLAN switching to add an outer VLAN tag to packets on an interface.

Using the undo vlan-switch command, you can delete a VLAN switching entry.

Format

vlan-switch vlan-switch-name interface interface-type interface-number vlan vlan-id1 [ to vlan-id2 ] interface interface-type interface-number [ stack-vlan vlan-id3 ]

undo vlan-switch vlan-switch-name

Parameters

Parameter

Description

Value

vlan-switch vlan-switch-name

Specifies the name of a VLAN switching entry.

The value is a string of 1 to 32 characters. When double quotation marks are used around the string, spaces are allowed in the string.

interface interface-type interface-number

Specifies the type and number of an interface.

-

vlan vlan-id1 to vlan-id2

Specifies VLAN IDs of the packets to which an outer VLAN tag is to be added.

  • The value of vlan-id1 is an integer that ranges from 2 to 4094.
  • The value of vlan-id2 is an integer that ranges from 2 to 4094.

The value of vlan-id2 must be greater than the value of vlan-id1. The vlan-id1 and vlan-id2 parameters identify a range of VLANs.

stack-vlan vlan-id3

Specifies the outer VLAN ID to be added to packets.

The value is an integer that ranges from 2 to 4094.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

VLAN switching is a function that forwards packets based on VLAN tags. A static forwarding path must be configured on switches on a network to implement VLAN switching. When a switch receives packets matching a VLAN switching entry, it adds an outer VLAN tag to the packets. The switch then forwards the packets through the outbound interface specified in the VLAN switching entry without searching the MAC address table.

Prerequisites

None of VLANs specified in the command have been created in the system view.

Precautions

VLAN switching entries configured on different interfaces of a device can contain the same VLAN.

The SA cards of S series do not support the stack-vlan vlan-id3 parameter in the vlan-switch command.

The VLANs specified in the command can no longer be created in the system view.

The switch still forwards the packets matching VLAN Switch entries when VLAN Switch is configured on the interface of a card (Exclude the X series cards) and packets are discarded, including but not limited to the following situations:
  • The STP status of the interface is Blocking.
  • The action is set to discard when the interface does not learn MAC address entries.
  • The MAC address of packets is all 0s.
  • The packets contain the blackhole MAC address.
To prevent the preceding problem, configure a traffic policy containing redirection to replace VLAN Switch.
When double-tagged VLAN switching is configured, both inbound and outbound interfaces must be located on the X series cards or non X series cards. For example, if GE1/0/1 is located on the X series cards and GE2/0/1 is located on the non-X series cards, the switch does not support the following setting:
vlan-switch name1 interface gigabitethernet 1/0/1 vlan 10 interface gigabitethernet 2/0/1 stack-vlan 20

Example

# Configure VLAN switching on the device so that the device adds outer VLAN tag 20 to the packets with VLAN tag 10 received on GE1/0/1, and then forwards the packets through GE1/0/2.

<HUAWEI> system-view
[HUAWEI] vlan-switch name1 interface gigabitethernet 1/0/1 vlan 10 interface gigabitethernet 1/0/2 stack-vlan 20

vlan-switch switch-vlan

Function

The vlan-switch switch-vlan command configures VLAN Switch to replace the outer VLAN tag of packets.

The undo vlan-switch command deletes a VLAN Switch entry.

Format

vlan-switch vlan-switch-name interface interface-type1 interface-number1 vlan vlan-id1 [ inner-vlan vlan-id2 [ to vlan-id3 ] ] interface interface-type2 interface-number2 [ switch-vlan vlan-id4 ]

undo vlan-switch vlan-switch-name

Parameters

Parameter

Description

Value

vlan-switch vlan-switch-name

Specifies the name of a VLAN Switch entry.

The value is a string of 1 to 32 characters. When double quotation marks are used around the string, spaces are allowed in the string.

interface interface-type1 interface-number1

Specifies the type and number of the source interface.

-

vlan vlan-id1

Specifies the outer VLAN tag to be replaced.

The value is an integer that ranges from 2 to 4094.

inner-vlan vlan-id2 to vlan-id3

Specifies the inner VLAN tags of packets.

  • The value of vlan-id2 is an integer that ranges from 1 to 4094.
  • The value of vlan-id3 is an integer that ranges from 1 to 4094.

The value of vlan-id3 must be greater than the value of vlan-id2. The vlan-id2 and vlan-id3 parameters identify a range of VLANs.

interface interface-type2 interface-number2

Specifies the type and number of the destination interface.

-

switch-vlan vlan-id4

Specifies the new outer VLAN tag of packets after VLAN Switch is performed.

The value is an integer that ranges from 2 to 4094.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

VLAN Switch enables the switch to forward packets based on VLAN tags. A static forwarding path must be configured on switches on a network to implement VLAN Switch. When a switch receives packets matching a VLAN Switch entry, it forwards the packets through the outbound interface specified in the VLAN Switch entry without searching for the MAC address table. This improves forwarding efficiency and security, and prevents MAC address attacks and broadcast storms. The vlan-switch switch-vlan command is applicable to the following scenarios:

  • On a small-scale network where devices are seldom changed, users in different VLANs need to communicate.
  • A switch connects a new network to an old network. Users on the old network need to communicate with each other but do not need to communicate with users on the new network.

Prerequisites

None of VLANs specified in the command have been created in the system view.

Precautions

VLAN Switch entries configured on different interfaces of a device can contain the same VLAN.

VLAN Switch does not change the VLAN priority.

SA cards of S series cannot specify double tags before VLAN Switch.

The VLANs specified in the command can no longer be created in the system view.

The switch still forwards the packets matching VLAN Switch entries when VLAN Switch is configured on the interface of a card (Exclude the X series cards) and packets are discarded, including but not limited to the following situations:
  • The STP status of the interface is Blocking.
  • The action is set to discard when the interface does not learn MAC address entries.
  • The MAC address of packets is all 0s.
  • The packets contain the blackhole MAC address.
To prevent the preceding problem, configure a traffic policy containing redirection to replace VLAN Switch.
When double-tagged VLAN switching is configured, both inbound and outbound interfaces must be located on the X series cards or non-X series cards. For example, if GE1/0/1 is located on the X series cards and GE2/0/1 is located on the non-X series cards, the switch does not support the following setting:
vlan-switch name2 interface gigabitethernet 1/0/1 vlan 10 inner-vlan 100 interface gigabitethernet 2/0/1 switch-vlan 20

Example

Configure VLAN Switch on the device so that the device replaces outer VLAN tag 10 of the packets received on GE1/0/1 with VLAN tag 20, and then forwards the packets through GE1/0/2.

<HUAWEI> system-view
[HUAWEI] vlan-switch name1 interface gigabitethernet 1/0/1 vlan 10 interface gigabitethernet 1/0/2 switch-vlan 20
Translation
Download
Updated: 2019-04-09

Document ID: EDOC1100065659

Views: 116151

Downloads: 83

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next