802.1Q Trunks on NX-OS
Trunk ports carry traffic from multiple VLANs using 802.1Q tags. They connect switches to each other and routers to switches. Learn to configure, verify, and troubleshoot NX-OS trunk ports.
What Is a Trunk Port?
A trunk port is a special port that carries frames from multiple VLANs on a single physical link. Each frame is tagged with a 4-byte 802.1Q header that includes the VLAN ID (0–4094). The receiving switch reads the tag and forwards the frame to the correct VLAN.
Key concepts:
- Tagged traffic: Most frames carry a VLAN tag (e.g., VLAN 10, 20, 30).
- Native VLAN: One VLAN (default: VLAN 1) travels untagged across the trunk. Used for legacy devices and management traffic.
- Allowed VLANs: You explicitly allow which VLANs can cross a trunk; all others are blocked.
- No DTP: Nexus (NX-OS) does not use Dynamic Trunking Protocol (DTP). Trunks are manually configured.
Access Port vs. Trunk Port Recap
| Port Type | Carries VLANs | Traffic Format | Use |
|---|---|---|---|
| Access | One VLAN only | Untagged | End devices (PCs, servers, phones) |
| Trunk | Multiple VLANs | Tagged (802.1Q) | Switch-to-switch, switch-to-router links |
Configure a Trunk on NX-OS
This example creates a trunk between two Nexus switches using interfaces Eth1/1 and Eth1/2.
Step 1: Enter Configuration Mode
Switch# configure terminal
Switch(config)#
Step 2: Enter Interface Configuration
Switch(config)# interface Ethernet1/1
Switch(config-if)#
Step 3: Set the Port to Trunk Mode
Switch(config-if)# switchport mode trunk
Switch(config-if)#
Explanation: switchport mode trunk converts the port from access mode to trunk mode. Once you enter this command, the port becomes a trunk immediately (no DTP negotiation on NX-OS).
Step 4: Allow Specific VLANs
Switch(config-if)# switchport trunk allowed vlan 10,20,30
Switch(config-if)#
Explanation: Only VLANs 10, 20, and 30 can cross this trunk. All other VLANs are blocked. You can also use ranges (e.g., 10-20) or all.
Step 5: Set the Native VLAN (Optional)
Switch(config-if)# switchport trunk native vlan 999
Switch(config-if)#
Explanation: VLAN 999 now travels untagged across this trunk. The default native VLAN is 1. If you do not set it explicitly, VLAN 1 is native. Important: The native VLAN must match on both sides of the trunk, or frames will be dropped silently.
Step 6: Bring Up the Port and Exit
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)#
Step 7: Repeat on the Other Switch
The second switch must have identical configuration on its side of the link:
Switch2# configure terminal
Switch2(config)# interface Ethernet1/1
Switch2(config-if)# switchport mode trunk
Switch2(config-if)# switchport trunk allowed vlan 10,20,30
Switch2(config-if)# switchport trunk native vlan 999
Switch2(config-if)# no shutdown
Switch2(config-if)# end
Step 8: Save Configuration
Switch(config)# end
Switch# copy running-config startup-config
[ok]: Copy complete.
Trunk Configuration on a Port-Channel
Trunks often run on EtherChannel port-channels for redundancy. Configure the port-channel the same way:
Switch(config)# interface port-channel 10
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)# description ISL to Dist-Switch
Switch(config-if)# no shutdown
Switch(config-if)# exit
! Now add member interfaces
Switch(config)# interface range Ethernet1/1-4
Switch(config-if-range)# switchport mode trunk
Switch(config-if-range)# channel-group 10 mode active
Switch(config-if-range)# exit
Verify Trunk Configuration
Check that the trunk is up and carrying the correct VLANs:
Switch# show interface trunk
Port Native VLAN Status Port Channel
Eth1/1 999 trunking --
Po10 999 trunking Po10
Port Vlans Allowed on Trunk
Eth1/1 10,20,30
Po10 10,20,30
Port Vlans in Spanning Tree Forwarding State
Eth1/1 10,20,30
Po10 10,20,30
Verify a specific interface:
Switch# show interface Ethernet1/1 switchport
Name: Ethernet1/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Native Mode VLAN: 999
Operational Trunking Native Mode VLAN: 999
Trunking VLANs Enabled: 10,20,30
Pruning VLANs Enabled: none
Check the physical status:
Switch# show interfaces Ethernet1/1 brief
Eth1/1 up up routed -- trunk
Allowed VLAN Syntax
You can use ranges and commas:
switchport trunk allowed vlan 10-20,30,40-50
switchport trunk allowed vlan all
switchport trunk allowed vlan except 1,1002-1005
Start with specific VLANs you know will use the link. Using all is simpler for lab but less secure in production.
Native VLAN Mismatch
If one side has native VLAN 1 and the other has native VLAN 999, untagged frames from VLAN 999 arrive as VLAN 1 on the other switch. This breaks connectivity silently — the frames are not dropped, but they arrive in the wrong VLAN. Always verify both sides match with show interface trunk.
Allowed VLAN Mismatch
If Switch A allows VLANs 10–30 but Switch B only allows 10–20, traffic from VLAN 30 will not cross the link. The port stays up, but VLAN 30 frames are pruned at the trunk. Check both sides with show interface trunk.
No DTP on NX-OS
Cisco IOS XE Catalyst switches use Dynamic Trunking Protocol (DTP) to negotiate trunk status. Nexus (NX-OS) does not. You must manually set switchport mode trunk on every trunk port. If you connect a Catalyst to a Nexus, set the Catalyst to switchport mode trunk and switchport nonegotiate to disable DTP negotiation.
Try it: trunks on NX-OS
A simulated Nexus 9000 with VLANs 10, 20 and 100 and ESX trunks already in place. Add VLAN 30, allow it on the Ethernet1/3 trunk, and verify with show interface trunk. Remember feature commands come first on NX-OS.
Want goals and a checklist? Take the guided kata: Nexus vPC (brown belt) · or open the full Practice Lab.
Summary
- Trunk ports carry multiple VLANs using 802.1Q tags. Access ports carry one VLAN, untagged.
- Configure with
switchport mode trunk, thenswitchport trunk allowed vlan <list>to restrict which VLANs cross. - Set the native VLAN with
switchport trunk native vlan <id>; it must match on both ends. - NX-OS has no DTP — trunks are static. Always verify both sides with
show interface trunk. - Trunks work on both regular interfaces and port-channels; configure the port-channel the same way.