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


To have a better experience, please upgrade your IE browser.


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 IP Subnet-based VLAN Assignment

Configuring IP Subnet-based VLAN Assignment


IP subnet-based and protocol-based VLAN assignments are types of network layer-based VLAN assignment. They reduce manual VLAN configuration workload and allow users to easily join a VLAN, transfer from one VLAN to another, and exit from a VLAN. IP subnet-based VLAN assignment applies to scenarios where there are high requirements for mobility and simplified management and low requirements for security. For example, when a PC configured with multiple IP addresses needs to access servers on different network segments or when a switch adds PCs to other VLANs when the PCs' IP addresses change.

A switch that has IP subnet-based VLAN assignment enabled processes only untagged frames, and treats tagged frames in the same manner as interface-based VLAN assignment.

After receiving untagged frames from an interface, the switch determines the VLANs that the frames belong to using the source IP addresses or network segments, and then transmits the frames to the specified VLANs.


  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.

    The VLAN ID ranges from 1 to 4094. If VLANs need to be created in a batch, run the vlan batch { vlan-id1 [ to vlan-id2 ] } &<1-10> command. Then run the vlan vlan-id command to enter the view of a specified VLAN.


    If a device is configured with multiple VLANs, it is recommended to configure a name for each VLAN.

    To do so, run the name vlan-name command in the VLAN view. After a VLAN name is configured, run the vlan vlan-name vlan-name command in the system view to enter the corresponding VLAN view.

    The vlan configuration command completes the VLAN configurations before the VLAN is created.

  3. Run ip-subnet-vlan [ ip-subnet-index ] ip ip-address { mask | mask-length } [ priority priority ]

    An IP subnet is associated with a VLAN.

    • ip-subnet-index specifies the index of an IP subnet. The index of an IP subnet can be configured manually or automatically generated by the system according to the order in which IP subnets were originally associated with a VLAN.

    • ip-address specifies the source IP address or network segment associated with a VLAN. The value is in dotted decimal notation.

    • priority specifies the 802.1p priority of a VLAN associated with an IP address or a network segment. The value ranges from 0 to 7. A larger value indicates a higher priority. The default value is 0. After the 802.1p priority of a VLAN associated with an IP address or a network segment is specified, the switch forwards high-priority frames first during network congestion.

  4. Run quit

    Return to the system view.

  5. Configure attributes for the Ethernet interface.

    1. Run interface interface-type interface-number

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

    2. Run port link-type hybrid

      The interface is configured as a hybrid interface.

      On access and trunk interfaces, IP subnet-based VLAN assignment can be used only when the IP subnet-based VLAN is the same as the PVID. It is recommended that IP subnet-based VLAN assignment be configured on hybrid interfaces.

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

      The hybrid interface is configured to allow an IP subnet-based VLAN.

  6. (Optional) Run vlan precedence ip-subnet-vlan

    The device is configured to preferentially use IP subnet-based VLAN assignment.

    By default, the device preferentially uses MAC address-based VLAN assignment.


    Only the S1720X, S1720X-E, S5720EI, S5720I-SI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720EI, S6720LI, S6720S-EI, S6720S-LI, S6720S-SI, and S6720SI support the vlan precedence command.

    S1720X, S1720X-E, S5720I-SI, S5720S-SI, S5720SI, S5730S-EI, S5730SI, S6720LI, S6720S-LI, S6720S-SI, and S6720SI supports the vlan precedence command only in the system view. Other switches support the vlan precedence command only in the interface view.

    On the S5720EI, S6720EI, and S6720S-EI, if both a subnet VLAN and MAC VLAN with a mask are configured, the MAC VLAN with a mask is matched first regardless of whether the vlan precedence command is used.

  7. Run ip-subnet-vlan enable

    IP subnet-based VLAN assignment is enabled.

    By default, IP subnet-based VLAN assignment is disabled.

    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, and S5720SI, when the ip error-packet-check disable command is used to disable IP packet check, IP subnet-based VLAN assignment and policy-based VLAN assignment do not take effect.


    IP subnet-based VLAN assignment is invalid for packets with the VLAN ID of 0 on the S5720HI, S5730HI, and S6720HI.

Verifying the Configuration

  • Run the display ip-subnet-vlan vlan { all | vlan-id1 [ to vlan-id2 ] } command in any view to check information about IP subnets associated with VLANs.
  • Run the display vlan command in any view to check information about VLANs.
Updated: 2018-12-24

Document ID: EDOC1100038339

Views: 168272

Downloads: 701

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