Sie sind auf Seite 1von 3

Example for Configuring IP Subnet-based VLANs Page 1 of 3

Example for Configuring IP Subnet-based VLANs


Networking Requirements

A carrier allocates IP subnets based on service types. Users on different IP subnets access the upstream
server through different paths.
As shown in Figure 1, the Switch receives packets of multiple services such as data services, IPTV
services, and voice services. The terminals of these services use different IP addresses. It is required that
IP subnet-based VLANs be configured on the Switch so that GE 0/0/1 of the Switch can allocate
corresponding VLAN IDs to packets with different source IP addresses and send the packets to the
upstream destination device.
Figure 1 Networking of IP subnet-based VLANs

Configuration Roadmap

The configuration roadmap is as follows:

1. Create VLANs.
2. Set the link type of GE 0/0/1 to hybrid and add it to specified VLANs so that it allows packets of these
VLANs to pass through.
3. Add GE 0/0/2, GE 0/0/3, and GE 0/0/4 to the VLANs.
4. Associate IP subnets with the VLANs and enable the IP subnet-based VLAN function.

Data Preparation

To complete the configuration, you need the following data:

 VLANs to which GE 0/0/1 needs to be added in untagged mode: VLAN 100, VLAN 200, and VLAN 300
 VLANs to which GE 0/0/1, GE 0/0/3, and GE 0/0/4 need to be added in tagged mode respectively:
VLAN 100, VLAN 200, and VLAN 300
 Configuration data of IP subnet-based VLANs, as shown in Table 1

Table 1 Configuration data of IP subnet-based VLANs


VLAN ID IP Subnet Index Source IP Subnet Mask 802.1p Priority

mk:@MSITStore:C:\DOCUME~1\VaneDG\CONFIG~1\Temp\Rar$DI... 18/03/2011
Example for Configuring IP Subnet-based VLANs Page 2 of 3

Address

100 1 192.168.1.2 255.255.255.0 2

200 1 192.168.2.2 255.255.255.0 3

300 1 192.168.3.2 255.255.255.0 4

Procedure

1. Create VLANs.
# Create VLAN 100, VLAN 200, and VLAN 300 on the Switch.
<Quidway> system-view
[Quidway] vlan batch 100 200 300
2. Configure interfaces.
# Set the link type of GE 0/0/1 to hybrid and add it to VLAN 100, VLAN 200, and VLAN 300.
[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
# Add GE 0/0/2 of the Switch to VLAN 100.
[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
# Add GE 0/0/3 of the Switch to VLAN 200.
[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
# Add GE 0/0/4 of the Switch to VLAN 300.
[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
# Enable the IP subnet-based VLAN function on GE 0/0/1.
[Quidway] interface gigabitethernet 0/0/1
[Quidway-GigabitEthernet0/0/1] ip-subnet-vlan enable
[Quidway-GigabitEthernet0/0/1] quit
3. Configure IP subnet-based VLANs.
# Associate 192.168.1.2 to VLAN 100 and set the 802.1p priority of VLAN 100 to 2.
[Quidway] vlan 100
[Quidway-vlan100] ip-subnet-vlan 1 ip 192.168.1.2 24 priority 2
[Quidway-vlan100] quit
# Associate 192.168.2.2 to VLAN 200 and set the 802.1p priority of VLAN 200 to 3.
[Quidway] vlan 200
[Quidway-vlan200] ip-subnet-vlan 1 ip 192.168.2.2 24 priority 3
[Quidway-vlan200] quit
# Associate IP subnet 192.168.3.2 to VLAN 100 and set the 802.1p priority of VLAN 300 to 4.
[Quidway] vlan 300
[Quidway-vlan300] ip-subnet-vlan 1 ip 192.168.3.2 24 priority 4
[Quidway-vlan300] quit
4. Verify the configuration.
Run the display ip-subnet-vlan vlan all command on the Switch. The following information is

mk:@MSITStore:C:\DOCUME~1\VaneDG\CONFIG~1\Temp\Rar$DI... 18/03/2011
Example for Configuring IP Subnet-based VLANs Page 3 of 3

displayed:
[Quidway] display ip-subnet-vlan vlan all
----------------------------------------------------------------
Vlan Index IpAddress SubnetMask Priority
----------------------------------------------------------------
100 1 192.168.1.2 255.255.255.0 2
200 1 192.168.2.2 255.255.255.0 3
300 1 192.168.3.2 255.255.255.0 4
----------------------------------------------------------------
ip-subnet-vlan count: 3 total count: 3

Configuration Files

 Configuration file of the Switch


#
sysname Quidway
#
vlan batch 100 200 300
#
vlan 100
ip-subnet-vlan 1 ip 192.168.1.2 255.255.255.0 priority 2
#
vlan 200
ip-subnet-vlan 1 ip 192.168.2.2 255.255.255.0 priority 3
#
vlan 300
ip-subnet-vlan 1 ip 192.168.3.2 255.255.255.0 priority 4
#
interface GigabitEthernet0/0/1
port hybrid untagged vlan 100 200 300
ip-subnet-vlan enable
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 200
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 300
#
return

Parent topic: VLAN Configuration

Huawei Proprietary and Confidential


Copyright © Huawei Technologies Co., Ltd.

mk:@MSITStore:C:\DOCUME~1\VaneDG\CONFIG~1\Temp\Rar$DI... 18/03/2011

Das könnte Ihnen auch gefallen