Layer 2 Commands
When you enter trunk mode, the interface changes to permanent trunking mode and negotiates to convert
the link into a trunk link even if the interface connecting to it does not agree to the change.
When you enter dynamic auto mode, the interface converts the link to a trunk link if the neighboring interface
is set to trunk or desirable mode.
When you enter dynamic desirable mode, the interface becomes a trunk interface if the neighboring interface
is set to trunk, desirable, or auto mode.
To autonegotiate trunking, the interfaces must be in the same VLAN Trunking Protocol (VTP) domain. Trunk
negotiation is managed by the Dynamic Trunking Protocol (DTP), which is a point-to-point protocol. However,
some internetworking devices might forward DTP frames improperly, which could cause misconfigurations.
To avoid this problem, configure interfaces connected to devices that do not support DTP to not forward DTP
frames, which turns off DTP.
• If you do not intend to trunk across those links, use the switchport mode access interface configuration
• To enable trunking to a device that does not support DTP, use the switchport mode trunk and switchport
Access ports and trunk ports are mutually exclusive.
The IEEE 802.1x feature interacts with switchport modes in these ways:
• If you try to enable IEEE 802.1x on a trunk port, an error message appears, and IEEE 802.1x is not
• If you try to enable IEEE 802.1x on a port set to dynamic auto or dynamic desirable, an error message
• If you try to enable IEEE 802.1x on a dynamic-access (VLAN Query Protocol [VQP]) port, an error
You can verify your settings by entering the show interfaces interface-id switchport privileged EXEC
command and examining information in the Administrative Mode and Operational Mode rows.
Examples
This example shows how to configure a port for access mode:
Switch(config)# interface gigabitethernet2/0/1
Switch(config-if)# switchport mode access
This example shows how set the port to dynamic desirable mode:
Switch(config)# interface gigabitethernet2/0/1
Switch(config-if)# switchport mode dynamic desirable
This example shows how to configure a port for trunk mode:
Switch(config)# interface gigabitethernet2/0/1
Switch(config-if)# switchport mode trunk
OL-29043 -01
command to disable trunking.
nonegotiate interface configuration commands to cause the interface to become a trunk but to not
generate DTP frames.
enabled. If you try to change the mode of an IEEE 802.1x-enabled port to trunk, the port mode is not
changed.
appears, and IEEE 802.1x is not enabled. If you try to change the mode of an IEEE 802.1x-enabled port
to dynamic auto or dynamic desirable, the port mode is not changed.
message appears, and IEEE 802.1x is not enabled. If you try to change an IEEE 802.1x-enabled port to
dynamic VLAN assignment, an error message appears, and the VLAN configuration is not changed.
Catalyst 2960-X Switch Layer 2 Command Reference, Cisco IOS Release 15.0(2)EX
switchport mode
117