< Home

Configuring Layer-3 Subinterfaces to Enable VLANs to Communicate

This section describes how to configure Layer-3 subinterfaces to enable VLANs to communicate.

Context

The most direct method for inter-VLAN communication is connecting VLANs to different Layer-3 interfaces to route the packets between VLANs. However, this method requires physical interfaces. In contrast, creating Ethernet subinterfaces can avoid the use of more physical interfaces.

Ethernet and Eth-Trunk interfaces support subinterfaces.

You can configure multiple subinterfaces on a single physical interface and ensure that each subinterface is assigned to a specific VLAN. VLANs can communicate after being connected to only as single physical interface.

Inter-VLAN communication through Layer-3 subinterfaces applies only when the hosts in each VLAN are located in different network segments. If the hosts of VLANs are located in the same network segment, inter-VLAN communication can be implemented through Layer-2 interfaces. For details, see Configuring Inter-VLAN Communication Using Layer-2 Subinterfaces.

Procedure

  1. Access the system view.

    system-view

  2. Create a subinterface and access the subinterface view.

    interface interface-type interface-number.subinterface-number

  3. Set the encryption type and the VLAN ID of the subinterface.

    vlan-type dot1q vlan-id

  4. Assign an IP address to the subinterface.

    ip address ip-address { mask | mask-length } [ sub ]

    The subinterface and its main interface can be on the same primary network segment but must use different subnet masks.

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