How do I configure an Ethernet sub-interface to implement inter-VLAN communication

Generally, only one primary IP address can be configured for a physical interface. When a Layer 3 device connects to a Layer 2 network device through a Layer 3 Ethernet interface and interfaces on the Layer 2 network device are assigned to different VLANs, one primary IP address of the Layer 3 physical interface cannot implement inter-VLAN communication.
You can configure secondary IP addresses or sub-interfaces for the Layer 3 Ethernet interface to solve this problem. The secondary IP addresses depend on the primary IP address. When the primary IP address becomes invalid, the secondary IP addresses also become invalid. The sub-interfaces and main interface are independent. Sub-interfaces share physical layer parameters of their main interface, and are configured with their respective link layer parameters and network layer parameters. The IP address of the main interface and IP addresses of sub-interfaces are independent. You can create sub-interfaces on the Ethernet interface connecting the Layer 3 device to the Layer 2 device so that users in different VLANs can communicate.

Scroll to top