802.1Q Trunking

  • A trunk link is a Layer 2 connection that carries traffic from multiple VLANs between switches.
    Without trunking, each VLAN would remain confined to the switch where it was created.

    Why Trunking Is Needed

    To understand why trunking is important, let’s look at a simple example.

    Below, several VLANs are created on two switches.
    PC1 and PC3 both belong to VLAN 10, but they are connected to different switches.

    Network topology demonstrating 802.1Q trunking between two switches, SW1 and SW2, connecting VLAN 10 and VLAN 20 devices.

    Figure 1 – VLANs on Different Switches

    Even though both devices belong to VLAN 10, they still cannot communicate because they are located on separate switches.

    To allow communication between these two devices, we need two things:

    1. A physical link connects the switches.

    2. 802.1Q trunking is enabled on that link.

    Network diagram showing two switches (SW1 and SW2) connected by a central trunk link, extending VLAN 10 (PC1, PC3) and VLAN 20 (PC2, PC4) across the network.

    Figure 2 – Trunk Link Between Switches

    By enabling trunking, we allow VLAN 10 and VLAN 20 traffic to pass through the inter-switch link.
    This means each VLAN can extend beyond a single switch, VLAN 10 on SW1 can now reach VLAN 10 on SW2, and so on.

    Let’s walk through an example to see this in action.

    PC1 wants to send traffic to PC3.
    SW1 receives the frame on interface G0/1, which is an access port in VLAN 10.
    Since PC3 is connected to another switch, SW1 forwards the frame to SW2 over the trunk link.

    Network diagram illustrating VLAN 10 traffic (ETH frames with '10' tag) traversing a trunk link between two switches (SW1 and SW2), extending VLAN 10 and VLAN 20 connectivity for connected PCs.

    Figure 3 – VLAN Tagging with 802.1Q Trunking

    SW2 receives the frame, identifies it as part of VLAN 10, and forwards it to PC3.
    From the user’s perspective, both PCs appear to be on the same local network, even though they are on different switches.

    This is the purpose of trunking:
    it extends VLANs across multiple switches while keeping traffic from each VLAN logically separated.

    Now that we understand what trunking does, the next step is to see how it actually works, how VLAN information is added, transported, and removed from frames as they cross the trunk.

    Answer the question below