Day 11: Routing Fundamentals
CCNA 200-301 Study Guide: IP Routing Fundamentals & Static Routing
1.0 Introduction: The Core of IP Connectivity
IP routing is the Layer 3 function that enables communication across different network segments. It is a major component of the IP Connectivity domain, representing 25% of the CCNA exam.
Layer 2 Switching vs. Layer 3 Routing
|
Function |
Layer 2 Switching |
Layer 3 Routing |
|
Primary Role |
Forwards traffic within a single LAN/broadcast domain. |
Forwards traffic between different IP networks/subnets. |
|
PDU Handled |
Frame. Decisions based on Destination MAC. |
Packet. Decisions based on Destination IP. |
|
Unknown Destination |
Floods the frame to all ports (except source). |
Drops the packet if no matching route is found. |
2.0 Deconstructing the IP Routing Table
The routing table is a RAM-based map of the network. The command to view it is show ip route.
Routing Table Components
|
Component |
Description |
Significance |
|
Source Code |
A letter code (e.g., S, C, L, O, R). |
Identifies how the route was learned and its trustworthiness. |
|
Destination Network |
The remote network prefix and mask. |
The "destination" target for incoming packets. |
|
Admin Distance (AD) |
A value from 0–255. |
Tie-breaker for trustworthiness (Lower is better). |
|
Metric |
Path "cost" calculated by the protocol. |
Tie-breaker if multiple routes have the same AD. |
|
Next Hop |
The IP of the next router in the path. |
The immediate next device to receive the packet. |
|
Exit Interface |
The local physical/virtual outbound port. |
The "door" the packet leaves through. |
Automatically Populated Routes
-
Connected (C): The network segment directly attached to an active interface.
-
Local (L): A host route ($/32$) for the specific IP assigned to the router's interface.
3.0 The Path Selection Process: A Router's Logic
Routers follow a non-negotiable, three-step hierarchical logic to determine the "Best Path."
-
Longest Prefix Match (LPM): The router prefers the most specific route (the one with the longest subnet mask).
-
Example: For destination 10.1.1.5, a /32 route beats a /24 route.
-
-
Administrative Distance (AD): If prefix lengths are identical, the router selects the source with the lowest AD.
-
Connected: 0
-
Static: 1
-
OSPF: 110
-
-
Metric: If both prefix length and AD are identical, the path with the lowest cost (metric) is chosen.
4.0 Static Routing: Manual Network Navigation
Static routes are manually configured using the ip route command. They are ideal for "Stub" networks with a single exit path.
|
Advantages |
Disadvantages |
|
Low CPU/RAM overhead (no protocol calculations). |
Not scalable for large, complex networks. |
|
Highly predictable and explicit traffic flow. |
Requires manual intervention for every topology change. |
|
Secure (does not advertise network info). |
High administrative effort. |
Configuration Methods
-
Next-Hop IP: Recommended for multi-access (Ethernet) segments.
-
ip route 10.2.2.0 255.255.255.0 192.168.1.2
-
-
Exit Interface: Primarily for point-to-point links.
-
ip route 10.2.2.0 255.255.255.0 g0/1
-
-
Fully Specified: Provides both interface and next-hop; avoids recursive lookups.
-
ip route 10.2.2.0 255.255.255.0 g0/1 192.168.1.2
-
5.0 The Default Route: Gateway of Last Resort
The default route acts as a safety net for packets that do not match any other specific entry in the routing table.
-
Syntax: 0.0.0.0 0.0.0.0 (CIDR notation: /0).
-
Logic: Because it has a prefix length of zero, it is the least specific route possible and is only used if all other entries fail to match.
-
Verification: Identified in the routing table by the code S*. The asterisk (*) signifies the active candidate for the gateway of last resort.
6.0 Packet Forwarding Mechanics: L2 and L3 Journey
As a packet travels across routers, its encapsulation changes.
-
IP Addresses (Layer 3): Remain unchanged from source to destination (unless NAT is applied).
-
MAC Addresses (Layer 2): Are rewritten at every hop. Each router replaces the source MAC with its own exit interface and the destination MAC with the next hop's address.
The Forwarding Procedure
-
De-encapsulate: Strip the L2 frame to see the L3 packet.
-
Lookup: Find the best path in the routing table.
-
Re-encapsulate: Wrap the packet in a new L2 frame for the next hop.
7.0 Core Troubleshooting for Static Routes
-
Verify Interface Status: Use show ip interface brief. Interfaces must be up/up. A static route is removed if its exit interface is down.
-
Confirm Route Presence: Use show ip route. Ensure no typos were made during configuration.
-
Recursive Lookup Check: The router must have a valid route to the Next-Hop IP for the static route to be installed in the table.
-
Ensure Route Symmetry: Check that the return path exists on the remote router. Routing is a one-way decision.
8.0 Summary of Key Concepts
-
LPM is the first rule of routing; specificity always wins.
-
Static Routes have a default AD of 1.
-
Connected Routes have the lowest possible AD of 0.
-
Default Routes handle all otherwise unmatchable traffic and use the /0 mask.