🌐

Understanding VLANs and Trunk Ports

May 21, 2025

Jeremy’s IT Lab - CCNA Lecture Notes

Introduction

  • Continuation of the topic of VLANs (Virtual Local Area Networks)
  • Review from previous lesson (Day 16): Basics of VLANs and basic configurations
  • Today’s focus: Advanced basics necessary for understanding and using VLANs

Key Topics Covered

Trunk Ports

  • Definition: Unlike access ports which belong to a single VLAN, trunk ports carry traffic from multiple VLANs over a single interface.
  • Purpose: Allow switches to forward traffic from multiple VLANs over a single physical interface to save resources.

802.1Q Encapsulation

  • Function: Adds a tag to Ethernet frames to identify which VLAN they belong to when sent over trunk ports.
  • Structure: Inserts a 4-byte tag between the source MAC address and type/length fields of the Ethernet frame.
    • Components:
      • TPID (16 bits, always 0x8100 to indicate a dot1q-tagged frame)
      • TCI, which includes:
        • PCP (3 bits, Priority Code Point for prioritizing traffic)
        • DEI (1 bit, Drop Eligible Indicator for network congestion)
        • VID (12 bits, VLAN ID, identifies the VLAN the frame belongs to)
  • VLAN Range: 1-4094 (0 and 4095 are reserved). Extended range: 1006-4094 not supported by older devices.

Network Topology

  • Two switches involved with split VLANs for departments across physical locations.
  • Trunk ports replace separate connections for each VLAN between switches and routers.

Trunk Port Configuration

  • Commands:
    • SWITCHPORT MODE TRUNK: Configures interface as a trunk.
    • SWITCHPORT TRUNK ENCAPSULATION dot1q: Defines encapsulation type (necessary on some switches).
    • SHOW INTERFACES TRUNK: Checks trunk configurations.
    • SWITCHPORT TRUNK ALLOWED VLAN: Limits VLANs on trunk for security and performance.
    • SWITCHPORT TRUNK NATIVE VLAN: Changes native VLAN (frames in native VLAN are untagged).

Native VLAN

  • Function: Frames in the native VLAN are not tagged.
  • Importance: Native VLAN configuration must match between switches to avoid issues.

Router on a Stick (ROAS)

  • Concept: Used for inter-VLAN routing using a single physical interface on the router divided into subinterfaces.
  • Configuration:
    • Subinterface named to match VLAN numbers (recommended).
    • ENCAPSULATION DOT1Q <VLAN>: Router treats frames tagged with specified VLAN as arriving on that subinterface.

Review and Quiz

  • Trunk Ports: Carry traffic over multiple VLANs.
  • 802.1Q Encapsulation: Identifies VLAN of frame.
  • Router on a Stick: Efficient inter-VLAN routing using subinterfaces.

Practice Questions

  1. Command to send untagged VLAN10 frames: switchport trunk native vlan 10.
  2. Restore default VLAN allowance on trunk: switchport trunk allowed vlan all.
  3. Fix command rejection when setting trunk: switchport trunk encapsulation dot1q.
  4. Field identifying VLAN ID in 802.1Q tag: VID.
  5. VLAN10 not appearing in allowed VLANs: Check if VLAN10 exists on the switch.

Supplementary Materials

  • Flashcards for review.
  • Packet tracer lab for practice.

Acknowledgements

  • Thanks to JCNP-level channel members for support.
  • Encouragement to subscribe, like, comment, and share to spread the free CCNA series.