Back to Command Reference
Interface ConfigDomain 2.0

switchport mode trunk

Statically forces a physical interface into a permanent trunking state. This allows the port to carry traffic for multiple isolated VLANs simultaneously across a single cable by inserting an IEEE 802.1Q 4-byte tag into the Ethernet frame header.

Quick Reference

Execution ModeSwitch(config-if)#
Standard ProtocolIEEE 802.1Q (dot1q)
DTP ImpactGenerates DTP frames to negotiate neighbor.
Negation Commandno switchport mode trunk

Syntax Breakdown

switchport mode trunk

Like its access-mode counterpart, this command does not take trailing arguments. However, its successful execution is heavily dependent on the hardware capabilities of the switch you are configuring.

When applied, the switchport overrides any Dynamic Trunking Protocol (DTP) "auto" or "desirable" modes and immediately attempts to bring the link up as an 802.1Q trunk. By default, a newly established trunk link permits all VLANs (1 - 4094) to traverse it.

CLI Deployment Scenarios

Scenario 1: Standard Core Switch Link

You are connecting an edge switch to the main distribution switch via a fiber uplink on GigabitEthernet 1/0/1.

Switch(config)# interface g1/0/1
Switch(config-if)# switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up
! The port is now tagging frames with 802.1Q headers.

Scenario 2: Disabling DTP on the Trunk

As a security best practice, after forcing a trunk, you completely disable the transmission of DTP negotiation packets to prevent spoofing.

Switch(config)# interface g1/0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport nonegotiate

CCNA Exam Gotchas

[!]

The "Command Rejected" Encapsulation Error

If you are configuring a Multilayer Layer 3 Switch (like a Catalyst 3560/3750) and type switchport mode trunk, the router will throw a Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode. error.

The Fix: Older L3 switches support both legacy ISL and modern 802.1Q. You must manually define the standard using switchport trunk encapsulation dot1q before you can execute the mode trunk command.

[!]

DTP Mode Mismatches

The CCNA will show you a topology of two connected switches and ask what link forms. Memorize this rule: If Switch A is set to trunk and Switch B is set to access, the link fails entirely. If both are left at default dynamic auto, they will passively wait forever and mistakenly form an access link.