Configuring IP subnet-based VLANs
In this method, packets are assigned to VLANs based on their source IP addresses and subnet masks. A port configured with IP subnet-based VLANs assigns a received untagged packet to a VLAN based on the source address of the packet.
Use this feature when packets from an IP subnet or IP address must be transmitted in a VLAN.
This feature is available only on hybrid ports, and it processes only untagged packets.
An IP subnet-based VLAN has one or multiple subnets to match inbound packets. Each subnet has a unique index in the IP subnet-based VLAN. All subnets in an IP subnet-based VLAN have the same VLAN ID.
To configure a IP subnet-based VLAN:
Task | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter VLAN view. | vlan vlan-id | N/A |
3. Associate an IP subnet or IP address with the VLAN. | ip-subnet-vlan [ ip-subnet-index ] ip ip-address [ mask ] | By default, a VLAN is not associated with any IP subnets or IP addresses. A multicast subnet or a multicast address cannot be associated with a VLAN. |
4. Return to system view. | quit | N/A |
5. Enter interface view. |
|
|
6. Configure the port link type as hybrid. | port link-type hybrid | By default, all ports are access ports. |
7. Assign the hybrid port to the specified IP subnet-based VLANs. | port hybrid vlan vlan-id-list { tagged | untagged } | By default, a hybrid port is an untagged member of the VLAN to which the port belongs when its link type is access. |
8. Associate the hybrid port with the specified IP subnet-based VLAN. | port hybrid ip-subnet-vlan vlan vlan-id | By default, no IP subnet-based VLAN is associated with a hybrid port. |