CloudEngine S3700, S5700, and S6700 V600R024C00 Configuration Guide - Ethernet Switching Configuration

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

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

Prerequisites

Before configuring interface-based VLAN assignment, you have completed the following task:

Context

Interface-based VLAN assignment is the easiest and most effective method for assigning VLANs. After you add an interface to a VLAN, the interface can only forward packets from that VLAN. This limits broadcast packets to a single VLAN, as hosts in the same VLAN can directly communicate with each other at Layer 2, while those in different VLANs cannot. Before starting this operation, you need to know the interface type, default VLAN, and mode in which interfaces process tagged or untagged packets. For details, see Understanding VLANs.

Procedure

  1. Enter the system view.

    system-view

  2. Enter the view of the Ethernet interface to be added to a VLAN.

    interface interface-type interface-number

  3. Switch the interface working mode to Layer 2.

    portswitch

    Determine whether to perform this step based on the current interface working mode.

    Only interfaces on the S6780-H, S6750-H, S6730-H-V2, S6750-S, S5732-H-V2 , S5755-H series can be switched from Layer 3 mode to Layer 2 mode using the portswitch command.

  4. Configure the attribute for the Layer 2 Ethernet interface.

    port link-type { access | hybrid | trunk }

  5. Add the interface to a VLAN.

    • For an access interface, choose either of the following methods:
      Configure the default VLAN for the access interface and add the interface to the default VLAN.
      port default vlan vlan-id

      To configure the default VLAN for multiple interfaces and add these interfaces to the default VLAN in batches, run the following command in the VLAN view:

      port interface-type { interface-number1 [ to interface-number2 ] } &<1-10>
    • For a trunk interface, add it to specified VLANs in tagged mode.
      port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] } &<1-40> | all }

      To change the default VLAN of a trunk interface, run the port trunk pvid vlan vlan-id command in the interface view.

    • For a hybrid interface, add it to a VLAN in either untagged or tagged mode.
      Add the hybrid interface to a specified VLAN in untagged mode.
      port hybrid untagged vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }
      Add the hybrid interface to a specified VLAN in tagged mode.
      port hybrid tagged vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }

      To change the default VLAN of a hybrid interface, run the port hybrid pvid vlan vlan-id command in the interface view.

Verifying the Configuration

  • Run the display vlan vlan-id1 [ verbose | to vlan-id2 ] command to check information about specified VLANs.
  • Run the display vlan [ summary ] command to check the summary of all VLANs.
  • Run the display vlan vlan-name vlan-name command to check information about a specified VLAN.