Dynamic Trunking Protocol
Cisco switches can negotiate whether a link becomes a trunk, using DTP. Each port's switchport mode decides what it does:
| Mode | Behaviour |
|---|---|
| access | Never a trunk |
| trunk | Always a trunk; sends DTP to tell the other side |
| dynamic desirable | Actively asks to trunk |
| dynamic auto | Trunks only if the other side asks (the default on many switches) |
| trunk + nonegotiate | Always a trunk and sends no DTP at all |
Which combinations trunk?
| access | dynamic auto | dynamic desirable | trunk | |
|---|---|---|---|---|
| access | access | access | access | (mismatch) |
| dynamic auto | access | access | trunk | trunk |
| dynamic desirable | access | trunk | trunk | trunk |
| trunk | (mismatch) | trunk | trunk | trunk |
Two switches both left at dynamic auto never form a trunk: each waits for the other to ask.
In NetLab
▶ SW1 SW1>enable SW1#show interfaces g0/1 switchport | include Mode Administrative Mode: dynamic auto Operational Mode: static access Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Capture Mode Disabled SW1#show interfaces trunk SW1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. SW1(config)#interface g0/1 SW1(config-if)#switchport mode dynamic desirable SW1(config-if)#end *Mar 1 00:00:07.000: %SYS-5-CONFIG_I: Configured from console by console SW1#show interfaces trunk | include Gi0/1 Gi0/1 desirable 802.1q trunking 1 Gi0/1 1-4094 Gi0/1 1,10,20 Gi0/1 1,10,20
Remember: Best practice: hard-code every port.
switchport mode trunkplusswitchport nonegotiateon trunks,switchport mode accesson user ports, so nobody can plug in a device that negotiates a trunk and reaches every VLAN.
Tip: VTP (VLAN Trunking Protocol) can copy VLAN lists between switches, but one mistake can wipe VLANs on the whole network. Most networks run it in transparent mode or turn it off and create VLANs on each switch.