VLANIF interfaces are used to implement inter-VLAN Layer 3 connectivity when devices are connected to the same Layer 3 switch or different Layer 3 switches.
As shown in Figure 1, departments 1 and 2 of a small-sized company belong to VLAN 2 and VLAN 3, respectively, and connect to a Layer 3 switch (Switch) through Layer 2 switches. Packets exchanged between the two departments need to pass through the Layer 3 switch.
Assign VLANs on Switch_1 and Switch_2, configure Switch_1 and Switch_2 to transparently transmit VLAN packets to the Layer 3 switch, and configure a VLANIF interface for each VLAN on the Layer 3 switch to allow communication between VLAN 2 and VLAN 3.
As shown in Figure 2, departments 1 and 2 of a medium- or large-sized company are connected across two or more Layer 3 switches, and belong to VLAN 2 and VLAN 3, respectively. Packets exchanged between the two departments need to pass through the Layer 3 switches.
Assign VLANs on the Layer 2 switches, and configure the Layer 2 switches to transparently transmit VLAN packets to Layer 3 switches. Configure a VLANIF interface for each user VLAN and interconnected VLANs on Switch_1 and Switch_2, and configure VLANIF interfaces for interconnected VLANs on other Layer 3 devices. In addition, configure static routes or a dynamic routing protocol between Switch_1 and Switch_2 (a dynamic routing protocol is recommended when devices are connected across more than two Layer 3 switches).