To transmit both Layer 2 and Layer 3 services over the same physical link, create a sub-interface on a Layer 2 Eth-Trunk interface.
If Layer 2 switching devices belong to different VLANs, and hosts in the VLANs need to communicate with each other, you need to create sub-interfaces on the Eth-Trunk interface connecting a Layer 3 device to a Layer 2 switching device, bind a VLAN to each sub-interface, configure 802.1Q encapsulation on the sub-interfaces, and assign an IP address to each sub-interface.
After the configuration is complete, hosts in the VLANs can use these sub-interfaces to communicate with each other. Eth-Trunk sub-interfaces can be configured to terminate dot1q and QinQ VLAN tags.
After sub-interfaces are configured for Layer 2 Eth-Trunk interfaces, the Eth-Trunk interfaces provide Layer 2 functions, and their sub-interfaces provide Layer 3 functions.
For applications of Eth-Trunk sub-interfaces in VLAN services, see VLAN Configuration.
For applications of Eth-Trunk sub-interfaces in QinQ services, see QinQ Configuration.
The system view is displayed.
A sub-interface is created on a Layer 2 Eth-Trunk interface.
A maximum of 4094 sub-interfaces can be created on an Eth-Trunk interface.
An IP address is assigned to the Eth-Trunk sub-interface.
When more than one IP address is configured for an Eth-Trunk interface, the keyword sub must be used to indicate the second and subsequent IP addresses.
The encapsulation type and associated VLAN ID are configured for the Eth-Trunk sub-interface.
The VLAN IDs associated with the two communicating Eth-Trunk sub-interfaces must be the same.
The VLAN IDs associated with a sub-interface of a Layer 2 Eth-Trunk interface cannot conflict with the VLAN IDs associated with the Layer 2 Eth-Trunk interface.
The MTU is configured for the Eth-Trunk sub-interface.
The MTU value of an Eth-Trunk interface ranges from 46 to 9600, in bytes.
The Quality of Service (QoS) queue length is limited. If the MTU is too small whereas the packet size is large, the packet is probably divided into many fragments and discarded by the QoS queue. To avoid this situation, lengthen the QoS queue accordingly.
The configuration is committed.