CX320 Switch Module V100R001 Configuration Guide 15
Configuring a Sub-interface
A sub-interface is a virtual interface configured on a physical interface to allow users belong to different VLANs to communicate with each other.
Configuring an Ethernet Sub-interface
Context
Users belong to different VLANs and are located on different network segments can communicate with each other by configuring sub-interfaces.
As shown in Figure 5-11, PC1 and PC2 belong to VLAN 10 and VLAN 20 respectively and they are located on the different network segments. PC1 and PC2 connect to the Layer 3 device Switch ModuleB through the Layer 2 device Switch ModuleA. If only one IP address is configured for 10GE1/17/4 on Switch ModuleB, PC1 and PC2 cannot communicate across VLANs. Although you can configure a secondary IP address to solve this problem, the secondary IP address becomes invalid after the primary IP address becomes invalid.
Pre-configuration Tasks
Before configuring an Ethernet sub-interface, complete the following tasks:
Correctly connecting the physical interface of the sub-interface
Configuring a Layer 3 main interface
Procedure
- Run:
system-view
The system view is displayed.
- Run:
interface interface-type interface-number.subinterface-number
The Ethernet sub-interface view is displayed.
subinterface-number specifies the number of a sub-interface after the Ethernet interface is switched to Layer 3 mode.
The number of a sub-interface ranges from 1 to 4094. Currently, the device supports a maximum of 2000 sub-interfaces.
- Run:
ip address ip-address { mask | mask-length } [ sub ]
The IP address of the Ethernet sub-interface is configured.
Specify the sub parameter when you need to configure a secondary IP address for the Ethernet sub-interface.
- Run:
dot1q termination vid vid
The sub-interface is configured to terminate single-tagged packets.
- Run:
commit
The configuration is committed.
Configuring an Eth-Trunk Sub-interface
Context
Sub-interfaces can be configured on a Layer 3 Eth-Trunk. When Layer 3 devices connect to Layer 2 devices in different VLANs through the Layer 3 Eth-Trunk, sub-interfaces must be configured on the Eth-Trunk to identify packets from different VLANs and to enable users in different VLANs to communicate with each other.
Procedure
- Run:
system-view
The system view is displayed.
- Run:
interface eth-trunk trunk-id
An Eth-Trunk is created and the Eth-Trunk interface view is displayed.
- Run:
undo portswitch
A Layer 3 Eth-Trunk is configured.
- Run:
quit
The system view is displayed.
- Run:
interface eth-trunk trunk-id.subnumber
An Eth-Trunk sub-interface is created.
subnumber specifies the number of a sub-interface. The value ranges from 1 to 4094.
- Run:
ip address ip-address { mask | mask-length } [ sub ]
An IP address is configured for the sub-interface.
When configuring multiple IP addresses for an Eth-Trunk sub-interface, use the sub keyword to indicate the IP addresses configured after the first one.
- Run:
dot1q termination vid vid
The Eth-trunk sub-interface is configured to terminate single-tagged packets.
- Run:
commit
The configuration is committed.