2.2 Configure and verify links between switches

CCNA 200-301 v1.1 · 2.0 Network Access

A trunk carries many VLANs over one link between switches (or to a router or server). Each frame gets an 802.1Q tag that names its VLAN, except frames in the native VLAN, which cross untagged. For the CCNA you configure trunks, know what is in the tag, and keep the native VLAN matched on both ends.

What you must know

Trunk ports

Set trunks statically and turn negotiation off. Dynamic Trunking Protocol (DTP) can form a trunk by itself, which is convenient but lets any device that speaks DTP ask for every VLAN.

interface GigabitEthernet0/1
 switchport trunk encapsulation dot1q   ! only on switches that also support ISL
 switchport mode trunk
 switchport nonegotiate
 switchport trunk native vlan 99
 switchport trunk allowed vlan 10,20,99
This endOther endResult
trunktrunk, dynamic desirable or dynamic autoTrunk
dynamic desirabledynamic desirable or dynamic autoTrunk
dynamic autodynamic autoAccess: neither side asks
accessanythingAccess

The allowed list is the set of VLANs the trunk may carry. In the drawing, VLAN 10 crosses the trunk (1), but VLAN 30 is not in the allowed list, so SW1 never sends it to SW2 (2).

802.1Q tagging

802.1Q inserts a 4-byte tag between the source MAC address and the EtherType. The switch recalculates the frame check sequence because the frame changed. The receiving switch reads the tag, removes it, and forwards the frame only to ports in that VLAN.

FieldBitsWhat it holds
TPID160x8100: marks the frame as tagged.
PCP (priority)3Class of Service 0 to 7, used by QoS.
DEI1Drop eligible indicator.
VID12The VLAN ID: 4,096 values, 1 to 4094 usable.

ISL, Cisco's older trunking method, wrapped the whole frame in a new header. Current switches support only 802.1Q, which is why switchport trunk encapsulation is often rejected or missing.

Native VLAN

Frames in the native VLAN cross the trunk without a tag, and any untagged frame received on a trunk is put in the native VLAN. The default is VLAN 1.

Both ends must use the same native VLAN. If SW1 uses 99 and SW2 uses 1, an untagged frame sent in VLAN 99 is received in VLAN 1: the two VLANs are silently joined. CDP notices and logs %CDP-4-NATIVE_VLAN_MISMATCH, and STP may block the port.

Commands

show interfaces trunkTrunk ports with mode, encapsulation, native VLAN, then the allowed VLANs, the allowed and active ones, and the ones forwarding in STP.
show interfaces Gi0/1 switchportAdministrative and operational mode, negotiation (DTP), native VLAN and allowed VLANs of one port.
show dtp interface Gi0/1The DTP state of one port.
show cdp neighbors detailThe neighbor's port and native VLAN, useful for spotting a mismatch.

Exam traps

Check yourself

SW1 is dynamic auto and SW2 is dynamic auto. What is the link?
An access link. Neither side actively asks for a trunk.
How large is the 802.1Q tag, and which field holds the VLAN?
4 bytes. The 12-bit VLAN ID (VID) field.
Hosts in VLAN 99 on SW1 reach hosts in VLAN 1 on SW2. What is wrong?
The native VLAN does not match: 99 on SW1 and 1 on SW2. Untagged frames leave SW1 from VLAN 99 and are received into VLAN 1 on SW2.
You need to add VLAN 40 to a trunk that allows 10 and 20. What do you type?
switchport trunk allowed vlan add 40. Without add, the list becomes only 40.

Labs

Try it live: VLANs, trunks and inter-VLAN routing (SVIs)

More topics in 2.0 Network Access