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 V200R010C00 Configuration Guide - Ethernet Switching

This document describes the configuration of Ethernet services, including configuring link aggregation, VLANs, Voice VLAN, VLAN mapping, QinQ, GVRP, MAC table, STP/RSTP/MSTP, SEP, and so on.
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).
Configuring Interface-based VLAN Assignment (Statically Configured Interface Type)

Configuring Interface-based VLAN Assignment (Statically Configured Interface Type)

Context

Interface-based VLAN assignment is the simplest and most effective method. VLANs are assigned based on interfaces. After an interface is added to a VLAN, the interface can forward packets from the VLAN. Interface-based VLAN assignment allows hosts in the same VLAN to communicate and prevents hosts in different VLANs from communicating, thereby limiting broadcast packets to a single VLAN.

Ethernet interfaces are classified as access, trunk, and hybrid interfaces according to the devices connected to the Ethernet interfaces and number of VLANs from which untagged frames are permitted (see Interface Types):
  • Access interface

    A switch processes only tagged frames, but an access interface connected to devices can only receive and send untagged frames. Therefore, you must configure the default VLAN for the access interface to add the access interface to that VLAN. Then the access interface can add a VLAN tag to received frames.

    An access interface needs to process only untagged frames. If a user connects a switching device to a user-side interface without permission, the user-side interface may receive tagged frames. You can configure the user-side interface to discard tagged frames, preventing unauthorized access.

  • Trunk interface

    When a trunk interface connects to a device such as an AP or a voice terminal that can receive and send tagged and untagged frames simultaneously, you need to configure the default VLAN for the trunk interface so that the trunk interface can add the VLAN tag to untagged frames.

  • Hybrid interface

    When a hybrid interface connects to an AP, a voice terminal, a hub, a host, or a server that sends untagged frames to the switch, you need to configure the default VLAN for the hybrid interface so that the hybrid interface can add the VLAN tag to untagged frames.

    Frames sent by a switch all carry VLAN tags. In some scenarios, hybrid interfaces are needed for removing VLAN tags from frames sent by the switch. For example, in VLAN stacking scenarios, the outer VLAN tags of packets from multiple VLANs on an ISP network need to be removed before they enter a user network. A trunk interface allows untagged packets from only one VLAN, so the interface must be configured as a hybrid interface. For details about VLAN stacking, see QinQ Configuration.

By default, the type of an interface is negotiation-auto.

Procedure

  • Configuring the default VLAN for an access interface

    1. Run:

      system-view

      The system view is displayed.

    2. Run:

      vlan vlan-id

      A VLAN is created and the VLAN view is displayed, or the view of an existing VLAN is displayed.

    3. Run:

      quit

      Return to the system view.

    4. Run:

      interface interface-type interface-number

      The view of the Ethernet interface to be added to the VLAN is displayed.

    5. Run:

      port link-type access

      The Ethernet interface is configured as the access interface.

    6. Run:

      port default vlan vlan-id

      The default VLAN is configured for the interface and the interface is added to the specified VLAN.

    7. (Optional) Run:

      port discard tagged-packet

      The interface is configured to discard incoming tagged packets.

  • Configuring the default VLAN for a trunk interface

    1. Run:

      system-view

      The system view is displayed.

    2. Run:

      vlan vlan-id

      A VLAN is created and the VLAN view is displayed, or the view of an existing VLAN is displayed.

    3. Run:

      quit

      Return to the system view.

    4. Run:

      interface interface-type interface-number

      The view of the Ethernet interface to be added to the VLAN is displayed.

    5. Run:

      port link-type trunk

      The Ethernet interface is configured as the trunk interface.

    6. Run:

      port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }

      The interface is added to the specified VLAN.

    7. (Optional) Run:

      port trunk pvid vlan vlan-id

      The default VLAN is configured for the trunk interface.

    NOTE:

    When the VLAN allowed by an interface is the default VLAN of the interface, packets from the VLAN are forwarded in untagged mode.

  • Configuring the default VLAN for a hybrid interface

    1. Run:

      system-view

      The system view is displayed.

    2. Run:

      vlan vlan-id

      A VLAN is created and the VLAN view is displayed, or the view of an existing VLAN is displayed.

    3. Run:

      quit

      Return to the system view.

    4. Run:

      interface interface-type interface-number

      The view of the Ethernet interface to be added to the VLAN is displayed.

    5. Run:

      port link-type hybrid

      The Ethernet interface is configured as the hybrid interface.

    6. Run the following commands as required.

      • Run:

        port hybrid untagged vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }

        The hybrid interface is added to the VLAN in untagged mode.

      • Run:

        port hybrid tagged vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }

        The hybrid interface is added to the VLAN in tagged mode.

    7. (Optional) Run:

      port hybrid pvid vlan vlan-id

      The default VLAN is configured for the hybrid interface.

Configuration Tips

Creating VLANs in a batch

To create multiple VLANs in a batch, run the vlan batch command in the system view.

For example:
  • Create 10 contiguous VLANs: VLAN 11 to VLAN 20.
    <HUAWEI> system-view
    [HUAWEI] vlan batch 11 to 20 
    
  • Create 10 incontiguous VLANs in a batch: VLAN 10, VLANs 15 to 19, VLAN 25, VLANs 28 to VLAN 30.
    <HUAWEI> system-view
    [HUAWEI] vlan batch 10 15 to 19 25 28 to 30
    
    NOTE:

    You can create a maximum of 10 incontiguous VLANs or VLAN range at one time. If there are more than 10 VLANs, run this command multiple times. For example, the vlan batch 10 15 to 19 25 28 to 30 command creates four incontiguous VLAN ranges.

Configuring a name for a VLAN

When multiple VLANs are created on the device, you can configure names for the VLANs to facilitate management. After a name is configured for a VLAN, you can directly enter the VLAN view using the name.

# Set the name of VLAN 10 to huawei.

<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] name huawei
[HUAWEI-vlan10] quit

# After a name is configured for a VLAN, you can directly enter the VLAN view using the name.

[HUAWEI] vlan vlan-name huawei
[HUAWEI-vlan10] quit
Adding interfaces to a VLAN in a batch

Use a port group to perform the same VLAN configuration for multiple Ethernet interfaces. To add access interfaces to a VLAN in a batch, you can also run the port interface-type { interface-number1 [ to interface-number2 ] }&<1-10> command in the VLAN view. For details, see How Do I Add Interfaces to a VLAN in a Batch?.

Restoring the default VLAN configuration of an interface

If the VLAN planning of an interface is changed, you need to delete the original VLAN configuration of the interface. If many incontiguous VLANs are configured on the interface, you need to delete the original VLAN configuration multiple times. To reduce the workload, you can restore the default VLAN configuration of the interface. For details, see How Do I Restore the Default VLAN Configuration of an Interface?.

Changing the interface type

When the interface planning changes or the current interface type is different from the configured one, the interface type needs to be changed. For details, see How Do I Change the Link Type of an Interface?.

Deleting a VLAN

If a VLAN is not in use, you are advised to delete it immediately to save VLAN resources and reduce packets on a network. For details, see How Do I Delete a Single VLAN or VLANs in a Batch?.

Checking the Configuration

  • Run the display port vlan [ interface-type interface-number | active ] * command in any view to check information about interfaces of the VLAN.
  • Run the display vlan command in any view to check information about VLANs.
Translation
Download
Updated: 2019-08-21

Document ID: EDOC1000142081

Views: 274022

Downloads: 421

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