Example for Configuring a QinQ Tunnel

After a QinQ tunnel is configured, an enterprise can set up its own VLANs based on the QinQ tunnel. Branch offices of the same enterprise in different locations can communicate with each other through the VLANs. Offices of different enterprises cannot communicate.

Networking Requirements

On the network shown in Figure 1, enterprise 1 has three offices and enterprise 2 has two offices. Offices of enterprise 1 and enterprise 2 are connected to PE1 and PE2 on the carrier network. Enterprise 1 and enterprise 2 each have a VLAN.

You can configure QinQ tunnels on PE1 and PE2 so that offices of the same enterprise (enterprise 1 or enterprise 2) can interwork but offices of different enterprises (enterprise 1 and enterprise 2) cannot interwork.

Figure 1 Typical networking of the QinQ tunnel

Interfaces 1 through 4 in this example represent GE 0/1/1, GE 0/1/9, GE 0/1/17, and GE 0/1/25, respectively.



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure an outer VLAN tag for QinQ packets.

  2. Configure a QinQ tunnel so that packets exchanged between VLAN users become double-tagged QinQ packets after passing through the QinQ tunnel.

  3. Configure interfaces on which the QinQ tunnel is not enabled. These interfaces allow packets carrying the specified outer VLAN tags to pass through so that users from different VLANs of the same enterprise can communicate.

Data Preparation

To complete the configuration, you need the following data:

  • Number of the interface connecting to enterprise 1 and enterprise 2

  • Outer VLAN tag of the QinQ interface connecting to enterprise 1 and enterprise 2

Procedure

  1. Create an outer VLAN tag for the QinQ tunnel.

    # Configure PE1.

    <HUAWEI> system-view
    [~HUAWEI] sysname PE1
    [*HUAWEI] commit
    [~PE1] vlan batch 10 20

    # Configure PE2.

    <HUAWEI> system-view
    [~HUAWEI] sysname PE2
    [*HUAWEI] commit
    [~PE2] vlan batch 10 20

  2. Configure the QinQ tunnel function.

    # Configure PE1.

    [*PE1] interface gigabitethernet 0/1/1
    [*PE1-GigabitEthernet0/1/1] portswitch
    [*PE1-GigabitEthernet0/1/1] port link-type dot1q-tunnel
    [*PE1-GigabitEthernet0/1/1] port default vlan 10
    [*PE1-GigabitEthernet0/1/1] undo shutdown
    [*PE1-GigabitEthernet0/1/1] quit
    [*PE1] interface gigabitethernet 0/1/9
    [*PE1-GigabitEthernet0/1/9] portswitch
    [*PE1-GigabitEthernet0/1/9] port link-type dot1q-tunnel
    [*PE1-GigabitEthernet0/1/9] port default vlan 20
    [*PE1-GigabitEthernet0/1/9] undo shutdown
    [*PE1-GigabitEthernet0/1/9] quit
    [*PE1] interface gigabitethernet 0/1/17
    [*PE1-GigabitEthernet0/1/17] portswitch
    [*PE1-GigabitEthernet0/1/17] port link-type dot1q-tunnel
    [*PE1-GigabitEthernet0/1/17] port default vlan 10
    [*PE1-GigabitEthernet0/1/17] undo shutdown
    [*PE1-GigabitEthernet0/1/17] quit
    [*PE1] commit

    # Configure PE2.

    [*PE2] interface gigabitethernet 0/1/1
    [*PE2-GigabitEthernet0/1/1] portswitch
    [*PE2-GigabitEthernet0/1/1] port link-type dot1q-tunnel
    [*PE2-GigabitEthernet0/1/1] port default vlan 20
    [*PE2-GigabitEthernet0/1/1] undo shutdown
    [*PE2-GigabitEthernet0/1/1] quit
    [*PE2] interface gigabitethernet 0/1/9
    [*PE2-GigabitEthernet0/1/9] portswitch
    [*PE2-GigabitEthernet0/1/9] port link-type dot1q-tunnel
    [*PE2-GigabitEthernet0/1/9] port default vlan 10
    [*PE2-GigabitEthernet0/1/9] undo shutdown
    [*PE2-GigabitEthernet0/1/9] quit
    [*PE2] commit

  3. Configure other interfaces.

    # Allow the packets from VLAN 10 and VLAN 20 to pass through GE 0/1/25 on PE1.

    [~PE1] interface gigabitethernet 0/1/25
    [*PE1-GigabitEthernet0/1/25] portswitch
    [*PE1-GigabitEthernet0/1/25] port link-type trunk
    [*PE1-GigabitEthernet0/1/25] port trunk allow-pass vlan 10 20
    [*PE1-GigabitEthernet0/1/25] undo shutdown
    [*PE1-GigabitEthernet0/1/25] quit
    [*PE1] commit

    # Allow the packets from VLAN 10 and VLAN 20 to pass through GE 0/1/17 on PE2.

    [~PE2] interface gigabitethernet 0/1/17
    [*PE2-GigabitEthernet0/1/17] portswitch
    [*PE2-GigabitEthernet0/1/17] port link-type trunk
    [*PE2-GigabitEthernet0/1/17] port trunk allow-pass vlan 10 20
    [*PE2-GigabitEthernet0/1/17] undo shutdown
    [*PE2-GigabitEthernet0/1/17] quit
    [*PE2] commit

  4. Verify that the following conditions are true:

    Hosts in different offices on the same VLAN of enterprise 1 can ping each other.

    Hosts in different offices on the same VLAN of enterprise 2 can ping each other.

    Host of enterprise 1 cannot ping hosts of enterprise 2.

Configuration Files

  • Configuration file of PE1

    #
     sysname PE1
    #
     vlan batch 10 20
    #
    interface GigabitEthernet0/1/1
     undo shutdown
     portswitch
     port link-type dot1q-tunnel
     port default vlan 10
    #
    interface GigabitEthernet0/1/9
     undo shutdown
     portswitch
     port link-type dot1q-tunnel
     port default vlan 20
    #
    interface GigabitEthernet0/1/17
     undo shutdown
     portswitch
     port link-type dot1q-tunnel
     port default vlan 10
    #
    interface GigabitEthernet0/1/25
     undo shutdown
     portswitch
     port link-type trunk
     port trunk allow-pass vlan 10 20
    #
    return
  • Configuration file of PE2

    #
     sysname PE2
    #
     vlan batch 10 20
    #
    interface GigabitEthernet0/1/1
     undo shutdown
     portswitch
     port link-type dot1q-tunnel
     port default vlan 20
    #
    interface GigabitEthernet0/1/9
     undo shutdown
     portswitch
     port link-type dot1q-tunnel
     port default vlan 10
    #
    interface GigabitEthernet0/1/17
     undo shutdown
     portswitch
     port link-type trunk
     port trunk allow-pass vlan 10 20
    #
    return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >