Example for Configuring VLAN ID-based 1:1 VLAN Mapping
Networking Requirements
Users in different communities use the same services, such as the web, IPTV, and VoIP services. To facilitate management, the network administrator of each community adds different services to different VLANs. For communities in different VLANs to use the same services, communication between VLANs must be implemented.
In Figure 11-5, community 1 and community 2 have the same services, but belong to different VLANs. Communication between them needs to be implemented with low costs.
Configuration Roadmap
The configuration roadmap is as follows:
Add the switch port connecting to community 1 to VLAN6 and add the switch port connecting to community 2 to VLAN5.
Configure VLAN mapping on GE1/0/1 of PE1 and PE2 and map C-VLAN IDs to S-VLAN IDs so that users in different VLANs can communicate with each other.
Procedure
- Add downlink interfaces on switches to specified VLANs.
# Configure CE1.
<HUAWEI> system-view [HUAWEI] sysname CE1 [CE1] vlan 6 [CE1-vlan6] quit [CE1] interface gigabitethernet 1/0/1 [CE1-GigabitEthernet1/0/1] port link-type access [CE1-GigabitEthernet1/0/1] port default vlan 6 [CE1-GigabitEthernet1/0/1] quit [CE1] interface gigabitethernet 1/0/2 [CE1-GigabitEthernet1/0/2] port link-type access [CE1-GigabitEthernet1/0/2] port default vlan 6 [CE1-GigabitEthernet1/0/2] quit [CE1] interface gigabitethernet 1/0/3 [CE1-GigabitEthernet1/0/3] port link-type trunk [CE1-GigabitEthernet1/0/3] port trunk allow-pass vlan 6 [CE1-GigabitEthernet1/0/3] quit
# Configure CE2.
<HUAWEI> system-view [HUAWEI] sysname CE2 [CE2] vlan 5 [CE2-vlan5] quit [CE2] interface gigabitethernet 1/0/1 [CE2-GigabitEthernet1/0/1] port link-type access [CE2-GigabitEthernet1/0/1] port default vlan 5 [CE2-GigabitEthernet1/0/1] quit [CE2] interface gigabitethernet 1/0/2 [CE2-GigabitEthernet1/0/2] port link-type access [CE2-GigabitEthernet1/0/2] port default vlan 5 [CE2-GigabitEthernet1/0/2] quit [CE2] interface gigabitethernet 1/0/3 [CE2-GigabitEthernet1/0/3] port link-type trunk [CE2-GigabitEthernet1/0/3] port trunk allow-pass vlan 5 [CE2-GigabitEthernet1/0/3] quit
- Configure VLAN mapping on the GE1/0/1 of PE1 and PE2.
# Configure PE1.
<HUAWEI> system-view [HUAWEI] sysname PE1 [PE1] vlan 10 [PE1-vlan10] quit [PE1] interface gigabitethernet 1/0/1 [PE1-GigabitEthernet1/0/1] port link-type trunk [PE1-GigabitEthernet1/0/1] port trunk allow-pass vlan 10 [PE1-GigabitEthernet1/0/1] port vlan-mapping vlan 6 map-vlan 10 [PE1-GigabitEthernet1/0/1] quit
# Configure PE2.
<HUAWEI> system-view [HUAWEI] sysname PE2 [PE2] vlan 10 [PE2-vlan10] quit [PE2] interface gigabitethernet 1/0/1 [PE2-GigabitEthernet1/0/1] port link-type trunk [PE2-GigabitEthernet1/0/1] port trunk allow-pass vlan 10 [PE2-GigabitEthernet1/0/1] port vlan-mapping vlan 5 map-vlan 10 [PE2-GigabitEthernet1/0/1] quit
- Verify the configurations.
Verify that users in community 1 and community 2 can communicate with each other.
Configuration Files
CE1 configuration file
# sysname CE1 # vlan batch 6 # interface GigabitEthernet1/0/1 port link-type access port default vlan 6 # interface GigabitEthernet1/0/2 port link-type access port default vlan 6 # interface GigabitEthernet1/0/3 port link-type trunk port trunk allow-pass vlan 6 # return
CE2 configuration file
# sysname CE2 # vlan batch 5 # interface GigabitEthernet1/0/1 port link-type access port default vlan 5 # interface GigabitEthernet1/0/2 port link-type access port default vlan 5 # interface GigabitEthernet1/0/3 port link-type trunk port trunk allow-pass vlan 5 # return
PE1 configuration file
# sysname PE1 # vlan batch 10 # interface GigabitEthernet1/0/1 port link-type trunk port trunk allow-pass vlan 10 port vlan-mapping vlan 6 map-vlan 10 # return
PE2 configuration file
# sysname PE2 # vlan batch 10 # interface GigabitEthernet1/0/1 port link-type trunk port trunk allow-pass vlan 10 port vlan-mapping vlan 5 map-vlan 10 # return