CCNA · Lesson 4 of 13

Trunk Links and 802.1Q

How do several VLANs travel between two switches without one cable per VLAN? With a trunk.

By topologia.appUpdated: Nov 13, 2026⏱ 5 min❓ 4 questions📶 Level beginner

In a nutshell

A trunk carries many VLANs over one cable. Each frame travels with an 802.1Q tag that says which VLAN it belongs to.

In this lesson
  1. The problem
  2. The solution: a trunk
  3. The 802.1Q tag
  4. Configure a trunk
  5. Watch out for allowed vlan
  6. Verify
  7. What you must remember
  8. Exam-style questions

The problem

You have two switches, and both have Sales (VLAN 10) and Accounting (VLAN 20) users. One cable per VLAN? With 50 VLANs that would be 50 cables and 50 wasted ports.

The solution: a trunk

A trunk link is one cable that carries many VLANs. So the other switch knows which VLAN each frame belongs to, the switch adds a tag before sending it. It is like putting a colored wristband on everyone crossing a bridge: on the other side, each person goes to their own room.

802.1Q trunk between SW1 and SW2 carrying VLANs 10 and 20 TRUNK 802.1Q · VLAN 10, 20 G0/1G0/1 SW1 SW2 PC1 V10 PC2 V20 PC3 V10 PC4 V20 10 20
Frames leave the PC untagged. When they enter the trunk the switch adds the tag (10 or 20) and the other switch removes it before delivering them.Edit in the editor ↗

The 802.1Q tag

IEEE 802.1Q (also called dot1q) is the tagging standard. It inserts 4 bytes into the Ethernet frame, between the source MAC and the Type field:

FieldSizePurpose
TPID16 bitsValue 0x8100. Means "this frame is tagged".
PRI (PCP)3 bitsPriority (CoS). Used to prioritize voice.
DEI1 bitMarks whether the frame can be dropped under congestion.
VLAN ID12 bitsThe VLAN number (that is why the maximum is 4095).

Because the frame changes, the switch recalculates the FCS. ISL was Cisco's old proprietary protocol: it encapsulated the whole frame (26-byte header + 4-byte CRC). It is obsolete today; for the CCNA always think 802.1Q.

Configure a trunk

SW1(config)# interface g0/1
SW1(config-if)# switchport trunk encapsulation dot1q  ← only on switches that also support ISL (e.g. 3560)
SW1(config-if)# switchport mode trunk
SW1(config-if)# switchport trunk allowed vlan 10,20  ← optional: limit VLANs

Configure the other end (SW2) the same way. By default a trunk allows all VLANs (1–4094).

Watch out for allowed vlan

CommandResult
switchport trunk allowed vlan 30Replaces the list: now only VLAN 30 passes.
switchport trunk allowed vlan add 30Adds 30 to the existing list.
switchport trunk allowed vlan remove 30Removes only 30.
switchport trunk allowed vlan allAllows all VLANs again.

Very common real mistake

Forgetting add and taking down every other VLAN on the trunk.

Verify

SW1# show interfaces trunk
Port   Mode  Encapsulation  Status    Native vlan
Gi0/1  on    802.1q         trunking  1

Port   Vlans allowed on trunk
Gi0/1  10,20

Port   Vlans allowed and active in management domain
Gi0/1  10,20

What you must remember

  • Trunk = a link that carries several VLANs.
  • 802.1Q inserts a 4-byte tag; the VLAN ID uses 12 bits.
  • Configure: switchport mode trunk.
  • Use "allowed vlan add" so you do not wipe the existing list.

Check what you learned

4 exam-style questions. Some have one answer and others ask you to choose several. Answer them all to complete the lesson.

Question 1 of 4 · Choose twoAn administrator configures an 802.1Q trunk between two switches. Which two statements are true? (Choose two.)
Question 2 of 4 · One answerHow many bits does the VLAN ID field of the 802.1Q tag have?
Question 3 of 4 · One answerRefer to the output. The administrator enters switchport trunk allowed vlan 30 on Gi0/1. Which VLANs will be allowed on the trunk?

Exhibit

SW1# show interfaces trunk
Port   Vlans allowed on trunk
Gi0/1  10,20
Question 4 of 4 · One answerWhich command makes a port always operate as a trunk, without depending on negotiation?