Procedure
# Configure an Ethernet sub-interface. (The physical interface must be switched to Layer 3 mode.)
<Huawei> system-view[Huawei] interface GigabitEthernet 0/0/0.1[Huawei-GigabitEthernet0/0/0.1] ip address 10.1.1.2 24 //Configure an IP address for the Ethernet sub-interface.
# Configure an Eth-Trunk sub-interface.
<Huawei> system-view[Huawei] interface Eth-Trunk 1 //Create a Layer 2 Eth-Trunk. [Huawei-Eth-Trunk1] undo portswitch //Configure the Eth-Trunk to work in Layer 3 mode. [Huawei-Eth-Trunk1] quit[Huawei] interface Eth-Trunk 1.1 //Create a Layer 3 Eth-Trunk sub-interface. [Huawei-Eth-Trunk1.1] ip address 10.1.2.4 24 //Configure an IP address.
# Configure a PON sub-interface.
<Huawei> system-view[Huawei] interface pon 1/0/0.1 //Create a PON sub-interface. [Huawei-Pon1/0/0.1] ip address 10.1.0.1 255.255.255.0 //Configure an IP address for the PON sub-interface.
# Configure an ATM sub-interface.
<Huawei> system-view[Huawei] interface atm 1/0/0.1 //Create an ATM sub-interface.
# Configure an FR sub-interface.
<Huawei> system-view[Huawei] interface serial 1/0/0[Huawei-Serial1/0/0] link-protocol fr[Huawei-Serial1/0/0] quit[Huawei] interface serial 1/0/0.1[Huawei-Serial1/0/0.1] ip address 10.1.0.1 255.255.255.0
# Configure a Layer 2 sub-interface.
<Huawei> system-view[Huawei] bridge-domain 10[Huawei-bd10] quit[Huawei] interface ethernet 0/0/1.1 mode l2[Router1-Ethernet2/0/1.1] encapsulation dot1q vid 10[Router1-Ethernet2/0/1.1] bridge-domain 10[Router1-Ethernet2/0/1.1] quit
More Information
Layer 2 sub-interfaces are mainly used on a VXLAN network. On the VXLAN network, you need to configure VXLAN service access points on a VXLAN network edge node. You can configure Layer 2 sub-interfaces to configure VXLAN service access points. After configuring Layer 2 sub-interfaces, add them to a bridge domain (BD) so that service packets are forwarded in the BD.