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.1Fields 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 |
---|---|---|
C | Connected | Directly on interface |
S | Static | Manually configured |
O | OSPF | OSPF dynamic protocol |
D | EIGRP | EIGRP protocol |
R | RIP | RIP protocol |
B | BGP | Border Gateway Protocol |
S* | Static Default | Default route (0.0.0.0/0) |
Administrative Distance (AD) and Metrics
- Administrative Distance (AD): Trustworthiness of a route (lower = more preferred).
Common values:Source AD Value Connected 0 Static 1 EIGRP 90 OSPF 110 RIP 120 - Metric: Route cost (protocol-dependent; lower is better). Used if AD is equal between routes.
Route Selection Process
- Router compares AD values; picks the route with the lowest AD for each destination.
- 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.
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
andtraceroute
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.
- Check the routing table:
show ip route
- Is there a default route (0.0.0.0/0) pointing to the gateway? If not, add one.
- Is there a route to John’s subnet? If not, fix dynamic or static route config.
- Is the next-hop reachable? Use
ping
andtraceroute
.
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.