Example for Configuring Selective QinQ

This section provides an example for configuring selective QinQ. Selective QinQ is an extension to QinQ tunneling and is more flexible. When receiving packets, a selective QinQ-enabled interface adds different outer tags depending on the inner tags of the packets.

Networking Requirements

On the network shown in Figure 1, company 1 and company 2 each have multiple offices.

  • VLANs 2 to 500 are used on the network of company 1.

  • VLANs 501 to 4094 are used on the network of company 2.

  • GE 0/1/1 on Device A receives packets from different VLANs of company 1 and company 2.

Selective QinQ is required on GE 0/1/1 of Device A on the carrier network so that the office networks of each company can communicate with each other, but the office networks of different companies cannot.

Figure 1 Networking of selective QinQ

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



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure default outer VLAN IDs.

  2. Configure selective QinQ on Layer 2 interfaces so that the interfaces can add different outer VLAN tags to packets.

  3. Configure other selective QinQ-incapable interfaces to forward packets carrying a specific outer VLAN ID.

Data Preparation

To complete the configuration, you need the following data:

  • Numbers of interfaces connected to companies 1 and 2

  • Outer VLAN IDs that Layer 2 interfaces on Device A and Device B add to packets from different companies

Procedure

  1. Create default outer VLAN IDs on Layer 2 interfaces.

    # Configure Device A.

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

    # Configure Device B.

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

  2. Configure selective QinQ on Layer 2 interfaces.

    # Configure Device A.

    [*DeviceA] interface gigabitethernet 0/1/1
    [*DeviceA-GigabitEthernet0/1/1] portswitch
    [*DeviceA-GigabitEthernet0/1/1] port vlan-stacking vlan 2 to 500 stack-vlan 10
    [*DeviceA-GigabitEthernet0/1/1] port vlan-stacking vlan 1000 to 2000 stack-vlan 20
    [*DeviceA-GigabitEthernet0/1/1] undo shutdown
    [*DeviceA-GigabitEthernet0/1/1] quit
    [*DeviceA] interface gigabitethernet 0/1/9
    [*DeviceA-GigabitEthernet0/1/9] portswitch
    [*DeviceA-GigabitEthernet0/1/9] port vlan-stacking vlan 100 to 500 stack-vlan 10
    [*DeviceA-GigabitEthernet0/1/9] undo shutdown
    [*DeviceA-GigabitEthernet0/1/9] commit
    [~DeviceA-GigabitEthernet0/1/9] quit

    # Configure Device B.

    [~DeviceB] interface gigabitethernet 0/1/1
    [*DeviceB-GigabitEthernet0/1/1] portswitch
    [*DeviceB-GigabitEthernet0/1/1] port vlan-stacking vlan 1000 to 4094 stack-vlan 20
    [*DeviceB-GigabitEthernet0/1/1] undo shutdown
    [*DeviceB-GigabitEthernet0/1/1] quit
    [*DeviceB] interface gigabitethernet 0/1/9
    [*DeviceB-GigabitEthernet0/1/9] portswitch
    [*DeviceB-GigabitEthernet0/1/9] port vlan-stacking vlan 501 to 2500 stack-vlan 20
    [*DeviceB-GigabitEthernet0/1/9] undo shutdown
    [*DeviceB-GigabitEthernet0/1/9] commit
    [~DeviceB-GigabitEthernet0/1/9] quit

  3. Configure other interfaces.

    # Configure GE 0/1/17 on Device A to forward packets carrying outer VLAN ID 20.

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

    # Configure GE 0/1/17 on Device B to forward packets carrying outer VLAN ID 20.

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

  4. Verify the configuration.

    Hosts in different offices but the same VLAN can ping each other in company 1.

    Hosts in different offices but the same VLAN can ping each other in company 2.

    Hosts in company 1 and hosts in company 2 cannot ping each other.

Configuration Files

  • Device A configuration file

    #
     sysname DeviceA
    #
     vlan batch 10 20
    #
    interface GigabitEthernet0/1/1
     undo shutdown
     portswitch
     port vlan-stacking vlan 2 to 500 stack-vlan 10
     port vlan-stacking vlan 1000 to 2000 stack-vlan 20
    #
    interface GigabitEthernet0/1/9
     undo shutdown
     portswitch
     port vlan-stacking vlan 100 to 500 stack-vlan 10
    #
    interface GigabitEthernet0/1/17
     undo shutdown
     portswitch
     port trunk allow-pass vlan 20
    #
    return
  • Device B configuration file

    #
     sysname DeviceB
    #
     vlan batch 20
    #
    interface GigabitEthernet0/1/1
     undo shutdown
     portswitch
     port vlan-stacking vlan 1000 to 4094 stack-vlan 20
    #
    interface GigabitEthernet0/1/9
     undo shutdown
     portswitch
     port vlan-stacking vlan 500 to 2500 stack-vlan 20
    #
    interface GigabitEthernet0/1/17
     undo shutdown
     portswitch
     port trunk allow-pass vlan 20
    #
    return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >