This example describes how to configure communication between VLAN users and non-VLAN users.
Users in a community belong to different network segments. The network administrator in the community adds the users to different VLANs to simplify management. However, users in another community are not added to any VLAN. VLAN users must be able to communicate with non-VLAN users.
On the network shown in Figure 1, users in community 1 belong to different VLANs and network segments, and users in community 2 do not belong to any VLAN. It is required that users in VLAN 10 be able to communicate with users in community 2.
The configuration roadmap is as follows:
Create sub-interfaces on the PE and associate the sub-interfaces with VLANs so that the sub-interfaces can identify packets carrying VLAN tags.
Assign IP addresses to interfaces for communication at the network layer.
To complete the configuration, you need the following data:
VLAN ID associated with the PE sub-interface
IP address of the PE sub-interface
<HUAWEI> system-view [~HUAWEI] sysname PE [*HUAWEI] commit [~PE] interface gigabitethernet 0/1/1 [~PE-GigabitEthernet0/1/1] undo shutdown [*PE] interface gigabitethernet 0/1/1.1 [*PE-GigabitEthernet0/1/1.1] vlan-type dot1q 10
[*PE-GigabitEthernet0/1/1.1] ip address 10.110.2.5 24 [*PE-GigabitEthernet0/1/1.1] quit [*PE] interface gigabitethernet 0/1/9 [*PE-GigabitEthernet0/1/9] undo shutdown [*PE-GigabitEthernet0/1/9] ip address 10.110.3.5 24 [*PE-GigabitEthernet0/1/9] quit [*PE] commit
On PCs in VLAN 10, configure the IP address 10.110.2.5/24 of GE 0/1/1.1 as the default gateway address.
On CE 2, configure the IP address 10.110.3.5 of GE 0/1/9 as the default gateway address.
After the configurations are complete, users in VLAN 10 and non-VLAN users can ping each other.