GUIDE #09200-301200-301CISCO CCNA • ROUTING & SWITCHING9 min read

Mastering Longest Prefix Match Routing, Spanning Tree & VLAN Trunking for CCNA 200-301

How to read show ip route output without falling for traps, STP Root Bridge election, LACP/PAgP EtherChannels, and Dynamic ARP Inspection.

Duc Anh Vu

Network & Security Specialist • CCNP Enterprise • CCNA 200-301

Updated: Sep 29, 2026

Never let Administrative Distance trick you when two routes have different subnet mask lengths (/27 always beats /24 regardless of routing protocol).

● KEY TAKEAWAYS & EXAM BLUEPRINT SUMMARY

  • 01Cisco routers select forwarding paths in a strict, unbreakable order: (1) Longest Prefix Match (/28 beats /24) → (2) Lowest Administrative Distance (AD) → (3) Lowest Metric.
  • 02Memorize the default Administrative Distance table: Connected (0), Static (1), eBGP (20), Internal EIGRP (90), OSPF (110), RIP (120).
  • 03Understand Root Bridge election in Spanning Tree Protocol (STP 802.1D / RSTP 802.1w) based on the lowest Bridge ID = Priority + Extended System ID + MAC Address.
  • 04Master Layer 2 VLAN Trunking (802.1Q), Native VLANs, EtherChannel negotiation (LACP vs. PAgP), and Dynamic ARP Inspection (DAI).

1. Router Packet Forwarding Decision Order

On the Cisco CCNA 200-301 exam, roughly 25% of routing questions show you a show ip route table and ask which interface or next-hop IP the router will use for a given destination IP. Many candidates fall into the trap of comparing Administrative Distance (AD) first—forgetting that a router always evaluates the Longest Prefix Match (most specific subnet mask) before anything else!

CCNA SCENARIO WALKTHROUGH • LONGEST PREFIX MATCH VS. AD

Scenario Prompt:

Router R1 receives a packet destined for 10.1.5.65. Its routing table contains three matching routes: (1) OSPF [110/20] to 10.1.5.0/24 via Gi0/1; (2) EIGRP [90/28160] to 10.1.0.0/16 via Gi0/2; and (3) RIP [120/3] to 10.1.5.64/27 via Gi0/3. Which interface will R1 use to forward the packet?

✕ Common Distractor Trap

Interface Gi0/2 because EIGRP has the lowest Administrative Distance (AD = 90).

✓ Recommended Architecture

Interface Gi0/3 (the RIP route) because the subnet 10.1.5.64/27 (host range .64 to .95) contains 10.1.5.65 and has the longest prefix mask (/27 > /24 > /16).

Core Architectural Rationale: Administrative Distance (AD) is only used as a tie-breaker when two routing protocols advertise the EXACT SAME network prefix and mask length. When prefix lengths differ, Longest Prefix Match always wins.
Default Administrative Distance (AD) Values Required for the CCNA Exam
Route SourceDefault AD ValueKey Exam Day Notes
Connected Interface0Highest precedence whenever the physical interface is up/up
Static Route1Configuring a custom AD higher than a dynamic protocol creates a Floating Static Route
External BGP (eBGP)20Inter-domain routing between Autonomous Systems (AS)
Internal EIGRP90Cisco advanced distance-vector routing protocol
OSPF110Most heavily tested link-state protocol on CCNA 200-301
RIPv2120Legacy distance-vector protocol using hop count (max 15 hops)

2. Layer 2 Switching: VLANs, 802.1Q Trunking, STP & EtherChannel

EtherChannel Negotiation Traps: LACP (802.3ad) vs. PAgP

To bundle multiple physical switch links into a logical Port-channel, both switches must match on speed, duplex, Native VLAN, Allowed VLAN list, and channel negotiation mode:

  • •LACP (IEEE 802.3ad Open Standard): Uses the keywords active (initiates negotiation) and passive (listens only). A bundle forms only if at least one side is active (Active-Active or Active-Passive).
  • •PAgP (Cisco Proprietary): Uses the keywords desirable and auto. A bundle forms only if at least one side is desirable (Desirable-Desirable or Desirable-Auto).
  • •Static EtherChannel (Mode ON): Both switches must be configured as mode on (no LACP or PAgP negotiation packets are sent).

3. Layer 2 Switch Security: Port Security, DHCP Snooping & DAI

Standard Cisco IOS Configuration for DHCP Snooping + Dynamic ARP Inspection (DAI)
! 1. Enable DHCP Snooping globally and on VLAN 10:
Switch(config)# ip dhcp snooping
Switch(config)# ip dhcp snooping vlan 10
! Mark the uplink port connected to the legitimate DHCP Server as Trusted:
Switch(config)# interface GigabitEthernet0/1
Switch(config-if)# ip dhcp snooping trust

! 2. Enable Dynamic ARP Inspection (DAI) backed by the DHCP Snooping Binding Database:
Switch(config)# ip arp inspection vlan 10
Switch(config)# interface GigabitEthernet0/1
Switch(config-if)# ip arp inspection trust

✓ CCNA EXAM TIP: INSTANT STP ROOT BRIDGE ELECTION

The switch with the LOWEST Bridge ID wins the Root Bridge election. Compare the Bridge Priority first (default is 32768 + VLAN ID). If two switches share the exact same Priority, the switch with the lowest hexadecimal MAC address (read left-to-right) becomes the Root Bridge!
LearnAWS by CertWorm

COMPANION MOBILE APP

LearnAWS by CertWorm

Turn these architecture blueprints into daily muscle memory with AI Study Coach roadmaps, timed 65-question mock exams, and choice-level rationales on iOS & Android.

CONTINUE READING (9 MORE TECHNICAL GUIDES)

More Certification Study Guides

#01SAA-C03SAA-C03
10 min read

How to Pass AWS Solutions Architect Associate (SAA-C03) on Your First Attempt in 6 Weeks

The SAA-C03 exam packs 65 scenario-based questions into 130 minutes. Rather than skimming thousands of pages of docs, mastering service trade-offs accounts for 80% of your score.

Read guide
#02CKACKA
9 min read

Mastering All 17 Hands-On CLI Tasks in the 120-Minute Kubernetes CKA Exam

Unlike multiple-choice exams, the CKA drops you into a live Linux terminal across 6 clusters to fix broken kubelets, restore ETCD, and author NetworkPolicies.

Read guide
#03AZ-104AZ-104
8 min read

Azure (AZ-104) vs. AWS (SAA-C03) Service Mapping Guide for Multi-Cloud Engineers

If you already know AWS and are preparing for Azure Administrator (AZ-104), mapping equivalent architectural primitives cuts your study time in half.

Read guide
#04SM-2SM-2
7 min read

Using the SuperMemo-2 (SM-2) Algorithm to Retain 800+ Cloud Architecture Concepts

The Ebbinghaus Forgetting Curve proves that engineers lose over 60% of newly read technical limits within 24 hours without active spaced retrieval.

Read guide
#05SY0-701SY0-701
8 min read

5 Classic Networking & Security Exam Traps in CompTIA Security+ (SY0-701) & CCNA

Both CompTIA Security+ (SY0-701) and Cisco CCNA (200-301) heavily test scenario-based architecture and performance-based troubleshooting.

Read guide
#06GCP-PCAGCP-PCA
9 min read

Decoding All 4 Official Case Studies in the Google Cloud Architect (GCP-PCA) Exam

Nearly 30% of questions on the GCP-PCA exam directly reference 4 pre-published enterprise case studies. Mapping their service stacks beforehand is your biggest advantage.

Read guide
#07PMP®PMP®
8 min read

Solving All 180 Agile & Hybrid Situational Questions in the PMI PMP® Exam

On the PMP exam, all four options often sound reasonable, but only one follows the strict PMI Mindset sequence: Assess first, collaborate second, act third.

Read guide
#08CLF-C02CLF-C02
7 min read

AWS Cloud Practitioner (CLF-C02) Guide: Shared Responsibility, CAF & Support Plans

CLF-C02 is the ideal launchpad into cloud engineering. Mastering Security OF the Cloud vs. Security IN the Cloud locks in 30% of your total exam score.

Read guide
#10SAA-C03SAA-C03
9 min read

Anatomy of AWS IAM Policy Evaluation Logic, SCPs, Permissions Boundaries & Cross-Account Roles

A single Explicit Deny in any policy layer overrides every Allow statement. Let’s dissect the 5-step AWS IAM evaluation pipeline with real JSON policies.

Read guide