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
- Configure a static trunk and limit the VLANs it carries with an allowed list.
- Predict whether two ports form a trunk from their DTP modes.
- Name the four fields of the 802.1Q tag and its size.
- Explain what the native VLAN is, why both ends must agree, and why it should not be VLAN 1.
- Read
show interfaces trunksection by section.
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 end | Other end | Result |
|---|---|---|
| trunk | trunk, dynamic desirable or dynamic auto | Trunk |
| dynamic desirable | dynamic desirable or dynamic auto | Trunk |
| dynamic auto | dynamic auto | Access: neither side asks |
| access | anything | Access |
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.
| Field | Bits | What it holds |
|---|---|---|
| TPID | 16 | 0x8100: marks the frame as tagged. |
| PCP (priority) | 3 | Class of Service 0 to 7, used by QoS. |
| DEI | 1 | Drop eligible indicator. |
| VID | 12 | The 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 trunk | Trunk 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 switchport | Administrative and operational mode, negotiation (DTP), native VLAN and allowed VLANs of one port. |
show dtp interface Gi0/1 | The DTP state of one port. |
show cdp neighbors detail | The neighbor's port and native VLAN, useful for spotting a mismatch. |
Exam traps
switchport trunk allowed vlan 30replaces the list. Useswitchport trunk allowed vlan add 30to add one VLAN.- Two ports in
dynamic autostay access ports. One side must betrunkordynamic desirable. - The native VLAN is not tagged. Changing it on one end only joins two VLANs; it does not stop the link.
- A VLAN in the allowed list still does not cross if it does not exist on the switch: check the "allowed and active" section.
switchport nonegotiateturns DTP off. It only works on a port set totrunkoraccess.
Check yourself
- SW1 is
dynamic autoand SW2 isdynamic 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. Withoutadd, the list becomes only 40.
Labs
Try it live: VLANs, trunks and inter-VLAN routing (SVIs)
More topics in 2.0 Network Access
- 2.4 Configure and verify LACP EtherChannels at Layer 2 and Layer 3
- 2.5 Interpret how Rapid PVST+ spanning tree operates
- 2.6 Describe how Cisco wireless is architected and what each AP mode does
- 2.7 Describe how APs, WLCs and switch ports are physically connected, including LAG
- 2.8 Describe ways to manage network devices: console, Telnet, SSH, HTTP(S), TACACS+/RADIUS, cloud
- 2.9 Interpret the WLC GUI settings that control client connectivity: WLANs, security, QoS, advanced