Using the ip-subnet-vlan command, you can associate an IP subnet with a VLAN.
Using the undo ip-subnet-vlan command, you can disassociate an IP subnet from a VLAN.
By default, a VLAN is not associated with any IP subnet.
ip-subnet-vlan [ ip-subnet-index ] ip ip-address { mask | mask-length } [ priority priority ]
undo ip-subnet-vlan { ip-subnet-index [ to ip-subnet-end ] | all }
Parameter |
Description |
Value |
---|---|---|
ip-subnet-index |
Specifies the index of an IP subnet. It can be set manually or automatically generated by the system according to the order in which IP subnets were associated with a VLAN. |
The value is an integer that ranges from 1 to 12. |
ip ip-address { mask | mask-length } |
Specifies the source IP address or network segment associated with a VLAN.
|
|
priority priority |
Specifies the 802.1p priority of the VLAN associated with an IP address or subnet. |
The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority. The default value is 0. |
to ip-subnet-end |
Specifies the end subnet index. |
The value is an integer that ranges from 1 to 12 and must be greater than or equal to ip-subnet-index. |
all |
Disassociates all the IP subnets from a VLAN. |
- |
Usage Scenario
The ip-subnet-vlan command associates IP subnets 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.
Follow-up Procedure
Add an interface to the VLAN and enable IP subnet-based VLAN assignment on the interface.
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.
If you run the ip-subnet-vlan command multiple times in the same VLAN view, all the specified IP subnets are associated with the VLAN.
The control VLAN of an RRPP ring cannot be associated with IP subnets.
The IP subnet or the IP address associated with a VLAN cannot be a multicast network segment or multicast address.