Viewing the Routing Table – Understanding Network Paths

Purpose of the Routing Table

Definition: The routing table is a database on routers and Layer 3 switches listing known network destinations, next hops, and how to reach them.

Why View the Routing Table?

  • To understand how the device will forward network traffic.
  • To diagnose routing issues (e.g., missing, incorrect, or duplicate routes).
  • To verify protocol operation, advertisements, and configuration changes.

Common Commands to View the Routing Table

  • IPv4 Routing Table: show ip route
  • IPv6 Routing Table: show ipv6 route
  • Filter for specific networks/protocols:
    show ip route | include 192.168
    show ip route ospf

Reading Routing Table Entries

Router# show ip route

Codes: C - connected, S - static, O - OSPF, D - EIGRP, R - RIP, B - BGP, ...
Gateway of last resort is 192.168.1.1 to network 0.0.0.0

C    192.168.10.0/24 is directly connected, GigabitEthernet0/1
O    10.0.0.0/24 [110/20] via 192.168.1.2, 00:00:12, GigabitEthernet0/2
S*   0.0.0.0/0 [1/0] via 192.168.1.1
      
Fields explained:
  • Route Code: (C, S, O, D, etc.) – Indicates how the route was learned.
  • Destination network: (e.g., 192.168.10.0/24)
  • Next-hop IP address: (e.g., via 192.168.1.2)
  • Exit Interface: (e.g., GigabitEthernet0/2)
  • Metric & AD: (e.g., [110/20])
  • Route Age: (e.g., 00:00:12)

Route Types and Codes

Code Meaning How Learned/Configured
CConnectedDirectly on interface
SStaticManually configured
OOSPFOSPF dynamic protocol
DEIGRPEIGRP protocol
RRIPRIP protocol
BBGPBorder Gateway Protocol
S*Static DefaultDefault route (0.0.0.0/0)

Administrative Distance (AD) and Metrics

  • Administrative Distance (AD): Trustworthiness of a route (lower = more preferred).
    Common values:
    SourceAD Value
    Connected0
    Static1
    EIGRP90
    OSPF110
    RIP120
  • Metric: Route cost (protocol-dependent; lower is better). Used if AD is equal between routes.

Route Selection Process

  1. Router compares AD values; picks the route with the lowest AD for each destination.
  2. If AD is the same, selects the route with the lowest metric.

Default Routes and Gateway of Last Resort

  • Default Route: 0.0.0.0/0 (IPv4) or ::/0 (IPv6). Used when no specific match exists.
  • Gateway of Last Resort: Next-hop for the default route. Critical for Internet access and unknown destinations.
    S* 0.0.0.0/0 [1/0] via 192.168.1.1

Summary Routes and Aggregation

Summary route: Represents a group of subnets as one entry (e.g., 10.0.0.0/16 summarizes 10.0.1.0/24, 10.0.2.0/24).
Benefits: Reduces routing table size, improves scalability, and limits advertisements.

Floating Static Routes

Floating static route: Backup route with a higher AD than the primary.
Used only if the main route is lost.

ip route 10.0.0.0 255.255.255.0 192.168.2.1 200

Route Aging and Timers

  • Dynamic routes will age out if not refreshed (e.g., neighbor failure).
  • Route age shown in table (e.g., 00:01:22 for last update time).

Troubleshooting with the Routing Table

  • Check for missing routes: May indicate configuration/protocol issues.
  • Verify correct next-hop: Use ping and traceroute for neighbor reachability.
  • Identify route flapping: Instability; check interfaces, links, protocol configuration.
  • Use filtering:
    show ip route | include 10.10.10.0

Filtering and Searching the Routing Table

  • show ip route | include 192.168 — Only show entries matching 192.168 networks.
  • show ip route | begin OSPF — Start display from OSPF routes.

Differences Across Platforms

  • Cisco IOS: Standard codes and output as above.
  • Other vendors: Codes and formatting may differ (Juniper, MikroTik, etc.). Always consult device documentation.

Example: Real-World Use Case

Scenario: John’s PC (192.168.10.20) can’t reach the internet.
  1. Check the routing table: show ip route
  2. Is there a default route (0.0.0.0/0) pointing to the gateway? If not, add one.
  3. Is there a route to John’s subnet? If not, fix dynamic or static route config.
  4. Is the next-hop reachable? Use ping and traceroute.

Exam Tips and Key Points

  • Be able to interpret all routing table fields: code, destination, next-hop, interface, metric, age.
  • Know the protocol codes (C, S, O, D, etc.) and what they mean.
  • Understand route selection: lowest AD first, then lowest metric.
  • Recognize the role of default route and gateway of last resort.
  • Troubleshoot missing or incorrect routes by consulting the table and protocol status.
  • Use command modifiers and filtering to quickly find information.

View Routing Table Quiz

1. What is the main purpose of viewing the routing table on a router?

Correct answer is C. Viewing the routing table helps in understanding packet forwarding and troubleshooting routing problems.

2. Which command displays the IPv4 routing table on Cisco devices?

Correct answer is A. "show ip route" displays the IPv4 routing table.

3. What does the route code 'O' represent in the routing table?

Correct answer is D. 'O' indicates a route learned via OSPF.

4. What does the administrative distance (AD) indicate?

Correct answer is B. AD determines how trusted a route is, lower values are preferred.

5. What is the default route shown as in the routing table?

Correct answer is C. The default IPv4 route is represented as 0.0.0.0/0.

6. How does a router select the best route when multiple routes exist to the same destination?

Correct answer is D. The router chooses the route with the lowest AD, and if tied, the lowest metric.

7. What does the 'C' route code indicate in the routing table?

Correct answer is A. 'C' means the route is directly connected to the router.

8. What is the purpose of a floating static route?

Correct answer is B. Floating static routes have higher AD to be used only if the primary route fails.

9. Which command filters routing table output to show only routes learned via OSPF?

Correct answer is D. The filter "show ip route ospf" shows only OSPF routes.

10. If a PC cannot reach the internet, what should be checked first in the routing table?

Correct answer is C. The default route is essential for internet traffic; if missing or incorrect, connectivity fails.

← Back to Home