Quiz Entry - updated: 2026.07.14
What are the IOS (Internetwork Operating System) commands to configure a trunk port?
Enter the interface, set trunk mode with switchport mode trunk, optionally set the native VLAN (Virtual Local Area Network) and allowed VLANs list.
Command sequence:
S1(config)# interface fa0/1
S1(config-if)# switchport mode trunk
S1(config-if)# switchport trunk native vlan 99
S1(config-if)# switchport trunk allowed vlan 10,20,30,99
S1(config-if)# end
What each command does:
| Command | Purpose |
|---|---|
switchport mode trunk |
Sets the port to permanent trunk mode |
switchport trunk native vlan 99 |
Changes the native VLAN from 1 to 99 (security best practice) |
switchport trunk allowed vlan 10,20,30,99 |
Restricts which VLANs can traverse this trunk (default is ALL) |
Important notes:
- On Catalyst 2960 switches (Layer 2 only), you can set trunk mode directly
- On Layer 3 switches, you must first set the encapsulation:
switchport trunk encapsulation dot1qbefore setting trunk mode - By default, a trunk allows all VLANs (1–4095) — restricting the allowed list is a security best practice
- Both ends of the trunk must have matching native VLANs or you'll get errors and potential security vulnerabilities