Configuring 802.1Q Encapsulation

When a Layer 3 device uses an Ethernet interface to connect to a Layer 2 device and the Layer 2 device's interfaces are added to VLANs, configure 802.1q encapsulation on the sub-interfaces of the Ethernet interface to ensure communication between the Layer 3 and Layer 2 devices.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number.subinterface-number

    The view of the Ethernet sub-interface that needs to be configured with 802.1Q encapsulation is displayed.

  3. Run either of the following commands as required:

    • To configure a dot1q sub-interface, run the vlan-type dot1q vlan-id command.

      Each Ethernet sub-interface can be associated with only one VLAN. Sub-interfaces of different interfaces can be bound to the same VLAN; sub-interfaces of the same interface cannot be bound to the same VLAN.

    • To configure a dot1q sub-interface and a matching policy for the sub-interface, run thevlan-type dot1q vlanid { 8021p { 8021p-value1 [ to 8021p-value2 ] } &<1-8> | dscp { dscp-value1 [ to dscp-value2 ] } &<1-10> | default | eth-type PPPoE } command.

    • If you do not configure a matching policy, the dot1q sub-interface matches packets carrying the specified VLAN ID. If you configure a matching policy, the dot1q sub-interface matches packets carrying the specified VLAN ID+802.1p value/DSCP value/EthType.

    • After the vlan-type dot1q vlan-id command is run in the Ethernet sub-interface view, the VLAN range belongs to the sub-interface, and any VLAN within the VLAN range cannot be configured with the 802.1p value/DSCP value/EthType on other sub-interfaces.

  4. Run commit

    The configuration is committed.

    In the scenario where an interface has a large number of sub-interfaces, if you run the shutdown command in the sub-interface view to shut down the sub-interfaces one after another, the work load is huge. To shut down the sub-interface in batch, run the shutdown interface command in the system view.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >