Subnet-based VLAN assignment on S series switch

2

Example of configuring IP subnet-based VLAN assignment for S series switches (except S1700 switches):
1. Configuration roadmap
1) Create VLANs, and add an interface to the VLANs so that the interface allows packets of IP subnet-based VLANs to pass through.
2) Enable IP subnet-based VLAN assignment on the interface, and associate IP subnets with the VLANs, so that the switch can determine the VLANs to which received packets belong according to the source IP addresses or specified subnets in the packets.
2. Configuration procedure
1) Create VLANs.
[HUAWEI] vlan batch 100 200 //Create VLAN100 and VLAN 200.
2) Configure an interface.
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type hybrid //Set the interface type to hybrid.
[HUAWEI-GigabitEthernet0/0/1] port hybrid untagged vlan 100 200 //Add the interface to VLAN 100 and VLAN 200 in untagged mode.
[HUAWEI-GigabitEthernet0/0/1] ip-subnet-vlan enable //Enable IP subnet-based VLAN assignment on the interface.
[HUAWEI-GigabitEthernet0/0/1] quit
3) Associate IP subnets with VLANs.
[HUAWEI] vlan 100
[HUAWEI-vlan100] ip-subnet-vlan 1 ip 192.168.1.2 24 priority 2 //Associate IP subnet 192.168.1.2/24 with VLAN 100 and set the 802.1p priority of VLAN 100 to 2.
[HUAWEI-vlan100] quit
[HUAWEI] vlan 200
[HUAWEI-vlan200] ip-subnet-vlan 1 ip 192.168.2.2 24 priority 3
[HUAWEI-vlan200] quit

Other related questions:
Protocol-based VLAN assignment on S series switch
Example of configuring protocol-based VLAN assignment for S series switches (except S1700 switches): 1. Configuration roadmap 1). Create a VLAN and determine the VLAN to which each service belongs. 2). Associate a protocol with the VLAN, so that the switch can determine the VLAN ID of a received packet according to the protocol (or protocol suite) of the packet. 3. Add interfaces to the VLAN, so that the packets of the protocol-based VLAN can pass through the interfaces. 4. Associate interfaces with the protocol-based VLAN. The system then determines the VLAN ID of a received packet according to the association between the protocol type of the packet and the VLAN. 2. Configuration procedure 1) Create a VLAN. [HUAWEI] vlan batch 10 2) Associate a protocol with the VLAN. [HUAWEI] vlan 10 [HUAWEI-vlan10] protocol-vlan ipv4 #Associate IPv4 with VLAN 10. [HUAWEI-vlan10] quit 3) Associate an interface with the protocol-based VLAN. [HUAWEI] interface gigabitethernet 0/0/2 [HUAWEI-GigabitEthernet0/0/2] protocol-vlan vlan 10 all priority 5 #Associate GE0/0/2 with VLAN 10 and set the 802.1p priority of VLAN 10 to 5. [HUAWEI-GigabitEthernet0/0/2] quit 4) Configure interfaces. [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type trunk [HUAWEI-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 #Configure the interface to allow packets of VLAN 10 to pass through. [HUAWEI-GigabitEthernet0/0/1] quit [HUAWEI] interface gigabitethernet 0/0/2 [HUAWEI-GigabitEthernet0/0/2] port link-type hybrid [HUAWEI-GigabitEthernet0/0/2] port hybrid untagged vlan 10 #Configure the interface to allow packets of VLAN 10 to pass through in untagged mode.

Policy-based VLAN assignment on S series switch
Example of configuring policy-based VLAN assignment for S series switches (except S1700 switches): 1. Create a VLAN. [HUAWEI] vlan batch 10 2. Configure a policy for the VLAN. [HUAWEI] vlan 10 [HUAWEI-vlan10] policy-vlan mac-address 0-1-1 ip 1.1.1.1 priority 7 //Bind MAC address 0-1-1 and IP address 1.1.1.1 to VLAN 10, and set the 802.1p priority of VLAN 10 to 7. [HUAWEI-vlan10] quit 3. Configure the interface to allow packets of VLAN 10 to pass through. [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type hybrid [HUAWEI-GigabitEthernet0/0/1] port hybrid untagged vlan 10 [HUAWEI-GigabitEthernet0/0/1] quit

MAC-based VLAN assignment on S series switch
Example of configuring MAC address-based VLAN assignment for S series switches (except S1700 switches): 1. Configuration roadmap 1). Create a VLAN and determine the VLAN to which employees belong. 2). Configure the modes in which interfaces are added to the VLAN, so that the interfaces allow packets of the VLAN to pass through. 3). Associate the MAC address with the VLAN, so that the switch can determine the VLAN to which received packets belong according to the source MAC address in the packets. 2. Configuration procedure [HUAWEI] vlan batch 10 //Create a VLAN. [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type hybrid [HUAWEI-GigabitEthernet0/0/1] port hybrid tagged vlan 10 //Add an uplink interface to the VLAN in tagged mode. [HUAWEI-GigabitEthernet0/0/1] quit [HUAWEI] interface gigabitethernet 0/0/2 [HUAWEI-GigabitEthernet0/0/2] port link-type hybrid [HUAWEI-GigabitEthernet0/0/2] port hybrid untagged vlan 10 //Add a downlink interface to the VLAN in untagged mode. [HUAWEI-GigabitEthernet0/0/2] quit [HUAWEI] vlan 10 [HUAWEI-vlan10] mac-vlan mac-address 22-22-22 //Associate the PC's MAC address with VLAN 10. [HUAWEI-vlan10] quit [HUAWEI] interface gigabitethernet 0/0/2 [HUAWEI-GigabitEthernet0/0/2] mac-vlan enable //Enable MAC address-based VLAN assignment on the downlink interface. [HUAWEI-GigabitEthernet0/0/2] quit

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top