VLANInterface Config

switchport mode trunk

Configures a switch interface as a trunk port, allowing multiple VLANs to traverse the link using IEEE 802.1Q tagging.

Syntax·Interface Config
switchport mode trunk

When to Use This Command

  • Connecting two switches to carry traffic for multiple VLANs between them.
  • Connecting a switch to a router for inter-VLAN routing (router-on-a-stick).
  • Connecting a switch to a server that supports 802.1Q trunking for VLAN tagging.
  • Connecting a switch to a wireless LAN controller that requires trunk links for multiple SSID VLANs.

Command Examples

Basic trunk configuration on an interface

interface GigabitEthernet0/1 switchport mode trunk
Switch(config-if)# switchport mode trunk
Switch(config-if)#

The command is entered in interface configuration mode. No output is shown if successful; the prompt returns without error.

Verifying trunk status after configuration

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

Port        Vlans allowed on trunk
Gi0/1       1-4094

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

Port        Vlans in spanning tree forwarding state and not pruned
Gi0/1       1,10,20,30

The output shows that Gi0/1 is in trunking mode with 802.1Q encapsulation. The native VLAN is 1. All VLANs (1-4094) are allowed, but only VLANs 1,10,20,30 are active and forwarding.

Understanding the Output

The 'show interfaces trunk' command displays trunk status. The 'Port' column lists the interface. 'Mode' shows the trunking mode: 'on' means trunking is enabled statically, 'desirable' or 'auto' are DTP modes. 'Encapsulation' is always 802.1q for modern switches. 'Status' should be 'trunking' for a working trunk; if it says 'not-trunking', the link is not trunking. 'Native vlan' shows the untagged VLAN (default 1). The second section lists all VLANs allowed on the trunk; by default it's 1-4094. The third section shows VLANs that are actually active and allowed; if a VLAN is not in this list, it may not exist or be shut down. The last section shows VLANs that are in spanning-tree forwarding state; if a VLAN is missing, STP may be blocking it. A common issue is mismatched native VLANs, which can cause errors; both ends must match.

CCNA Exam Tips

1.

CCNA exam tip: The 'switchport mode trunk' command statically sets the interface to trunk, disabling DTP negotiation. Remember that DTP is Cisco proprietary and not used on non-Cisco switches.

2.

CCNA exam tip: If you see 'switchport mode dynamic desirable' or 'auto', the interface can become a trunk via DTP. The exam may ask which mode forms a trunk with a static trunk.

3.

CCNA exam tip: The native VLAN must match on both ends of a trunk; otherwise, VLAN hopping or misconfiguration can occur. The default native VLAN is 1.

4.

CCNA exam tip: To restrict which VLANs are allowed on a trunk, use 'switchport trunk allowed vlan' command. The exam may test that only specific VLANs are permitted.

Common Mistakes

Mistake: Forgetting to set the interface to trunk mode before configuring trunk-specific commands like allowed VLANs or native VLAN. The interface will remain in access mode and commands may be rejected.

Mistake: Configuring trunk mode on an interface connected to an end device (PC, printer) that does not support trunking, causing the device to not communicate.

Mistake: Mismatched native VLANs on both ends of the trunk, leading to VLAN leakage or connectivity issues.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions