Sub topic 2
Trunk Ports: Carrying Many VLANs on One Link
Assume you understand Ethernet frames, MAC learning, IPv4 subnets, and basic switch commands. A trunk is a switch port that carries traffic for multiple VLANs over one physical link. The link between switches is a common example.
How trunks identify VLANs
An access port carries one VLAN and normally sends untagged frames. A trunk adds an IEEE 802.1Q tag to identify the VLAN for each frame.
The tag is inserted after the source MAC address:
- TPID: 16 bits, usually
0x8100, identifying an 802.1Q tag. - TCI: 16 bits containing:
- PCP: 3-bit priority value.
- DEI: 1-bit drop-eligibility indicator.
- VID: 12-bit VLAN ID.
VLAN IDs 1 through 4094 are usable in the standard range. VLAN ID 0 carries priority information without identifying a VLAN, and 4095 is reserved.
The native VLAN
The native VLAN is the VLAN whose frames a trunk sends without an 802.1Q tag. Both ends of a trunk must use the same native VLAN. A mismatch can place untagged traffic into different VLANs and generate switch warnings.
Limit the allowed VLANs
A trunk may support many VLANs, but it should carry only the VLANs needed on that link. This reduces unnecessary broadcasts and limits the effect of configuration errors.
interface GigabitEthernet0/24
switchport mode trunk
switchport trunk native vlan 999
switchport trunk allowed vlan 10,20Disable unnecessary negotiation
Cisco Dynamic Trunking Protocol (DTP) can negotiate whether a link becomes a trunk. On a link that you control, configure trunking explicitly and disable DTP:
interface GigabitEthernet0/24
switchport mode trunk
switchport nonegotiateThe connected device must also be configured appropriately. switchport nonegotiate prevents DTP frames; it does not itself create a trunk.
Exercise
A VLAN 20 host works across a trunk, but VLAN 30 does not. What should you check first?
Show answer
Verify that VLAN 30 exists on both switches and appears in the trunk's allowed-VLAN list.