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

Configuration Guide - Ethernet Switching

S1720, S2700, S5700, and S6720 V200R012(C00 and C20)

This document describes the configuration of Ethernet services, including configuring MAC address table, link aggregation, VLANs, VLAN aggregation, MUX VLAN, VLAN termination, Voice VLAN, VLAN mapping, QinQ, GVRP, VCMP, STP/RSTP/MSTP, VBST, SEP, RRPP, ERPS, LBDT, and Layer 2 protocol transparent transmission.
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 of assigning VLANs. With interface-based VLAN assignment, an interface is added to a VLAN, after which the interface can forward packets from the VLAN. Interface-based VLAN assignment allows hosts in the same VLAN to communicate at Layer 2 and prevents hosts in different VLANs from communicating, limiting broadcast packets to within a VLAN.

Ethernet interfaces are classified into access, trunk, and hybrid interfaces. The type of interface determines the objects that can connect to the Ethernet interface and number of VLANs from which untagged frames are permitted (for more details, see Interface Types):
  • Access interface

    Internally, switches can only process tagged frames, yet access interfaces connected to devices only receive and send untagged frames. For this reason, in order for the switch to be able to process the frames, an access interface needs to add a VLAN tag to received frames. To achieve this, you must configure the default VLAN, after which the access interface joins the VLAN.

    An access interface processes only untagged frames, discarding tagged frames. To prevent a user from connecting a switch to a user-side interface without permission, you can configure the user-side interface as an access interface. In this way, the interface will discard incoming tagged frames to prevent unauthorized access.

  • Trunk interface

    A trunk interface can connect to a device that can receive and send tagged and untagged frames simultaneously, such as an AP or a voice terminal. You need to configure a default VLAN for the trunk interface, which can then add the corresponding VLAN tag to untagged frames.

  • Hybrid interface

    A hybrid interface can connect to an AP, a voice terminal, a hub, a host, or a server that sends untagged frames to the switch. You need to configure a default VLAN for the hybrid interface, which can then add the corresponding VLAN tag to untagged frames.

    Typically, frames sent by a switch all carry VLAN tags. However, in some scenarios, VLAN tags need to be removed from frames sent by the switch. For example, in VLAN stacking scenarios, before packets from multiple VLANs on a carrier network enter a user network, outer VLAN tags need to be removed from the packets. Trunk interfaces cannot fulfill this purpose as they allow untagged packets from only one VLAN. Therefore, in this situation, the interface must be configured as hybrid, which allows untagged packets from multiple VLANs. For details about VLAN stacking, see QinQ Configuration.

On the S1720GF, S1720GFR, S1720GW, S1720GW-E, S1720GWR, S1720GWR-E, S1720X, S1720X-E, S2720EI, S2750, S5700LI, S5700S-LI, S5710-X-LI, S5720I-SI, S5720LI, S5720S-LI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720LI, S6720S-LI, S6720S-SI, and S6720SI, the type of an interface is negotiation-auto by default. On other models, the type of an interface is negotiation-desirable by default.

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. If the specified VLAN has been created, the VLAN view is directly 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 an 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. If the specified VLAN has been created, the VLAN view is directly 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 a 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:

    If the VLAN allowed by an interface is the default VLAN of the interface, packets from the VLAN are forwarded as untagged.

  • 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. If the specified VLAN has been created, the VLAN view is directly 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 a 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

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 Adding 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 non-contiguous VLANs are configured on the interface, you will need to perform the delete operation multiple times. To reduce the workload, you can restore the default VLAN configuration of the interface. For details, see Restoring 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 Changing the Link Type of an Interface.

Deleting a VLAN

If a VLAN is not in use, it is recommended to delete it to save VLAN resources and reduce packets on a network. For details, see Deleting a VLAN or VLANs in a Batch.

Verifying 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: 2018-12-24

Document ID: EDOC1100038339

Views: 155675

Downloads: 674

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