802.1Q Trunks on IOS XE Switches
Trunk ports on Catalyst 9000 switches carry multiple VLANs on a single physical link using 802.1Q tags. This lesson covers the configuration and verification of trunk ports on IOS XE switches.
What Is a Trunk Port?
A trunk port carries frames from multiple VLANs, tagged with a 4-byte 802.1Q header that identifies the VLAN. Trunk ports connect switches to other switches or to routers and are essential for building multi-VLAN networks.
Key differences from access ports:
- Access ports belong to a single VLAN; trunk ports carry many.
- Access port traffic is untagged; trunk port traffic is tagged (except for the native VLAN).
- Trunk ports are typically between switches; access ports connect to end devices.
802.1Q Tagging & Native VLAN
802.1Q tag: A 4-byte header inserted into each Ethernet frame on a trunk, containing the VLAN ID (12 bits, so VLANs 1–4094 are possible).
Native VLAN: On a trunk, frames from the native VLAN are sent and received untagged. This is for backward compatibility with devices that do not understand tags. By default, the native VLAN is VLAN 1. It must match on both ends of a trunk.
Why it matters: If Switch A's trunk native VLAN is 1 and Switch B's is 10, untagged frames arriving on one switch will be incorrectly assigned to the wrong VLAN on the other. This breaks connectivity.
Configure a Trunk Port on Catalyst 9000
This example configures two ports as a trunk link between two Catalyst 9000 switches.
Step 1: Connect to the Switch
Switch> enable
Switch# configure terminal
Switch(config)#
Step 2: Select the Port
Switch(config)# interface GigabitEthernet1/0/24
Switch(config-if)#
Step 3: Set Switchport Mode to Trunk
Switch(config-if)# switchport mode trunk
Switch(config-if)#
Explanation: On IOS XE (Catalyst 9000), there is no switchport trunk encapsulation command — the switch uses 802.1Q by default. This is different from older IOS switches.
Step 4: Specify Allowed VLANs
Switch(config-if)# switchport trunk allowed vlan 10,20,30
Switch(config-if)#
Explanation: Only frames from VLANs 10, 20, and 30 will cross this trunk. Frames from other VLANs are dropped. This prevents unnecessary traffic and improves security.
Step 5: Set the Native VLAN (Optional but Recommended)
Switch(config-if)# switchport trunk native vlan 999
Switch(config-if)#
Explanation: VLAN 999 is now the native VLAN. Any untagged frame arriving on this trunk will be assigned to VLAN 999. Using a dedicated native VLAN (not VLAN 1) isolates management and legacy traffic.
Step 6: Enable the Port and Exit
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# end
Switch# write memory
Building configuration...
[OK]
Complete Example: Trunk Between Two Catalyst 9000 Switches
Switch A (Access switch):
SwitchA# configure terminal
SwitchA(config)# interface GigabitEthernet1/0/24
SwitchA(config-if)# switchport mode trunk
SwitchA(config-if)# switchport trunk allowed vlan 10,20,30
SwitchA(config-if)# switchport trunk native vlan 999
SwitchA(config-if)# no shutdown
SwitchA(config-if)# exit
SwitchA(config)# end
SwitchA# write memory
Switch B (Distribution switch):
SwitchB# configure terminal
SwitchB(config)# interface GigabitEthernet1/0/24
SwitchB(config-if)# switchport mode trunk
SwitchB(config-if)# switchport trunk allowed vlan 10,20,30
SwitchB(config-if)# switchport trunk native vlan 999
SwitchB(config-if)# no shutdown
SwitchB(config-if)# exit
SwitchB(config)# end
SwitchB# write memory
Verify Your Configuration
Check that the port is a trunk and the VLANs are correctly configured:
Show Trunk Status
Switch# show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi1/0/24 on 802.1q trunking 999
Port Vlans allowed on trunk
Gi1/0/24 10,20,30
Port Vlans in spanning tree forwarding state
Gi1/0/24 10,20,30
Interpretation: The port is in trunking mode, using 802.1Q encapsulation, and forwarding VLANs 10, 20, and 30. The native VLAN is 999. This is healthy.
Show Port Switchport Details
Switch# show interfaces GigabitEthernet1/0/24 switchport
Name : Gi1/0/24
Switchport : Enabled
Administrative Mode : trunk
Operational Mode : trunk
Administrative Trunking Encapsulation : negotiate
Operational Trunking Encapsulation : 802.1q
Trunking Native Mode VLAN : 999 (native)
Trunking VLANs Enabled : 10,20,30
Trunking VLANs Active : 10,20,30
Show Interface Status
Switch# show interfaces GigabitEthernet1/0/24 brief
Interface IP-Address Status Protocol
GigabitEthernet1/0/24 unassigned up up
If the port shows down on the far end, check that both sides have matching allowed VLANs and native VLAN.
Trunk Port-Channels on Catalyst 9000
Port-channels can also be trunks. Configure member ports with LACP, then set the port-channel to trunk mode:
Switch# configure terminal
Switch(config)# interface range GigabitEthernet1/0/21 - 22
Switch(config-if-range)# channel-group 1 mode active
Switch(config-if-range)# exit
Switch(config)# interface Port-channel1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30
Switch(config-if)# switchport trunk native vlan 999
Switch(config-if)# no shutdown
Switch(config-if)# end
Switch# write memory
Verify the trunk port-channel:
Switch# show etherchannel summary
Group Port-channel Protocol Ports
------+-------------+-----------+-----------------------------------------------
1 Po1(SU) LACP Gi1/0/21(P) Gi1/0/22(P)
Switch# show interfaces trunk | include Port-channel
Po1(SU) on 802.1q trunking 999
Native VLAN Mismatch
A common mistake is configuring different native VLANs on each end of a trunk. For example, if Switch A has native VLAN 1 and Switch B has native VLAN 999, untagged frames from each switch will arrive on the wrong VLAN on the other side. Cisco switches log a warning for this: check show log for "VLAN mismatch with peer." Always verify native VLAN matches both ends with show interfaces trunk.
Allowed VLANs Mismatch
If Switch A allows VLANs 10,20,30 but Switch B allows only 10,20, VLAN 30 will not cross the trunk from A to B. The port will still show trunking, but VLAN 30 is silently dropped. Always ensure the allowed VLAN list is identical on both ends.
Try it: trunk two switches
DOJO-SW1 and DOJO-SW2 are wired together on Gi1/0/21 and Gi1/0/22, but those ports are still plain access ports. Configure a matching 802.1Q trunk on both sides and verify with show interfaces trunk and show cdp neighbors.
Want goals and a checklist? Take the guided kata: 802.1Q trunk between two switches · or open the full Practice Lab.
Summary
- Trunk ports on Catalyst 9000 carry multiple VLANs using 802.1Q tagging.
- Configure with
switchport mode trunk,switchport trunk allowed vlan <list>, andswitchport trunk native vlan <vlan>. - The native VLAN is untagged; it must match on both ends of the trunk.
- Port-channels can be trunks — configure the member ports with LACP, then set the port-channel to trunk mode.
- Verify with
show interfaces trunkandshow interfaces <if> switchport. - Allowed VLAN lists and native VLANs must match on both ends.