By configuring the VLAN based on IP subnet, the packet sent by the specified network segment or IP address is transmitted in the specified VLAN, which reduces the initial configuration task of the network administrator and facilitates the management. has a variety of businesses, such as IPTV, VoIP, Internet, etc. Each business USES different IP addresses. In order to facilitate management, it is necessary to divide the same type of business into the same VLAN and different types of business into different VLans.
Switch receives user messages including data, IPTV, voice and other services. The IP address
address of user devices is different. Now it is necessary to divide different types of business into different vlans and shunt them to different remote servers
through different VLAN ids to achieve business interoperability.
configuration idea
USES the following idea to configure the VLAN based on IP subnet partition:
creates a VLAN to determine the VLAN to which each service belongs.
associates IP subnets and vlans. The
switch determines the VLAN based on the source IP address or the specified network segment in the message. New sites do not need much
configuration when they are connected to the network, and switches automatically partition each site into a different VLAN based on its network address.
allows IP subnetwork-based vlans to pass through the current port.
configure the priority of VLAN partitioning to ensure that the priority is selected to divide the VLAN based on the IP subnet.
enables VLAN partitioning based on IP subnet.
data preparation
to complete this configuration example, prepare the following data.
configuration interface ge0/0/1 is untagged with VLAN100, VLAN200 and VLAN300.
configuration interface ge0/0/2, ge0/0/3 and ge0/0/4 are tagged with VLAN100, VLAN200
and VLAN300, respectively. Create VLAN
create VLAN100, VLAN200, and VLAN300 on the Switch.
system-view
[Quidway] vlan batch 100 200 300
configuration interface
configure interface ge0/0/1 on Switch as Hybrid type, and add VLAN100, VLAN200 and
VLAN300.
[Quidway] interface gigabitethernet 0/0/1
[Quidway-GigabitEthernet0/0/1] port link-type hybrid
[Quidway-GigabitEthernet0/0/1] port hybrid untagged vlan 100 200 300
[quidway-gigabitethernet0/0/1] quit
configure the interface ge0/0/2 on the Switch to join VLAN100.
[Quidway] interface gigabitethernet 0/0/2
[Quidway-GigabitEthernet0/0/2] port link-type trunk
[Quidway-GigabitEthernet0/0/2] port trunk allow-pass vlan 100
[quidway-gigabitethernet0/0/2] quit
configure the interface ge0/0/3 on the Switch to join VLAN200.
[Quidway] interface gigabitethernet 0/0/3
[Quidway-GigabitEthernet0/0/3] port link-type trunk
[Quidway-GigabitEthernet0/0/3] port trunk allow-pass vlan 200
Quidway-gigabitethernet0/0/3] quit
configure the interface ge0/0/4 on the Switch to join VLAN300.
[Quidway] interface gigabitethernet 0/0/4
[Quidway-GigabitEthernet0/0/4] port link-type trunk
[Quidway-GigabitEthernet0/0/4] port trunk allow-pass vlan 300
Quidway-gigabitethernet0/0/4] quit
configure the interface ge0/0/1 on the Switch so that VLAN function can be divided based on IP subnet.
[Quidway] interface gigabitethernet 0/0/1
[quidway-gigabitethernet0/0/1] enable
[quidway-gigabitethernet0/0/1] quit
configuration based on IP subnet partition vlan
to configure VLAN100 and IP address on the Switch 192.168.1.2 Association, priority 2.
[Quidway] vlan100
[quidway-vlan100] ip-subnet-vlan 1 IP 192.168.1.2 24 priority 2
[quidway-vlan100] quit
configure VLAN200 to be associated with IP address 192.168.2.2 on the Switch with priority 3.
[Quidway] vlan200
[quidway-vlan200] ip-subnet-vlan 1 IP 192.168.2.2 24 priority 3
[quidway-vlan200] quit
configure VLAN300 to associate with IP address 192.168.3.2 on the Switch with priority 4.
[Quidway] vlan300
[Quidway] vlan 1 IP 192.168.3.2 24 priority 4
[quidway-vlan300] quit
verify configuration result
execute the following command on the Switch
[Quidway] display ip-subnet-vlan vlan all