Trunk links have a capability to carry multiple VLANs on a single link and should be used for interconnecting switches. By default, switch interfaces can carry only one VLAN data.
As in Figure 1, there are two VLANs on SW-A, VLAN 2 and 3. User A-1 is in VLAN 2 and User A-2 is in VLAN 3. Same way there is two VLANs on SW-B. User B-1 is in VLAN 3 and User B-2 is in VLAN 3.
If we assume there is only one link between SW-A and SW-B with interface G0/24 (vlan2). As we know, by default switch interface can carry only one VLAN data. Hence only VLAN 2 users can communicate with each other using that link.
Now what about users in VLAN 3? So we have added another link (G0/25) between both switches for VLAN 3, now they can communicate with each other using that link.
Just add one link per new VLAN between switches. Pretty easy huh…! Not really. What if we have 20 VLANs on switch A and B? It’s not possible to add 20 links between switches. That’s why we need TRUNK LINKS.
In figure 2, we have configured a single link (G0/25) between SW-A & SW-B as a trunk link. As trunk link carries multiple VLAN data, users in both VLANs on SW-A can communicate with their respective VLAN users on SW-B.
So all good now, but what if VLAN 2 users wants to communicate with VLAN3 users? For that we need Layer 3 device means Layer 3 switch or Router and it is called Inter-Vlan Routing.