# Day 24: Dynamic Routing

# CCNA 200-301 Study Guide: IP Connectivity

## 1.0 Introduction

IP Connectivity is the mechanism that enables communication between devices on different network segments. It is the core function of Layer 3 devices (routers and multilayer switches). In the CCNA 200-301 exam, this domain accounts for 25% of the total score.

## 2.0 Foundational Routing Methods: Static vs. Dynamic

The choice between static and dynamic routing impacts scalability, resiliency, and administrative overhead.

<div align="left" dir="ltr" id="bkmrk-feature-static-routi"><table><colgroup><col width="125"></col><col width="218"></col><col width="259"></col></colgroup><tbody><tr><td>Feature

</td><td>Static Routing

</td><td>Dynamic Routing

</td></tr><tr><td>Configuration

</td><td>Manually defined by an administrator.

</td><td>Automatically learned from neighbors.

</td></tr><tr><td>Adaptability

</td><td>Fixed; requires manual intervention if a link fails.

</td><td>Automatically recalculates paths during topology changes.

</td></tr><tr><td>Scalability

</td><td>Low; impractical for large networks.

</td><td>High; manages thousands of routes efficiently.

</td></tr><tr><td>Resources

</td><td>Low CPU/RAM requirements.

</td><td>Requires CPU/RAM to run protocol algorithms.

</td></tr><tr><td>Best Use Case

</td><td>Stub networks or Default Gateways.

</td><td>Large enterprise core/distribution layers.

</td></tr></tbody></table>

</div>## 3.0 Deconstructing Dynamic Routing Protocols

Dynamic protocols are classified by their Scope (where they run) and their Algorithm (how they calculate math).

### 3.1 Classification by Scope

- Interior Gateway Protocol (IGP): Used within a single Autonomous System (AS).
- Examples: OSPF, EIGRP, RIP, IS-IS.

- Exterior Gateway Protocol (EGP): Used to connect different Autonomous Systems.
- Example: BGP (The protocol of the Internet).


### 3.2 Classification by Algorithm

- Distance Vector: "Routing by rumor." Routers only know what neighbors tell them.
- Examples: RIP (Metric: Hop Count), EIGRP (Advanced Distance Vector).

- Link State: Every router has a complete map of the topology.
- Examples: OSPF, IS-IS (Metric: Cost/Bandwidth).

- Path Vector: Specific to BGP; uses AS-Path information to prevent loops.

## 4.0 The Router's Path Selection Logic

When a router learns multiple paths to the same destination, it uses a strict three-step hierarchy to choose the best route for the Routing Table.

### Step 1: Longest Prefix Match (LPM)

The router prefers the most specific route (the longest subnet mask). This rule overrides everything else.

- Example: A packet destined for 10.1.1.5 matches both 10.0.0.0/8 and 10.1.1.0/24.
- Winner: 10.1.1.0/24 because $24 &gt; 8$.

### Step 2: Administrative Distance (AD)

If prefix lengths are identical, the router chooses the most "trustworthy" source.

<div align="left" dir="ltr" id="bkmrk-route-source-default"><table><colgroup><col width="141"></col><col width="102"></col></colgroup><tbody><tr><td>Route Source

</td><td>Default AD

</td></tr><tr><td>Connected

</td><td>0

</td></tr><tr><td>Static

</td><td>1

</td></tr><tr><td>EIGRP (Internal)

</td><td>90

</td></tr><tr><td>OSPF

</td><td>110

</td></tr><tr><td>RIP

</td><td>120

</td></tr></tbody></table>

</div>### Step 3: Metric

If the prefix length and AD are identical, the router chooses the path with the lowest cost (metric) calculated by the protocol.

## 5.0 Advanced Routing Concepts

### 5.1 Floating Static Routes

A Floating Static Route is a backup route with a manually configured AD higher than the primary dynamic protocol.

- Primary: OSPF (AD 110)
- Backup: Static Route (AD 111)
- Logic: The static route "floats" (stays out of the table) until the OSPF route fails.
- Command: ip route 10.0.2.0 255.255.255.0 192.168.1.1 111

### 5.2 Equal-Cost Multi-Path (ECMP)

If multiple paths have the same Prefix Length, same AD, and same Metric, the router installs all of them and load-balances traffic across them.

## 6.0 Essential Command Reference

### 6.1 Verification

<div align="left" dir="ltr" id="bkmrk-command-purpose-show"><table><colgroup><col width="163"></col><col width="392"></col></colgroup><tbody><tr><td>Command

</td><td>Purpose

</td></tr><tr><td>show ip route

</td><td>View the IPv4 routing table.

</td></tr><tr><td>traceroute &lt;ip&gt;

</td><td>Trace the hop-by-hop path to a destination.

</td></tr><tr><td>show ip protocols

</td><td>Verify dynamic routing protocol parameters and AD.

</td></tr></tbody></table>

</div>### 6.2 Configuration

- Standard Static Route:  
    ip route &lt;network&gt; &lt;mask&gt; &lt;next-hop-ip&gt;
- Default Route (Gateway of Last Resort):  
    ip route 0.0.0.0 0.0.0.0 &lt;next-hop-ip&gt;
- Loopback Interface (Stable Management IP):  
    interface Loopback0

## 7.0 TL;DR Summary

1. Selection Logic: Longest Match $\\rightarrow$ Lowest AD $\\rightarrow$ Lowest Metric.
2. Distance Vector protocols see neighbors; Link State protocols see the whole map.
3. Floating Static Routes are created by increasing the AD of a static route to exceed the dynamic protocol's AD.
4. BGP is the only EGP; it is a Path Vector protocol.