< Home

Configuring Inter-VLAN Communication Using Layer-2 Subinterfaces

This section describes how to implement inter-VLAN communication by configuring Layer-2 subinterfaces.

Context

The device supports creating subinterfaces on Layer-2 Ethernet and Layer-2 Eth-Trunk interfaces. Using a subinterface to terminate a VLAN allows for inter-VLAN forwarding.

Procedure

  1. Access the system view.

    system-view

  2. Switch the Layer-3 Ethernet interface to a Layer-2 Ethernet interface.
    1. Access the interface view.

      interface interface-type interface-number

    2. Configure a Layer-3 Ethernet interface to work in Layer-2 mode.

      portswitch

    3. Return to the system view.

      quit

  3. Create Layer-2 subinterfaces.
    1. Create a subinterface and access the subinterface view.

      interface interface-type interface-number.subinterface-number

    2. Configure the encapsulation type for the subinterface and associate a VLAN ID with the subinterface.

      vlan-type dot1q vlan-id

      Each subinterface receives or forwards only packets that carry the specified VLAN tag.

    3. Configure the subinterface as a Layer-2 subinterface.

      portswitch

    4. Return to the system view.

      quit

    5. Repeat the previous substeps to create multiple Layer-2 subinterfaces.
  4. Add the subinterfaces created in 3 to the same VLAN so that the subinterfaces can communicate.
    1. Create a VLAN and access the VLAN view.

      vlan vlan-id

    2. Add the subinterfaces to the same VLAN.

      port interface-type interface-number.subinterface-number command to add the subinterfaces created in 3

      Subinterfaces must be added to the same VLAN to communicate with each other.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic