Configuring VLAN ID-based Selective QinQ
Context
VLAN ID-based selective QinQ allows an interface to add outer VLAN tags to packets based on VLAN IDs of the packets.
- Selective QinQ is recommended to be enabled on a hybrid interface. Selective QinQ can only take effect on the interface in the inbound direction.
When an interface configured with VLAN stacking needs to remove the outer tag from outgoing frames, the interface must join the VLAN specified by stack-vlan in untagged mode. If the outer VLAN does not need to be removed, the interface must join the VLAN specified by stack-vlan in tagged mode.
Procedure
- Run:
system-view
The system view is displayed.
- Run:
interface interface-type interface-number
The interface can be a physical interface or an Eth-Trunk interface.
- Run:
port link-type hybrid
The link type of the interface is set to hybrid.
By default, the LNP negotiation mode of an interface is negotiation-desirable.
- Run:
port hybrid untagged vlan vlan-id
The interface is added to the VLAN in untagged mode.
You must specify an existing VLAN ID on the device in this command. You do not need to create a VLAN specified by the original VLAN tag of a received packet.
- Configure only selective QinQ or configure selective QinQ and VLAN mapping.
Configure only selective QinQ.
Run the port vlan-stacking vlan vlan-id1 [ to vlan-id2 ] stack-vlan vlan-id3 [ remark-8021p 8021p-value ] command to configure only selective QinQ.
By default, the priority in the stacked outer VLAN tag is 0 on SA cards of S series, and is the same as the priority in the inner VLAN tag on other cards.
VLAN Switch stack-vlan can also add outer VLAN tags based on inner VLAN tags. For details, see VLAN Switch Configuration.
Configure selective QinQ and VLAN mapping.
Run the port vlan-stacking vlan vlan-id1 [ to vlan-id2 ] stack-vlan vlan-id3 [ remark-8021p 8021p-value3 ] map-vlan vlan-id4 command to configure selective QinQ and VLAN mapping.
- Run:
quit
Exit from the interface view.
- Run:
interface interface-type interface-number
The view of another interface is displayed.
This interface is the outbound interface for QinQ packets, different from the interface specified in step 2.
- Run:
port link-type trunk
The link type of the interface is set to trunk.
- Run:
port trunk allow-pass vlan vlan-id3
The outer VLAN ID (stack-vlan) added to the original tagged packet is set.
Checking the Configuration
- Run the display current-configuration interface interface-type interface-number command to check the selective QinQ configuration on the interface.
Configuration Tips
Deleting QinQ configuration
- Run the undo port vlan-stacking vlan vlan-id1 [ to vlan-id2 ] [ stack-vlan vlan-id3 ] command in the interface view to delete a selective QinQ entry on the interface.
- Run the undo port vlan-stacking all command in the interface view to delete all the selective QinQ entries on the interface.