Inter-VLAN communication ensures that different companies can communicate with each other.
Multiple VLANs belong to the same Layer 3 device.
On the network shown in Figure 1, if VLAN 2, VLAN 3, and VLAN 4 belong to DeviceA, these VLANs do not cross switches. In such a situation, you can configure a VLANIF interface for each VLAN on DeviceA to implement the communication among these VLANs.
The Layer 3 device shown in Figure 1 can be a router or a Layer 3 switch.
Multiple VLANs belong to different Layer 3 devices.
On the network shown in Figure 2, VLAN 2, VLAN 3, and VLAN 4 are VLANs across different switches. In such a situation, you can configure a VLANIF interface on DeviceA and DeviceB for each VLAN, and then configure the static route or a routing protocol on DeviceA and DeviceB, so that DeviceA and DeviceB can communicate over a Layer 3 route.
The Layer 3 device shown in Figure 2 can be a router or a Layer 3 switch.