< Home

ip-subnet-vlan enable

Function

The ip-subnet-vlan enable command enables IP subnet-based VLAN assignment on an interface.

The undo ip-subnet-vlan enable command disables IP subnet-based VLAN assignment on an interface.

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

Format

ip-subnet-vlan enable

undo ip-subnet-vlan enable

Parameters

None

Views

Ethernet interface view, GE interface view, XGE interface view, 40GE interface view, 100GE interface view, MultiGE interface view, port group view, Eth-Trunk interface view, 25GE interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

IP subnets can be associated with VLANs so that packets from different subnets are transmitted in different VLANs. On a network, if only one service is deployed on each subnet, you can associate IP subnets with VLANs to simplify VLAN configuration. In addition, you can add, modify, and move users on subnets without changing the VLAN configuration.

If IP subnet-based VLAN assignment is enabled on an interface:
  • When receiving an untagged packet, the interface searches for the VLAN entry matching the source IP address of the packet. If a matching entry is found, the interface forwards the packet based on the matching VLAN ID and priority. If no matching entry is found, the interface uses other matching rules to forward the packet.
  • When receiving a tagged packet, the interface forwards the packet based on the port-based VLAN configuration.

Precautions

On the S2720-EI, S5720I-SI, S5720-LI, S5720S-LI, S5720S-SI, and S5720-SI, 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.

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.

When multiple VLAN assignment methods are configured on the device, the device assigns VLANs based on priorities of these methods.

Example

# Enable IP subnet-based VLAN assignment.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type hybrid
[HUAWEI-GigabitEthernet0/0/1] ip-subnet-vlan enable
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >