< Home

Example for Configuring Interface-based Layer 2 Protocol Tunneling

Networking Requirements

In Figure 1, the CEs are edge devices on two private networks (located in different areas) of an enterprise. The PEs are edge devices on the ISP network. The two private networks of the enterprise are Layer 2 networks and they are connected through the ISP network. STP is run on the Layer 2 networks to prevent loops. Enterprise users require that only STP run on the private networks so that spanning trees can be generated correctly.

Figure 1 Networking diagram for configuring interface-based Layer 2 protocol tunneling

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure STP on CEs to prevent loops on Layer 2 networks.

  2. Add PE interfaces connected to CEs to specified VLANs so that PEs forward packets from the VLANs.

  3. Configure interface-based Layer 2 protocol tunneling on PEs so that STP packets are not sent to the CPUs of PEs for processing.

Procedure

  1. Enable STP on CEs.

    # Configure CE1.

    <HUAWEI> system-view
    [HUAWEI] sysname CE1
    [CE1] vlan 100
    [CE1-vlan100] quit
    [CE1] stp enable
    [CE1] interface gigabitethernet 0/0/1
    [CE1-GigabitEthernet0/0/1] port link-type hybrid
    [CE1-GigabitEthernet0/0/1] port hybrid pvid vlan 100
    [CE1-GigabitEthernet0/0/1] port hybrid untagged vlan 100
    [CE1-GigabitEthernet0/0/1] quit

    # Configure CE2.

    <HUAWEI> system-view
    [HUAWEI] sysname CE2
    [CE2] vlan 100
    [CE2-vlan100] quit
    [CE2] stp enable
    [CE2] interface gigabitethernet 0/0/1
    [CE2-GigabitEthernet0/0/1] port link-type hybrid
    [CE2-GigabitEthernet0/0/1] port hybrid pvid vlan 100
    [CE2-GigabitEthernet0/0/1] port hybrid untagged vlan 100
    [CE2-GigabitEthernet0/0/1] quit

  2. Add GE0/0/1 on PE1 and PE2 to VLAN 100 and enable Layer 2 protocol tunneling on PEs.

    # Configure PE1.

    <HUAWEI> system-view
    [HUAWEI] sysname PE1
    [PE1] vlan 100
    [PE1-vlan100] quit
    [PE1] interface gigabitethernet 0/0/1
    [PE1-GigabitEthernet0/0/1] port link-type hybrid
    [PE1-GigabitEthernet0/0/1] port hybrid pvid vlan 100
    [PE1-GigabitEthernet0/0/1] port hybrid untagged vlan 100
    [PE1-GigabitEthernet0/0/1] l2protocol-tunnel stp enable
    [PE1-GigabitEthernet0/0/1] quit
    [PE1] interface GigabitEthernet 0/0/2
    [PE1-GigabitEthernet0/0/2] port link-type trunk
    [PE1-GigabitEthernet0/0/2] port trunk allow-pass vlan 100
    [PE1-GigabitEthernet0/0/2] quit

    # Configure PE2.

    <HUAWEI> system-view
    [HUAWEI] sysname PE2
    [PE2] vlan 100
    [PE2-vlan100] quit
    [PE2] interface gigabitethernet 0/0/1
    [PE2-GigabitEthernet0/0/1] port link-type hybrid
    [PE2-GigabitEthernet0/0/1] port hybrid pvid vlan 100
    [PE2-GigabitEthernet0/0/1] port hybrid untagged vlan 100
    [PE2-GigabitEthernet0/0/1] l2protocol-tunnel stp enable
    [PE2-GigabitEthernet0/0/1] quit
    [PE2] interface gigabitethernet 0/0/2
    [PE2-GigabitEthernet0/0/2] port link-type trunk
    [PE2-GigabitEthernet0/0/2] port trunk allow-pass vlan 100
    [PE2-GigabitEthernet0/0/2] quit

  3. Configure PEs to replace the destination MAC address of STP packets received from CEs.

    # Configure PE1.

    [PE1] l2protocol-tunnel stp group-mac 0100-0100-0100

    # Configure PE2.

    [PE2] l2protocol-tunnel stp group-mac 0100-0100-0100

  4. Configure CE2 to the priority of a switching device is 4096.

    [CE2] stp priority 4096

  5. Verify the configuration.

    # After the configuration is complete, run the display l2protocol-tunnel group-mac command on PEs. You can view the protocol type or name, multicast destination MAC address, group MAC address, and priority of Layer 2 protocol packets to be transparently transmitted.

    The display on PE1 is used as an example.

    [PE1] display l2protocol-tunnel group-mac stp
    Protocol         EncapeType ProtocolType Protocol-MAC   Group-MAC      Pri      
    -----------------------------------------------------------------------------   
    stp              llc        dsap 0x42    0180-c200-0000 0100-0100-0100 0        
                                ssap 0x42                                           

    # After 30s, run the display stp command on CE1 and CE2 to view the root in the MSTP region. You can find that a spanning tree is calculated between CE1 and CE2. GE0/0/1 on CE1 is the root port and GE0/0/1 on CE2 is the designated port.

    [CE1] display stp brief
     MSTID   Port                        Role  STP State     Protection     
        0    GigabitEthernet0/0/1       ROOT  FORWARDING      NONE
    
    [CE2] display stp brief
     MSTID   Port                        Role  STP State     Protection     
        0    GigabitEthernet0/0/1       DESI  FORWARDING      NONE
    

Configuration Files

  • CE1 configuration file

    #
    sysname CE1
    #
    vlan batch 100
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    return
  • CE2 configuration file

    #
    sysname CE2
    #
    vlan batch 100 
    #
    stp instance 0 priority 4096
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    return
  • PE1 configuration file

    #
    sysname PE1
    #
    vlan batch 100
    #
    l2protocol-tunnel stp group-mac 0100-0100-0100
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     port hybrid pvid vlan 100
     port hybrid untagged vlan 100
     l2protocol-tunnel stp enable
    #
    interface GigabitEthernet0/0/2  port link-type trunk                                                             port trunk allow-pass vlan 100 #
    return
  • PE2 configuration file

    #
    sysname PE2
    #
    vlan batch 100
    #
    l2protocol-tunnel stp group-mac 0100-0100-0100
    #
    interface GigabitEthernet0/0/1
     port link-type hybrid
     port hybrid pvid vlan 100
     port hybrid untagged vlan 100
     l2protocol-tunnel stp enable
    #
    interface GigabitEthernet0/0/2  port link-type trunk                                                             port trunk allow-pass vlan 100 #
    return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >