To restrict broadcast packets on a LAN and enhance LAN security or create virtual groups, configure VLANs. VLANs apply only to Ethernet sub-interfaces.
Context
If users access the network through a sub-interface, you must bind a user VLAN to the sub-interface.
You can bind a user VLAN to a sub-interface or configure QinQ on a sub-interface. When binding a user VLAN to a sub-interface, you need the following parameters:
- Sub-interface number
- VLAN ID
- QinQ ID
- On each interface, you can set user-vlan any-other only on one sub-interface. On one sub-interface, user-vlan any-other cannot be set together with user-vlan start-vlan or user-vlan qinq.
- The user-vlan command cannot be configured on a sub-interface of a Layer 2 interface.
- If dot1q termination, QinQ termination, QinQ stacking, or vlan-type dot1q has been configured on a sub-interface, the user-vlan command cannot be configured on this sub-interface.
- Different sub-interfaces cannot be configured with user VLANs with the same VLAN ID.
Procedure
- Run system-view
The system view is displayed.
- (Optional) Run set vlan-statistics subinterface enable
PPPoE statistics collection is enabled on QinQ interfaces.
- Run interface interface-type interface-number. subinterface-number
A sub-interface is created and the sub-interface view is displayed.
- Run user-vlan { start-vlan-id [ end-vlan-id ] | cevlan } qinq { start-pe-vlan [ end-pe-vlan ] | pevlan }
A user VLAN is bound to the sub-interface.
- Run commit
The configuration is committed.